Answer extraction is useful (and meaningful only) when there are existential quantifiers at the outermost level of a conjecture. In this situation the conjecture can be considered to a question for which an answer is required, in the form of the values that instantiate the existentially quantified variables. This proposal describes how such instantiations can be returned in a standard and useful way.
fof(xyz,question, ? [X,Y,Z] : p(X,Y,Z)).
... and if the user wants values for only X and Z ...
fof(xyz,question, ? [X,Z] : ? [Y] : p(X,Y,Z)).
In THF there can be universally quantified variables outside the existentially quantified
variables, e.g., ...
thf(lambda,question, ! [A: $int,B: $int] : ? [R: $int] : ( ($difference @ A @ R) = B ) ).
... in which case the answer is a lambda term.
fof(some_p,axiom,? [X] : p(X) ).
fof(is_there_some_p,questions,? [X] : p(X) ).
The answer output lines are in the same style as SZS status and output lines.
fof(abc,axiom,p(a,b,c). fof(def,axiom,p(d,e,f). fof(xyz,question,? [X,Y,Z] : p(X,Y,Z) ).One answer:
% SZS answers Tuple [[X:= a,Y:= b,Z:= c]]All answers
% SZS answers Tuple [[X:= a,Y:= b,Z:= c],[X:= d,Y:= e,Z:= f]]
Examples:
| Axioms | Question | Answer |
|---|---|---|
| | ||
| p(a,b,c) p(d,e,f) | ? [X,Y,Z] : p(X,Y,Z) | [[X:= a,Y:= b,Z:= c]] One answer [[X:= a,Y:= b,Z:= c],[X:= d,Y:= e,Z:= f]] All answers |
| | ||
| p(a) p(b) a = b | ? [X] : ( p(X) & X != a ) | No answer (but compare with ? [X] : ( p(X) & ~$match(X,a) ) below) |
| | ||
| ! [X] : p(X) | ? [Y] : p(Y) | [[Y:= X]] |
| | ||
| ? [X] : p(X) | ? [X] : p(X) | No answer (Skolem's not permitted). This one is interesting - as a conjecture it's provable, but as a question it's not answerable. I like that! |
| | ||
| ! [Z] : p(Z) | ? [X] : p(f(X)) | [X:= Z1] |
| | ||
| p(f(a)) | ? [X] : p(f(X)) | [X:= a] |
| | ||
| ! [X] : mul(inv(X),X) = id ! [X] : mul(id,X) = X ! [X,Y,Z] : mul(X,mul(Y,Z)) = mul(mul(X,Y),Z) | ? [X] : mul(e1,X) = id | [X:= inv(e1)] |
| | ||
| ! [X] : mul(inv(X),X) = id ! [X] : mul(id,X) = X ! [X,Y,Z] : mul(X,mul(Y,Z)) = mul(mul(X,Y),Z) ! [X] : mul(X,id) = X | ? [Z] : ( (mul(e1,e2) = Y) => (mul(Z,Z) != id) ) | [Z:=
$ite(mul(e1,mul(e2,e1)) = e2,
e1,
$ite(id = mul(e2,mul(e1,e2))),
e1,
mul(e1,e2)]
|
| | ||
! [A: $int,B: $int] : ? [R: $int] : ( ($difference @ A @ R) = B ) | [^ [A: $int,B: $int] : R:= $uminus($sum($uminus(A),B))] | |
| | ||
Examples:
| Axioms | Question | Answer |
|---|---|---|
| | ||
| p(a) p(b) p(c) | ? [X] : ( p(X) & ( $match(X,a) | $match(X,d) ) ) | [X:= a] |
| | ||
| p(a) p(b) a = b | ? [X] : ( p(X) & ~$match(X,a) ) | [X:= b] |
| | ||
| ! [Z] : p(Z) | ? [X] : ( p(X) & ? [Y] : $match(X,f(Y)) ) | [X:= Z] |
| | ||
| p(f(Y,Z)) | ? [X] : ( p(f(X,b)) & $match(f(X,b),f(b,b))) | [X:= b] |
| | ||
| p(f(Y,Z)) | ? [X] : ( p(f(X,b)) & $match(f(X,b),f(b,Y))) | No answer, because Y represents all terms. |
| | ||
| p(f(a)) | ? [X] : ( p(X) & ? [Y] : $match(X,f(Y))) | [X:= f(a)] |
| | ||
| Axioms | Question | Answer |
|---|---|---|
| | ||
| sunday | monday monday => workshop(vampire) sunday => workshop(arcade) | ? [X]: workshop(X) | [X:= $ite(workshop(vampire,vampire,arcade))] |
| | ||
| sunday | monday monday => workshop(vampire) sunday => workshop(arcade) | ? [X]: ( workshop(X) & ~$contains(X,workshop) ) | [X:= vampire] | [X:= arcade] |
| | ||
| ! [X] : mul(inv(X),X) = id ! [X] : mul(id,X) = X ! [X,Y,Z] : mul(X,mul(Y,Z)) = mul(mul(X,Y),Z) | ? [X]: mul(X, mul(inv(a), inv(b))) != id | [X:= inv(mul(inv(a), inv(b)))] |
| | ||
| ! [X] : mul(inv(X),X) = id ! [X] : mul(id,X) = X ! [X,Y,Z] : mul(X,mul(Y,Z)) = mul(mul(X,Y),Z) | ? [X]: ( mul(X, mul(inv(a), inv(b))) != id & ~contains(X,inv) ) | [X:= TBA] |
| | ||