Implement experimental :match-conclusion
for rules
#26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a keyword to
define-rule
that makes the conclusion the first argument of a rule, and introducesstep
to make a given conclusion the first argument, or fail if no conclusion is given.The proof term
test1
is just(match1 (and c1 c2))
.Justification
After some experiments with Alethe Classic rules, I am changing my opinion about needing a feature to capture explicitly given conclusions.
For example, the simple
not_not
rule for double-negation elimination. It introduces the clause(not (not (not T)))
,T
. You would like to write this as a proof rule that takesT
as an argument. However, in Alethe Classic the solver is free to choose the order of the literals in the conclusion. Hence, a rule with:conclusion (cl (not (not (not T))) (not T))
could fail if the solver prints the conclusion in the wrong order.Therefore, any Alethe Classic rule that does not generate a unit clause would need the entire conclusion as an argument.
Whit this change the rule becomes:
Still not perfect, but better.
Implementation
When defining a rule, one can use
:match-conclusion
instead of:conclusion
. If this is used, the conclusion must be given in the step. To achieve this, define-rule with a:match-conclusion T
adds an additional argumentQuote T
to the start of the argument list, and sets the conclusion toProof T
. Thestep
command detects rules annotated with:match-conclusion
and hands the conclusion to the rule as the first argument.Hence, this feature doesn't change functional semantic of rules, it is just syntactic sugar for
step
.TODO: support in compiled version and write docu.