src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
changeset 58061 3d060f43accb
parent 57792 9cb24c835284
child 58073 1cd45fec98e2
equal deleted inserted replaced
58060:835b5443b978 58061:3d060f43accb
    54 val vampire_skolemisation_rule = "skolemisation"
    54 val vampire_skolemisation_rule = "skolemisation"
    55 val veriT_la_generic_rule = "la_generic"
    55 val veriT_la_generic_rule = "la_generic"
    56 val veriT_simp_arith_rule = "simp_arith"
    56 val veriT_simp_arith_rule = "simp_arith"
    57 val veriT_tmp_ite_elim_rule = "tmp_ite_elim"
    57 val veriT_tmp_ite_elim_rule = "tmp_ite_elim"
    58 val veriT_tmp_skolemize_rule = "tmp_skolemize"
    58 val veriT_tmp_skolemize_rule = "tmp_skolemize"
    59 val z3_skolemize_rule = Z3_New_Proof.string_of_rule Z3_New_Proof.Skolemize
    59 val z3_skolemize_rule = Z3_Proof.string_of_rule Z3_Proof.Skolemize
    60 val z3_th_lemma_rule_prefix = Z3_New_Proof.string_of_rule (Z3_New_Proof.Th_Lemma "")
    60 val z3_th_lemma_rule_prefix = Z3_Proof.string_of_rule (Z3_Proof.Th_Lemma "")
    61 val zipperposition_cnf_rule = "cnf"
    61 val zipperposition_cnf_rule = "cnf"
    62 
    62 
    63 val skolemize_rules =
    63 val skolemize_rules =
    64   [e_definition_rule, e_skolemize_rule, leo2_extcnf_forall_neg_rule, satallax_skolemize_rule,
    64   [e_definition_rule, e_skolemize_rule, leo2_extcnf_forall_neg_rule, satallax_skolemize_rule,
    65    spass_skolemize_rule, vampire_skolemisation_rule, veriT_tmp_ite_elim_rule,
    65    spass_skolemize_rule, vampire_skolemisation_rule, veriT_tmp_ite_elim_rule,
   151 
   151 
   152         val systematic_methods' = insert (op =) (Metis_Method alt_metis_args) systematic_methods
   152         val systematic_methods' = insert (op =) (Metis_Method alt_metis_args) systematic_methods
   153 
   153 
   154         fun massage_methods (meths as meth :: _) =
   154         fun massage_methods (meths as meth :: _) =
   155           if not try0 then [meth]
   155           if not try0 then [meth]
   156           else if smt_proofs = SOME true then SMT2_Method :: meths
   156           else if smt_proofs = SOME true then SMT_Method :: meths
   157           else meths
   157           else meths
   158 
   158 
   159         val (params, _, concl_t) = strip_subgoal goal subgoal ctxt
   159         val (params, _, concl_t) = strip_subgoal goal subgoal ctxt
   160         val fixes = map (fn (s, T) => (Binding.name s, SOME T, NoSyn)) params
   160         val fixes = map (fn (s, T) => (Binding.name s, SOME T, NoSyn)) params
   161         val ctxt = ctxt |> Variable.set_body false |> Proof_Context.add_fixes fixes |> snd
   161         val ctxt = ctxt |> Variable.set_body false |> Proof_Context.add_fixes fixes |> snd
   400         (if isar_proofs = SOME true then "\nWarning: Isar proof construction failed." else ""))
   400         (if isar_proofs = SOME true then "\nWarning: Isar proof construction failed." else ""))
   401   end
   401   end
   402 
   402 
   403 fun isar_proof_would_be_a_good_idea smt_proofs (meth, play) =
   403 fun isar_proof_would_be_a_good_idea smt_proofs (meth, play) =
   404   (case play of
   404   (case play of
   405     Played _ => meth = SMT2_Method andalso smt_proofs <> SOME true
   405     Played _ => meth = SMT_Method andalso smt_proofs <> SOME true
   406   | Play_Timed_Out time => Time.> (time, Time.zeroTime)
   406   | Play_Timed_Out time => Time.> (time, Time.zeroTime)
   407   | Play_Failed => true)
   407   | Play_Failed => true)
   408 
   408 
   409 fun proof_text ctxt debug isar_proofs smt_proofs isar_params num_chained
   409 fun proof_text ctxt debug isar_proofs smt_proofs isar_params num_chained
   410     (one_line_params as ((_, preplay), _, _, _)) =
   410     (one_line_params as ((_, preplay), _, _, _)) =