CanProve | try to prove statement |
CanProve(proposition) |
An example of a proposition is: "if a implies b and b implies c then a implies c". Yacas supports the following logical operations:
Not : negation, read as "not"
And : conjunction, read as "and"
Or : disjunction, read as "or"
=> : implication, read as "implies"
The abovementioned proposition would be represented by the following expression,
( (a=>b) And (b=>c) ) => (a=>c) |
Yacas can prove that is correct by applying CanProve to it:
In> CanProve(( (a=>b) And (b=>c) ) => (a=>c)) Out> True; |
It does this in the following way: in order to prove a proposition p, it suffices to prove that Not p is false. It continues to simplify Not p using the rules:
Not ( Not x) --> x |
x=>y --> Not x Or y |
Not (x And y) --> Not x Or Not y |
Not (x Or y) --> Not x And Not y |
(x And y) Or z --> (x Or z) And (y Or z) |
x Or (y And z) --> (x Or y) And (x Or z) |
True Or x --> True |
(p1 Or p2 Or ...) And (q1 Or q2 Or ...) And ... |
(p Or Y) And ( Not p Or Z) --> (Y Or Z) |
As a last step, the algorithm negates the result again. This has the added advantage of simplifying the expression further.
In> CanProve(a Or Not a) Out> True; In> CanProve(True Or a) Out> True; In> CanProve(False Or a) Out> a; In> CanProve(a And Not a) Out> False; In> CanProve(a Or b Or (a And b)) Out> a Or b; |