Here is logical formula:
$$\bigwedge_{i=1}^{9} \bigwedge_{n=1}^{9} \bigvee_{j=1}^{9}~p(i,j,n)$$
To use it in Mathematica I use that code:
X=Array[p[#1,#3,#2]&,{9,9,9}];a=Apply[And,Apply[And,Apply[Or,X,{2}],{1}],{0}];
Y=Array[p,{9,9,9}];b=Apply[And,Apply[And,Apply[Or,Transpose[Y,{1,3,2}],{2}],{1}],{0}];
c = 0
Two methods are used above. In the first one, I am putting the result in a
variable and with the second method in b
variable.
Now:
MatchQ[a,b]
True
MatchQ[a,c]
False
So, I conclude that the output of a
and b
are the same.
Now I want to check the logical equivalence of a
and b
.
I tried:
TrueQ[Equivalent[a, b]]
True
TrueQ[Equivalent[a, c]]
False
TrueQ[Equal[a,b]]
True
TrueQ[Equal[a,c]]
False
SameQ[a,b]
True
SameQ[a,c]
False
Questions:
What is called the content of
a
andb
? Logical formula? Function(s)? Normal expression? Object? Other?Are the all ways of checking the logical equivalence of
a
andb
that I have used above right?Are there any other possible ways to check the logical equivalence of
a
andb
that I have not used above?Is there one best way to check the logical equivalence of
a
andb
and if yes which one and why its is best one?