Skip to main content
deleted 112 characters in body
Source Link
Henrik Schumacher
  • 109.4k
  • 7
  • 186
  • 322

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:

  1. What is called the content of a and b? Logical formula? Function(s)? Normal expression? Object? Other?

  2. Are the all ways of checking the logical equivalence of a and b that I have used above right?

  3. Are there any other possible ways to check the logical equivalence of a and b that I have not used above?

  4. Is there one best way to check the logical equivalence of a and b and if yes which one and why its is best one?

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]

Out[82]= True

In[81]:= 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]]

Out[74]= True

In[76]:= TrueQ[Equivalent[a, c]]

Out[76]= False

In[77]:= TrueQ[Equal[a,b]]

Out[77]= True

In[78]:= TrueQ[Equal[a,c]]

Out[78]= False

In[72]:= SameQ[a,b]

Out[72]= True

In[73]:= SameQ[a,c]

Out[73]= False


Questions:

  1. What is called the content of a and b? Logical formula? Function(s)? Normal expression? Object? Other?

  2. Are the all ways of checking the logical equivalence of a and b that I have used above right?

  3. Are there any other possible ways to check the logical equivalence of a and b that I have not used above?

  4. Is there one best way to check the logical equivalence of a and b and if yes which one and why its is best one?

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:

  1. What is called the content of a and b? Logical formula? Function(s)? Normal expression? Object? Other?

  2. Are the all ways of checking the logical equivalence of a and b that I have used above right?

  3. Are there any other possible ways to check the logical equivalence of a and b that I have not used above?

  4. Is there one best way to check the logical equivalence of a and b and if yes which one and why its is best one?

Source Link
vasili111
  • 1.2k
  • 8
  • 14

Logical equivalence of logical propositions that are converted from compact (implicit) notation to Mathematica code

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]

Out[82]= True

In[81]:= 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]]

Out[74]= True

In[76]:= TrueQ[Equivalent[a, c]]

Out[76]= False

In[77]:= TrueQ[Equal[a,b]]

Out[77]= True

In[78]:= TrueQ[Equal[a,c]]

Out[78]= False

In[72]:= SameQ[a,b]

Out[72]= True

In[73]:= SameQ[a,c]

Out[73]= False


Questions:

  1. What is called the content of a and b? Logical formula? Function(s)? Normal expression? Object? Other?

  2. Are the all ways of checking the logical equivalence of a and b that I have used above right?

  3. Are there any other possible ways to check the logical equivalence of a and b that I have not used above?

  4. Is there one best way to check the logical equivalence of a and b and if yes which one and why its is best one?