Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Personally, I just tend to just use:</p> <pre><code>apply (metis thm) </code></pre> <p>which works most of the time without forcing me to think very hard (but will still occasionally fail if tricky resolution is required).</p> <p>Other methods that will also typically work include:</p> <pre><code>apply (rule thm) (* If "thm" has no premises. *) apply (erule thm) (* If "thm" has a single premise. *) apply (erule thm, assumption+) (* If "thm" has multiple premises. *) </code></pre> <p>Why is there no one single answer? The answer is a little complex:</p> <p>Internally, <code>solve_direct</code> calls <code>find_theorems solves</code>, which then performs the following:</p> <pre><code>fun etacn thm i = Seq.take (! tac_limit) o etac thm i; (* ... *) if Thm.no_prems thm then rtac thm 1 goal else (etacn thm THEN_ALL_NEW (Goal.norm_hhf_tac THEN' Method.assm_tac ctxt)) 1 goal; </code></pre> <p>This is the ML code for something similar to <code>rule thm</code> if there are no premises on the rule, or:</p> <pre><code>apply (erule thm, assumption+) </code></pre> <p>if there are multiple premises on the rule. As commented by Brian on your question, the above might still fail if there are complex meta-logical connectives in the assumptions (which the <code>norm_hhf_tac</code> deals with, but is not directly exposed as an Isabelle method as far as I am aware).</p> <p>If you wanted, you could write a new method that exposes the tactic used by <code>find_theorems</code> directly, as follows:</p> <pre><code>ML {* fun solve_direct_tac thm ctxt goal = if Thm.no_prems thm then rtac thm 1 goal else (etac thm THEN_ALL_NEW (Goal.norm_hhf_tac THEN' Method.assm_tac ctxt)) 1 goal; *} method_setup solve = {* Attrib.thm &gt;&gt; (fn thm =&gt; fn ctxt =&gt; SIMPLE_METHOD' (K (solve_direct_tac thm ctxt ))) *} "directly solve a rule" </code></pre> <p>This could then be used as follows:</p> <pre><code>lemma "⟦ a; b ⟧ ⟹ a ∧ b" by (solve conjI) </code></pre> <p>which should hopefully solve anything <code>solve_direct</code> throws at you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload