Is there a "generic" informal algorithm that users of Isabelle follow, when they are trying to prove something that isn't proved immediately by auto
or sledgehammer
? A kind of general way of figuring out, if auto
needs additional lemmas, formulated by the user, to succeed or if better some other proof method is used.
A related question is: Is there maybe a table to be found somewhere with all the proof methods together with the context in which to apply them? When I'm reading through the Programming and Proving tutorial, the description of various methods (respectively variants of some methods, such as the many variant of auto
) are scattered through the text, which constantly makes me go back and for between text and Isabelle code (which also leads to forgetting what exactly is used for what) and which results in a very inefficient workflow.
No, there's no "generic" informal way. You can use try0
which tries all standard proof methods (like auto
, blast
, fastforce
, …) and/or sledgehammer
which is more advanced.
After that, the fun part starts.
For your second question: No, there's no such overview. Maybe someone should write one, but as mentioned before you can simply use try0
.
ammbauer's answer already covers lots of important stuff, but here are some more things that may help you:
simp add:
) or some preconditions of the rule could not be proved (in that case, add enough facts so that they can be proved, or do it yourself in an additional step)define x where "x = …"
and unfold them with x_def
. This makes your goals smaller and cleaner and decreases the probability of the automation going down useless paths in its proof search.definition
, and you want to unfold it for a proof, you have to do that yourself by using unfolding foo_def
or simp add: foo_def
.fun
or primrec
are unfolding by anything using the simplifier (simp
, simp_all
, force
, auto
) unless the equations (foo.simps
) have manually been deleted from the simp set. (by lemmas [simp del] = foo.simps
or declare [simp del] foo.simps
)simp
or simp_all
. Anything related to classical reasoning (i.e. first-order logic or sets) calls for blast
. If you need both rewriting and classical reasoning, try auto
or force
. Think of auto
as a combination of simp
and blast
, and force
is like an ‘all-or-nothing’ variant of auto
that fails if it cannot solve the goal entirely. It also tries a little harder than auto
.add:
and del:
for simp
and simp_all
, and the equivalent simp:
/simp del:
for auto
. However, the classical reasoners (auto
, blast
, force
, etc.) also accept intro:
, dest:
, elim:
and the corresponding del:
options. These are for declaring introduction, destruction, and elimination rules.Some more information on the classical reasoner:
P ⟹ Q ⟹ R
that should be used whenever the goal has the form R
, to replace it with P
and Q
P ⟹ Q ⟹ R
that should be used whenever a fact of the form P
is in the premises to replace to goal G
with the new goals Q
and R ⟹ G
.thm exE
(elimination of the existential quantifier). These are like a generalisation of destruction rules that also allow introducing new variables. These rules often appear in this like case distinctions.auto
, blast
, force
etc. will use the rules in the claset (i.e. that have been declared intro
/dest
/elim
) automatically whenever appropriate. If doing that does not lead to a proof, the automation will backtrack at some point and try other rules. You can disable backtracking for specific rules by using intro!:
instead of intro:
(and analogously for the others). Then the automation will apply that rule whenever possible without ever looking back.rule
, drule
, erule
correspond to applying a single intro/dest/elim rule and are good for single step reasoning, e.g. in order to find out why automatic methods fail to make progress at a certain point. intro
is like rule
but applies the set of rules it is given iteratively until it is no longer possible.safe
and clarify
are occasionally useful. The former essentially strips away quantifiers and logical connectives (try it on a goal like ∀x. P x ∧ Q x ⟶ R x
) and the latter similarly tries to ‘clean up’ the goal. (I forgot what it does exactly, I just use it occasionally when I think it might be useful)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With