src/HOL/Tools/Metis/metis_tactic.ML
changeset 54883 dd04a8b654fc
parent 54756 dd0f4d265730
child 54914 25212efcd0de
equal deleted inserted replaced
54882:61276a7fc369 54883:dd04a8b654fc
    62   let
    62   let
    63     val thy = Proof_Context.theory_of ctxt
    63     val thy = Proof_Context.theory_of ctxt
    64     val tac = rewrite_goals_tac ctxt @{thms lambda_def [abs_def]} THEN rtac refl 1
    64     val tac = rewrite_goals_tac ctxt @{thms lambda_def [abs_def]} THEN rtac refl 1
    65     val t = hol_clause_of_metis ctxt type_enc sym_tab concealed mth
    65     val t = hol_clause_of_metis ctxt type_enc sym_tab concealed mth
    66     val ct = cterm_of thy (HOLogic.mk_Trueprop t)
    66     val ct = cterm_of thy (HOLogic.mk_Trueprop t)
    67   in Goal.prove_internal [] ct (K tac) |> Meson.make_meta_clause end
    67   in Goal.prove_internal ctxt [] ct (K tac) |> Meson.make_meta_clause end
    68 
    68 
    69 fun add_vars_and_frees (t $ u) = fold (add_vars_and_frees) [t, u]
    69 fun add_vars_and_frees (t $ u) = fold (add_vars_and_frees) [t, u]
    70   | add_vars_and_frees (Abs (_, _, t)) = add_vars_and_frees t
    70   | add_vars_and_frees (Abs (_, _, t)) = add_vars_and_frees t
    71   | add_vars_and_frees (t as Var _) = insert (op =) t
    71   | add_vars_and_frees (t as Var _) = insert (op =) t
    72   | add_vars_and_frees (t as Free _) = insert (op =) t
    72   | add_vars_and_frees (t as Free _) = insert (op =) t
    99       val eq_th = conv true ctxt (cprop_of th)
    99       val eq_th = conv true ctxt (cprop_of th)
   100       (* We replace the equation's left-hand side with a beta-equivalent term
   100       (* We replace the equation's left-hand side with a beta-equivalent term
   101          so that "Thm.equal_elim" works below. *)
   101          so that "Thm.equal_elim" works below. *)
   102       val t0 $ _ $ t2 = prop_of eq_th
   102       val t0 $ _ $ t2 = prop_of eq_th
   103       val eq_ct = t0 $ prop_of th $ t2 |> cterm_of thy
   103       val eq_ct = t0 $ prop_of th $ t2 |> cterm_of thy
   104       val eq_th' = Goal.prove_internal [] eq_ct (K (rtac eq_th 1))
   104       val eq_th' = Goal.prove_internal ctxt [] eq_ct (K (rtac eq_th 1))
   105     in Thm.equal_elim eq_th' th end
   105     in Thm.equal_elim eq_th' th end
   106 
   106 
   107 fun clause_params ordering =
   107 fun clause_params ordering =
   108   {ordering = ordering,
   108   {ordering = ordering,
   109    orderLiterals = Metis_Clause.UnsignedLiteralOrder,
   109    orderLiterals = Metis_Clause.UnsignedLiteralOrder,