# HG changeset patch # User wenzelm # Date 1632859731 -7200 # Node ID 9ea507f63bcb62633892592a08a42b39064fcf73 # Parent bb25ea271b159b75b93bd811a554cdcb8b03334d clarified antiquotations; diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/ATP/atp_problem_generate.ML --- a/src/HOL/Tools/ATP/atp_problem_generate.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/ATP/atp_problem_generate.ML Tue Sep 28 22:08:51 2021 +0200 @@ -773,17 +773,17 @@ fun is_first_order_lambda_free t = (case t of - \<^const>\Not\ $ t1 => is_first_order_lambda_free t1 - | Const (\<^const_name>\All\, _) $ Abs (_, _, t') => is_first_order_lambda_free t' - | Const (\<^const_name>\All\, _) $ t1 => is_first_order_lambda_free t1 - | Const (\<^const_name>\Ex\, _) $ Abs (_, _, t') => is_first_order_lambda_free t' - | Const (\<^const_name>\Ex\, _) $ t1 => is_first_order_lambda_free t1 - | \<^const>\HOL.conj\ $ t1 $ t2 => is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 - | \<^const>\HOL.disj\ $ t1 $ t2 => is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 - | \<^const>\HOL.implies\ $ t1 $ t2 => - is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 - | Const (\<^const_name>\HOL.eq\, Type (_, [\<^typ>\bool\, _])) $ t1 $ t2 => - is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 + \<^Const_>\Not for t1\ => is_first_order_lambda_free t1 + | \<^Const_>\All _ for \Abs (_, _, t')\\ => is_first_order_lambda_free t' + | \<^Const_>\All _ for t1\ => is_first_order_lambda_free t1 + | \<^Const_>\Ex _ for \Abs (_, _, t')\\ => is_first_order_lambda_free t' + | \<^Const_>\Ex _ for t1\ => is_first_order_lambda_free t1 + | \<^Const_>\conj for t1 t2\ => is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 + | \<^Const_>\disj for t1 t2\ => is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 + | \<^Const_>\implies for t1 t2\ => + is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 + | \<^Const_>\HOL.eq \<^Type>\bool\ for t1 t2\ => + is_first_order_lambda_free t1 andalso is_first_order_lambda_free t2 | _ => not (exists_subterm (fn Abs _ => true | _ => false) t)) fun simple_translate_lambdas eta_matters do_lambdas ctxt type_enc t = @@ -793,22 +793,22 @@ let fun trans_first_order Ts t = (case t of - \<^const>\Not\ $ t1 => \<^const>\Not\ $ trans_first_order Ts t1 - | (t0 as Const (\<^const_name>\All\, _)) $ Abs (s, T, t') => + \<^Const_>\Not for t1\ => \<^Const>\Not for \trans_first_order Ts t1\\ + | (t0 as \<^Const_>\All _\) $ Abs (s, T, t') => t0 $ Abs (s, T, trans_first_order (T :: Ts) t') - | (t0 as Const (\<^const_name>\All\, _)) $ t1 => + | (t0 as \<^Const_>\All _\) $ t1 => trans_first_order Ts (t0 $ eta_expand Ts t1 1) - | (t0 as Const (\<^const_name>\Ex\, _)) $ Abs (s, T, t') => + | (t0 as \<^Const_>\Ex _\) $ Abs (s, T, t') => t0 $ Abs (s, T, trans_first_order (T :: Ts) t') - | (t0 as Const (\<^const_name>\Ex\, _)) $ t1 => + | (t0 as \<^Const_>\Ex _\) $ t1 => trans_first_order Ts (t0 $ eta_expand Ts t1 1) - | (t0 as \<^const>\HOL.conj\) $ t1 $ t2 => + | (t0 as \<^Const_>\conj\) $ t1 $ t2 => t0 $ trans_first_order Ts t1 $ trans_first_order Ts t2 - | (t0 as \<^const>\HOL.disj\) $ t1 $ t2 => + | (t0 as \<^Const_>\disj\) $ t1 $ t2 => t0 $ trans_first_order Ts t1 $ trans_first_order Ts t2 - | (t0 as \<^const>\HOL.implies\) $ t1 $ t2 => + | (t0 as \<^Const_>\implies\) $ t1 $ t2 => t0 $ trans_first_order Ts t1 $ trans_first_order Ts t2 - | (t0 as Const (\<^const_name>\HOL.eq\, Type (_, [\<^typ>\bool\, _]))) $ t1 $ t2 => + | (t0 as \<^Const_>\HOL.eq \<^Type>\bool\\) $ t1 $ t2 => t0 $ trans_first_order Ts t1 $ trans_first_order Ts t2 | _ => if not (exists_subterm (fn Abs _ => true | _ => false) t) then t @@ -1381,18 +1381,18 @@ do_formula bs pos1 t1 ##>> do_formula bs pos2 t2 #>> uncurry (mk_aconn c) and do_formula bs pos t = (case t of - \<^const>\Trueprop\ $ t1 => do_formula bs pos t1 - | \<^const>\Not\ $ t1 => do_formula bs (Option.map not pos) t1 #>> mk_anot - | Const (\<^const_name>\All\, _) $ Abs (s, T, t') => do_quant bs AForall pos s T t' - | (t0 as Const (\<^const_name>\All\, _)) $ t1 => + \<^Const_>\Trueprop for t1\ => do_formula bs pos t1 + | \<^Const_>\Not for t1\ => do_formula bs (Option.map not pos) t1 #>> mk_anot + | \<^Const_>\All _ for \Abs (s, T, t')\\ => do_quant bs AForall pos s T t' + | (t0 as \<^Const_>\All _\) $ t1 => do_formula bs pos (t0 $ eta_expand (map (snd o snd) bs) t1 1) - | Const (\<^const_name>\Ex\, _) $ Abs (s, T, t') => do_quant bs AExists pos s T t' - | (t0 as Const (\<^const_name>\Ex\, _)) $ t1 => + | \<^Const_>\Ex _ for \Abs (s, T, t')\\ => do_quant bs AExists pos s T t' + | (t0 as \<^Const_>\Ex _\) $ t1 => do_formula bs pos (t0 $ eta_expand (map (snd o snd) bs) t1 1) - | \<^const>\HOL.conj\ $ t1 $ t2 => do_conn bs AAnd pos t1 pos t2 - | \<^const>\HOL.disj\ $ t1 $ t2 => do_conn bs AOr pos t1 pos t2 - | \<^const>\HOL.implies\ $ t1 $ t2 => do_conn bs AImplies (Option.map not pos) t1 pos t2 - | Const (\<^const_name>\HOL.eq\, Type (_, [\<^typ>\bool\, _])) $ t1 $ t2 => + | \<^Const_>\conj for t1 t2\ => do_conn bs AAnd pos t1 pos t2 + | \<^Const_>\disj for t1 t2\ => do_conn bs AOr pos t1 pos t2 + | \<^Const_>\implies for t1 t2\ => do_conn bs AImplies (Option.map not pos) t1 pos t2 + | \<^Const_>\HOL.eq \<^Type>\bool\ for t1 t2\ => if iff_for_eq then do_conn bs AIff NONE t1 NONE t2 else do_term bs t | _ => do_term bs t) in do_formula [] end @@ -1449,7 +1449,7 @@ |> presimplify_term simp_options ctxt |> HOLogic.dest_Trueprop end - handle TERM _ => \<^const>\True\ + handle TERM _ => \<^Const>\True\ (* Satallax prefers "=" to "<=>" (for definitions) and Metis (CNF) requires "=" for technical reasons. *) @@ -2030,9 +2030,9 @@ end in List.partition (curry (op =) Definition o #role) #>> reorder [] #> op @ end -fun s_not_prop (\<^const>\Trueprop\ $ t) = \<^const>\Trueprop\ $ s_not t - | s_not_prop (\<^const>\Pure.imp\ $ t $ \<^prop>\False\) = t - | s_not_prop t = \<^const>\Pure.imp\ $ t $ \<^prop>\False\ +fun s_not_prop \<^Const_>\Trueprop for t\ = \<^Const>\Trueprop for \s_not t\\ + | s_not_prop \<^Const_>\Pure.imp for t \<^prop>\False\\ = t + | s_not_prop t = \<^Const>\Pure.imp for t \<^prop>\False\\ fun translate_formulas simp_options ctxt prem_role format type_enc lam_trans presimp hyp_ts concl_t facts = diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/ATP/atp_proof_reconstruct.ML --- a/src/HOL/Tools/ATP/atp_proof_reconstruct.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/ATP/atp_proof_reconstruct.ML Tue Sep 28 22:08:51 2021 +0200 @@ -127,7 +127,7 @@ | (u, Const (\<^const_name>\True\, _)) => u | (Const (\<^const_name>\False\, _), v) => s_not v | (u, Const (\<^const_name>\False\, _)) => s_not u - | _ => if u aconv v then \<^const>\True\ else t $ simplify_bool u $ simplify_bool v) + | _ => if u aconv v then \<^Const>\True\ else t $ simplify_bool u $ simplify_bool v) | simplify_bool (t $ u) = simplify_bool t $ simplify_bool u | simplify_bool (Abs (s, T, t)) = Abs (s, T, simplify_bool t) | simplify_bool t = t @@ -351,7 +351,7 @@ error "Isar proof reconstruction failed because the ATP proof contains unparsable \ \material" else if String.isPrefix native_type_prefix s then - \<^const>\True\ (* ignore TPTP type information (needed?) *) + \<^Const>\True\ (* ignore TPTP type information (needed?) *) else if s = tptp_equal then list_comb (Const (\<^const_name>\HOL.eq\, Type_Infer.anyT \<^sort>\type\), map (do_term [] NONE) us) @@ -372,7 +372,7 @@ (nth us (length us - 2)) end else if s' = type_guard_name then - \<^const>\True\ (* ignore type predicates *) + \<^Const>\True\ (* ignore type predicates *) else let val new_skolem = String.isPrefix new_skolem_const_prefix s'' @@ -436,7 +436,7 @@ fun term_of_atom ctxt format type_enc textual sym_tab pos (u as ATerm ((s, _), _)) = if String.isPrefix class_prefix s then add_type_constraint pos (type_constraint_of_term ctxt u) - #> pair \<^const>\True\ + #> pair \<^Const>\True\ else pair (term_of_atp ctxt format type_enc textual sym_tab (SOME \<^typ>\bool\) u) @@ -617,8 +617,8 @@ fun repair_waldmeister_endgame proof = let - fun repair_tail (name, _, \<^const>\Trueprop\ $ t, rule, deps) = - (name, Negated_Conjecture, \<^const>\Trueprop\ $ s_not t, rule, deps) + fun repair_tail (name, _, \<^Const>\Trueprop for t\, rule, deps) = + (name, Negated_Conjecture, \<^Const>\Trueprop for \s_not t\\, rule, deps) fun repair_body [] = [] | repair_body ((line as ((num, _), _, _, _, _)) :: lines) = if num = waldmeister_conjecture_num then map repair_tail (line :: lines) diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/ATP/atp_util.ML --- a/src/HOL/Tools/ATP/atp_util.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/ATP/atp_util.ML Tue Sep 28 22:08:51 2021 +0200 @@ -261,43 +261,39 @@ (* Simple simplifications to ensure that sort annotations don't leave a trail of spurious "True"s. *) -fun s_not (Const (\<^const_name>\All\, T) $ Abs (s, T', t')) = - Const (\<^const_name>\Ex\, T) $ Abs (s, T', s_not t') - | s_not (Const (\<^const_name>\Ex\, T) $ Abs (s, T', t')) = - Const (\<^const_name>\All\, T) $ Abs (s, T', s_not t') - | s_not (\<^const>\HOL.implies\ $ t1 $ t2) = \<^const>\HOL.conj\ $ t1 $ s_not t2 - | s_not (\<^const>\HOL.conj\ $ t1 $ t2) = - \<^const>\HOL.disj\ $ s_not t1 $ s_not t2 - | s_not (\<^const>\HOL.disj\ $ t1 $ t2) = - \<^const>\HOL.conj\ $ s_not t1 $ s_not t2 - | s_not (\<^const>\False\) = \<^const>\True\ - | s_not (\<^const>\True\) = \<^const>\False\ - | s_not (\<^const>\Not\ $ t) = t - | s_not t = \<^const>\Not\ $ t +fun s_not \<^Const_>\All T for \Abs (s, T', t')\\ = \<^Const>\Ex T for \Abs (s, T', s_not t')\\ + | s_not \<^Const_>\Ex T for \Abs (s, T', t')\\ = \<^Const>\All T for \Abs (s, T', s_not t')\\ + | s_not \<^Const_>\implies for t1 t2\ = \<^Const>\conj for t1 \s_not t2\\ + | s_not \<^Const_>\conj for t1 t2\ = \<^Const>\disj for \s_not t1\ \s_not t2\\ + | s_not \<^Const_>\disj for t1 t2\ = \<^Const>\conj for \s_not t1\ \s_not t2\\ + | s_not \<^Const_>\False\ = \<^Const>\True\ + | s_not \<^Const_>\True\ = \<^Const>\False\ + | s_not \<^Const_>\Not for t\ = t + | s_not t = \<^Const>\Not for t\ -fun s_conj (\<^const>\True\, t2) = t2 - | s_conj (t1, \<^const>\True\) = t1 - | s_conj (\<^const>\False\, _) = \<^const>\False\ - | s_conj (_, \<^const>\False\) = \<^const>\False\ +fun s_conj (\<^Const_>\True\, t2) = t2 + | s_conj (t1, \<^Const_>\True\) = t1 + | s_conj (\<^Const_>\False\, _) = \<^Const>\False\ + | s_conj (_, \<^Const_>\False\) = \<^Const>\False\ | s_conj (t1, t2) = if t1 aconv t2 then t1 else HOLogic.mk_conj (t1, t2) -fun s_disj (\<^const>\False\, t2) = t2 - | s_disj (t1, \<^const>\False\) = t1 - | s_disj (\<^const>\True\, _) = \<^const>\True\ - | s_disj (_, \<^const>\True\) = \<^const>\True\ +fun s_disj (\<^Const_>\False\, t2) = t2 + | s_disj (t1, \<^Const_>\False\) = t1 + | s_disj (\<^Const_>\True\, _) = \<^Const>\True\ + | s_disj (_, \<^Const_>\True\) = \<^Const>\True\ | s_disj (t1, t2) = if t1 aconv t2 then t1 else HOLogic.mk_disj (t1, t2) -fun s_imp (\<^const>\True\, t2) = t2 - | s_imp (t1, \<^const>\False\) = s_not t1 - | s_imp (\<^const>\False\, _) = \<^const>\True\ - | s_imp (_, \<^const>\True\) = \<^const>\True\ +fun s_imp (\<^Const_>\True\, t2) = t2 + | s_imp (t1, \<^Const_>\False\) = s_not t1 + | s_imp (\<^Const_>\False\, _) = \<^Const>\True\ + | s_imp (_, \<^Const_>\True\) = \<^Const>\True\ | s_imp p = HOLogic.mk_imp p -fun s_iff (\<^const>\True\, t2) = t2 - | s_iff (t1, \<^const>\True\) = t1 - | s_iff (\<^const>\False\, t2) = s_not t2 - | s_iff (t1, \<^const>\False\) = s_not t1 - | s_iff (t1, t2) = if t1 aconv t2 then \<^const>\True\ else HOLogic.eq_const HOLogic.boolT $ t1 $ t2 +fun s_iff (\<^Const_>\True\, t2) = t2 + | s_iff (t1, \<^Const_>\True\) = t1 + | s_iff (\<^Const_>\False\, t2) = s_not t2 + | s_iff (t1, \<^Const_>\False\) = s_not t1 + | s_iff (t1, t2) = if t1 aconv t2 then \<^Const>\True\ else HOLogic.eq_const HOLogic.boolT $ t1 $ t2 fun close_form t = fold (fn ((s, i), T) => fn t' => @@ -352,18 +348,15 @@ t fun unextensionalize_def t = - case t of - \<^const>\Trueprop\ $ (Const (\<^const_name>\HOL.eq\, _) $ lhs $ rhs) => - (case strip_comb lhs of - (c as Const (_, T), args) => - if forall is_Var args andalso not (has_duplicates (op =) args) then - \<^const>\Trueprop\ - $ (Const (\<^const_name>\HOL.eq\, T --> T --> \<^typ>\bool\) - $ c $ fold_rev lambda args rhs) - else - t - | _ => t) - | _ => t + (case t of + \<^Const_>\Trueprop for \<^Const_>\HOL.eq _ for lhs rhs\\ => + (case strip_comb lhs of + (c as Const (_, T), args) => + if forall is_Var args andalso not (has_duplicates (op =) args) then + \<^Const>\Trueprop for \<^Const>\HOL.eq T for c \fold_rev lambda args rhs\\\ + else t + | _ => t) + | _ => t) (* Converts an elim-rule into an equivalent theorem that does not have the predicate variable. Leaves other theorems unchanged. We simply instantiate @@ -371,9 +364,8 @@ "Meson_Clausify".) *) fun transform_elim_prop t = case Logic.strip_imp_concl t of - \<^const>\Trueprop\ $ Var (z, \<^typ>\bool\) => - subst_Vars [(z, \<^const>\False\)] t - | Var (z, \<^typ>\prop\) => subst_Vars [(z, \<^prop>\False\)] t + \<^Const_>\Trueprop for \Var (z, \<^typ>\bool\)\\ => subst_Vars [(z, \<^Const>\False\)] t + | Var (z, \<^Type>\prop\) => subst_Vars [(z, \<^prop>\False\)] t | _ => t fun specialize_type thy (s, T) t = diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML --- a/src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/Sledgehammer/sledgehammer_fact.ML Tue Sep 28 22:08:51 2021 +0200 @@ -78,10 +78,10 @@ fun is_rec_eq lhs = Term.exists_subterm (curry (op =) (head_of lhs)) -fun is_rec_def (\<^const>\Trueprop\ $ t) = is_rec_def t - | is_rec_def (\<^const>\Pure.imp\ $ _ $ t2) = is_rec_def t2 - | is_rec_def (Const (\<^const_name>\Pure.eq\, _) $ t1 $ t2) = is_rec_eq t1 t2 - | is_rec_def (Const (\<^const_name>\HOL.eq\, _) $ t1 $ t2) = is_rec_eq t1 t2 +fun is_rec_def \<^Const_>\Trueprop for t\ = is_rec_def t + | is_rec_def \<^Const_>\Pure.imp for _ t2\ = is_rec_def t2 + | is_rec_def \<^Const_>\Pure.eq _ for t1 t2\ = is_rec_eq t1 t2 + | is_rec_def \<^Const_>\HOL.eq _ for t1 t2\ = is_rec_eq t1 t2 | is_rec_def _ = false fun is_assum assms th = exists (fn ct => Thm.prop_of th aconv Thm.term_of ct) assms @@ -249,8 +249,8 @@ else Interesting - fun interest_of_prop _ (\<^const>\Trueprop\ $ t) = interest_of_bool t - | interest_of_prop Ts (\<^const>\Pure.imp\ $ t $ u) = + fun interest_of_prop _ \<^Const_>\Trueprop for t\ = interest_of_bool t + | interest_of_prop Ts \<^Const_>\Pure.imp for t u\ = combine_interests (interest_of_prop Ts t) (interest_of_prop Ts u) | interest_of_prop Ts (Const (\<^const_name>\Pure.all\, _) $ Abs (_, T, t)) = if type_has_top_sort T then Deal_Breaker else interest_of_prop (T :: Ts) t @@ -331,9 +331,9 @@ end end -fun normalize_eq (\<^const>\Trueprop\ $ (t as (t0 as Const (\<^const_name>\HOL.eq\, _)) $ t1 $ t2)) = +fun normalize_eq (\<^Const_>\Trueprop\ $ (t as (t0 as Const (\<^const_name>\HOL.eq\, _)) $ t1 $ t2)) = if is_less_equal (Term_Ord.fast_term_ord (t1, t2)) then t else t0 $ t2 $ t1 - | normalize_eq (\<^const>\Trueprop\ $ (t as \<^const>\Not\ + | normalize_eq (\<^Const_>\Trueprop\ $ (t as \<^Const_>\Not\ $ ((t0 as Const (\<^const_name>\HOL.eq\, _)) $ t1 $ t2))) = if is_less_equal (Term_Ord.fast_term_ord (t1, t2)) then t else HOLogic.mk_not (t0 $ t2 $ t1) | normalize_eq (Const (\<^const_name>\Pure.eq\, Type (_, [T, _])) $ t1 $ t2) = @@ -376,7 +376,7 @@ fun struct_induct_rule_on th = (case Logic.strip_horn (Thm.prop_of th) of - (prems, \<^const>\Trueprop\ $ ((p as Var ((p_name, 0), _)) $ (a as Var (_, ind_T)))) => + (prems, \<^Const_>\Trueprop\ $ ((p as Var ((p_name, 0), _)) $ (a as Var (_, ind_T)))) => if not (is_TVar ind_T) andalso length prems > 1 andalso exists (exists_subterm (curry (op aconv) p)) prems andalso not (exists (exists_subterm (curry (op aconv) a)) prems) then diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/Sledgehammer/sledgehammer_mepo.ML --- a/src/HOL/Tools/Sledgehammer/sledgehammer_mepo.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/Sledgehammer/sledgehammer_mepo.ML Tue Sep 28 22:08:51 2021 +0200 @@ -178,18 +178,18 @@ and do_formula t = (case t of Const (\<^const_name>\Pure.all\, _) $ Abs (_, _, t') => do_formula t' - | \<^const>\Pure.imp\ $ t1 $ t2 => do_formula t1 #> do_formula t2 + | \<^Const_>\Pure.imp for t1 t2\ => do_formula t1 #> do_formula t2 | Const (\<^const_name>\Pure.eq\, Type (_, [T, _])) $ t1 $ t2 => do_term_or_formula false T t1 #> do_term_or_formula true T t2 - | \<^const>\Trueprop\ $ t1 => do_formula t1 - | \<^const>\False\ => I - | \<^const>\True\ => I - | \<^const>\Not\ $ t1 => do_formula t1 + | \<^Const_>\Trueprop for t1\ => do_formula t1 + | \<^Const_>\False\ => I + | \<^Const_>\True\ => I + | \<^Const_>\Not for t1\ => do_formula t1 | Const (\<^const_name>\All\, _) $ Abs (_, _, t') => do_formula t' | Const (\<^const_name>\Ex\, _) $ Abs (_, _, t') => do_formula t' - | \<^const>\HOL.conj\ $ t1 $ t2 => do_formula t1 #> do_formula t2 - | \<^const>\HOL.disj\ $ t1 $ t2 => do_formula t1 #> do_formula t2 - | \<^const>\HOL.implies\ $ t1 $ t2 => do_formula t1 #> do_formula t2 + | \<^Const_>\conj for t1 t2\ => do_formula t1 #> do_formula t2 + | \<^Const_>\disj for t1 t2\ => do_formula t1 #> do_formula t2 + | \<^Const_>\implies for t1 t2\ => do_formula t1 #> do_formula t2 | Const (\<^const_name>\HOL.eq\, Type (_, [T, _])) $ t1 $ t2 => do_term_or_formula false T t1 #> do_term_or_formula true T t2 | Const (\<^const_name>\If\, Type (_, [_, Type (_, [T, _])])) $ t1 $ t2 $ t3 => diff -r bb25ea271b15 -r 9ea507f63bcb src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML --- a/src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML Tue Sep 28 22:08:03 2021 +0200 +++ b/src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML Tue Sep 28 22:08:51 2021 +0200 @@ -76,17 +76,17 @@ fun do_equals t1 t2 = is_bad_equal t1 t2 orelse is_bad_equal t2 t1 fun do_formula pos t = (case (pos, t) of - (_, \<^const>\Trueprop\ $ t1) => do_formula pos t1 + (_, \<^Const_>\Trueprop for t1\) => do_formula pos t1 | (true, Const (\<^const_name>\Pure.all\, _) $ Abs (_, _, t')) => do_formula pos t' | (true, Const (\<^const_name>\All\, _) $ Abs (_, _, t')) => do_formula pos t' | (false, Const (\<^const_name>\Ex\, _) $ Abs (_, _, t')) => do_formula pos t' - | (_, \<^const>\Pure.imp\ $ t1 $ t2) => + | (_, \<^Const_>\Pure.imp for t1 t2\) => do_formula (not pos) t1 andalso (t2 = \<^prop>\False\ orelse do_formula pos t2) - | (_, \<^const>\HOL.implies\ $ t1 $ t2) => - do_formula (not pos) t1 andalso (t2 = \<^const>\False\ orelse do_formula pos t2) - | (_, \<^const>\Not\ $ t1) => do_formula (not pos) t1 - | (true, \<^const>\HOL.disj\ $ t1 $ t2) => forall (do_formula pos) [t1, t2] - | (false, \<^const>\HOL.conj\ $ t1 $ t2) => forall (do_formula pos) [t1, t2] + | (_, \<^Const_>\implies for t1 t2\) => + do_formula (not pos) t1 andalso (t2 = \<^Const>\False\ orelse do_formula pos t2) + | (_, \<^Const_>\Not for t1\) => do_formula (not pos) t1 + | (true, \<^Const_>\disj for t1 t2\) => forall (do_formula pos) [t1, t2] + | (false, \<^Const_>\conj for t1 t2\) => forall (do_formula pos) [t1, t2] | (true, Const (\<^const_name>\HOL.eq\, _) $ t1 $ t2) => do_equals t1 t2 | (true, Const (\<^const_name>\Pure.eq\, _) $ t1 $ t2) => do_equals t1 t2 | _ => false)