- ~x : not(x) or uses '1 - x'
- x Λ y : and(x,y) or multiplication operator 'x*y'
- x V y : or(x,y)
- x → y : imply(x,y)
(x → y) → (~y → ~x)It can be inputed into Matcalc8 as follows :
Input 1 : clear()
Input 2 : slogic('imply(imply(x,y),imply(not(y),not(x)))')
Ans. (1)*1
The result is (1)*1 (ie. 1). The function 'slogic' do a symbolic expansion of the logical formula and the final result shows that all the expanded terms are exactly cancelled except for the value 1.
Before we continues, we introduces another method to handle the above question. It is called 'proof by contradiction'.
First, noticing the following equivalence argument :
p → q is always true ↔ p Λ not(q) is always false
This argument is actually followed by :
x → y = ~x V y = ~(x Λ ~y)which are shown as follows :
Input 3 : slogic('or(not(x),y)')
Ans. (1)*1+(-1)*x+(1)*x*y
Input 4 : slogic('not(x*not(y))')
Ans. (1)*1+(-1)*x+(1)*x*y
The answers are both equal to 1 - x + xy which is the logical formula for x → y
With this argument, input 2 can be simplified by replacing the first 'imply' function with an '*'. Input 2 then becomes the following expression and the target of the expression is not 1 but 0 (ie. always false condition):
Input 5 : slogic('imply(x,y)*not(imply(not(y),not(x)))')
Ans. 0
The result is 0. This means that all terms of the logical formula are cancelled and the logical formula is always false.
An always false logical formula is what we called a 'conflict' or 'contradiction' condition.
One advantage of using arithmetic/multiplication formulation to logic is that it can be more easy to find conflict within a set of premises.
Below is an example :
A set of logical statements are listed below as premises :
- p → q
- q → r
- ~r
- p
Input 6 : slogic('imply(p,q)*imply(q,r)*not(r)*p')
Ans. 0
A value of 0 means that there exists conflict. (Note : if the answer is 1, the premises are consistence but they cannot be useful to draw any conclusions) For this example, it is quite obvious that there is a contradiction. Since (from 4) p is true, then (from 1) q is true, and this imply (from 2) r is true. But (from 3) not(r) is true. Since r and not(r) cannot be true at the same time, there results a contradiction.
Below is another example that looks more complicated :
- a Λ b → c
- ~c → d Λ f
- ~f → h Λ a
- d → false
Ans. (1)c*f + (-1)*c*d*f + (1)*a*c*h + (-1)*a*c*d*h + (-1)*a*c*f*h + (1)*a*c*d*f*h
Since the answer is not 0 or 1, these set of premises do not contains contradiction or it is a logical tautolgy.
From the answer, we can also see that all terms contains 'c', this means that these set of premises imply c.
We can check by adding not(c) to the premises :
Input 8 : slogic('imply(a*b,c)*imply(not(c),d*f)*imply(not(f),h*a)*imply(d,0)*not(c)')
Ans. 0
As expected, it gives 0, a contradiction.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.