Running Example

Question

Answers

TPTP format Question

    fof(pab,axiom,      p(a,b)            ).
    fof(pafbc,axiom,    p(a,f(b,c))       ).
    fof(pbZ,axiom,      ! [Z] : p(b,Z)    ).
    fof(pZc,axiom,      ! [Z] : p(Z,c)    ).
    fof(a_not_b,axiom,  a != b            ).
    fof(a_is_c,axiom,   a = c             ).
    fof(pXY,question,   ? [X,Y] : p(X,Y)  ).

TPTP format Answers

Denying Previous Answers with Inequalities

    fof(pXY,question,   ? [X,Y] : ( p(X,Y) ).                 p(a,b)
    %----Answer [a,b]                                         p(a,f(b,c))
                                                              ∀Z p(b,Z)
    fof(pXY,question,   ? [X,Y] : ( p(X,Y) &                  ∀Z p(Z,c)
        (X != a | Y != b) )  ).                               a != b
    %----Answer [b,Z]                                         a = c

    fof(pXY,question,   ? [X,Y] : ! [Z] : ( p(X,Y) & 
        (X != a | Y != b) & (X != b | Y != Z) )  ).
    %----Answer [a,c]

    fof(pXY,question,   ? [X,Y] : ! [Z] : ( p(X,Y) & 
        (X != a | Y != b) & (X != b | Y != Z) &
        (X != a | Y != c) )  ).
    %----CounterSatisfiable.

Denying Previous Answers with "look different" Axioms

    fof(pXY,question,   ? [X,Y] : ( p(X,Y) ).                 p(a,b)
    %----Answer [a,b]                                         p(a,f(b,c))
                                                              ∀Z p(b,Z)
    fof(ld__a_b,axiom,  ld__(a,b)  ).                         ∀Z p(Z,c)
    fof(ld__a_c,axiom,  ld__(a,c)  ).                         a != b
    fof(ld__a_f,axiom,  ! [X,Y] : ld__(a,f(X,Y))  ).          a = c
    fof(ld__b_c,axiom,  ld__(b,c)  ).
    fof(ld__b_f,axiom,  ! [X,Y] : ld__(b,f(X,Y))  ).
    fof(ld__symmetry,axiom,! [X,Y] : (ld__(X,Y) => ld__(Y,X))  ).
    fof(pXY,question,   ? [X,Y] : ( p(X,Y) & 
        (ld__(X,a) | ld__(Y,b)) )  ).
    %----Answer [a,f(b,c)]

    fof(ld__c_f,axiom,  ! [X,Y] : ld__(c,f(X,Y))  ).
    fof(ld__f_f,axiom,  ! [X11,X12,X21,X22] :
        ( (ld__(X11,X12) | ld__(X21,X22))
       => ld__(f(X11,X21),f(X12,X22)) )  ).
    fof(pXY,question,   ? [X,Y] : ( p(X,Y) & 
        (ld__(X,a) | ld__(Y,b)) & 
        (ld__(X,a) | ld__(Y,f(b,c))) )  ).
    %----Answer [b,Z]

    etc.

Equality Testing