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:
In[82]:= MatchQ[a,b]
MatchQ[a,b]
Out[82]= True
In[81]:= MatchQ[a,c]
MatchQ[a,c]
Out[81]= 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:
In[74]:= TrueQ[Equivalent[a, b]]
TrueQ[Equivalent[a, b]]
Out[74]= True
In[76]:= TrueQ[Equivalent[a, c]]
TrueQ[Equivalent[a, c]]
Out[76]= False
In[77]:= TrueQ[Equal[a,b]]
TrueQ[Equal[a,b]]
Out[77]= True
In[78]:= TrueQ[Equal[a,c]]
TrueQ[Equal[a,c]]
Out[78]= False
In[72]:= SameQ[a,b]
SameQ[a,b]
Out[72]= True
In[73]:= SameQ[a,c]
SameQ[a,c]
Out[73]= 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?