Pretty cool; EquationalLogic`FindCounterexample
is still pretty mysterious (at least to me), but I managed to get it to do something more interesting than spit back numbers.
EquationalLogic`FindCounterexample[f[a, i] == a, f[a, a] == a]
(* {{f -> ({{1, 2}, {1, 1}}[[##1]] &), a -> 1}, {i -> 2}} *)
It appears the the first clause satisfies the logical constraints from the second argument (i.e., the assumptions) and the second clause makes violates the first clause.
This is speculation, but perhaps EquationalLogic`FindCounterexample
returns a number when it has some kind of error.
EquationalLogic`FindProof
and EquationalLogic`Prove
appears to be implementing a term-rewriting based proof system (like Equational Logic from Mathworld). This reminds me of SIMP_TAC
from the computer proof assistant HOL Light.
A key difference is that the logic of this prover does not follow the following rules from equational logic: $$\frac{a=b}{f(a)=f(b)}$$ $$\frac{a=b}{a(x)=b(x)}$$
Seems to work fine as a term-rewriting prover despite lacking those rules. Here's a little proof in combinatory logic using the EquationalLogic
prover:
EquationalLogic`Prove[
ForAll[x, Composition[s, k]@k@x == x],
ForAll[{x, y}, Composition[k, x]@y == x] &&
ForAll[{f, g, x}, Composition[s, f]@g@x == Composition[f, g]@Composition[g, x]]
]
(* True *)
You can do a lot of this stuff with Prover9, if you want a point of comparison.
As a final note, since it is apparently possible to express combinatory logic in this system, it is possible to ask the EquationalLogic
prover to prove an undecidable proposition. From my own experiments, it will eat up all of your memory if you ask it to prove something it can't.