# HG changeset patch # User wenzelm # Date 1632948878 -7200 # Node ID e80c4cde606476ac666ede7749ce2d9213530639 # Parent dc73f9e6476b8758914517c4d02592b1e103e5e8 clarified antiquotations; some comments concerning odd "- numeral"; diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Approximation.thy --- a/src/HOL/Decision_Procs/Approximation.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Approximation.thy Wed Sep 29 22:54:38 2021 +0200 @@ -1033,24 +1033,24 @@ form } ctxt ct - fun term_of_bool true = \<^term>\True\ - | term_of_bool false = \<^term>\False\; + fun term_of_bool true = \<^Const>\True\ + | term_of_bool false = \<^Const>\False\; - val mk_int = HOLogic.mk_number \<^typ>\int\ o @{code integer_of_int}; + val mk_int = HOLogic.mk_number \<^Type>\int\ o @{code integer_of_int}; fun term_of_float (@{code Float} (k, l)) = - \<^term>\Float\ $ mk_int k $ mk_int l; + \<^Const>\Float for \mk_int k\ \mk_int l\\; fun term_of_float_interval x = @{term "Interval::_\float interval"} $ HOLogic.mk_prod (apply2 term_of_float (@{code lowerF} x, @{code upperF} x)) - fun term_of_float_interval_option NONE = \<^term>\None :: (float interval) option\ - | term_of_float_interval_option (SOME ff) = \<^term>\Some :: float interval \ _\ - $ (term_of_float_interval ff); + fun term_of_float_interval_option NONE = \<^Const>\None \<^typ>\float interval option\\ + | term_of_float_interval_option (SOME ff) = + \<^Const>\Some \<^typ>\float interval\ for \term_of_float_interval ff\\; val term_of_float_interval_option_list = - HOLogic.mk_list \<^typ>\(float interval) option\ o map term_of_float_interval_option; + HOLogic.mk_list \<^typ>\float interval option\ o map term_of_float_interval_option; val approx_bool = @{computation bool} (fn _ => fn x => case x of SOME b => term_of_bool b diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Commutative_Ring.thy --- a/src/HOL/Decision_Procs/Commutative_Ring.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Commutative_Ring.thy Wed Sep 29 22:54:38 2021 +0200 @@ -649,13 +649,13 @@ by (induct l) (simp_all add: cring_class.in_carrier_def carrier_class) ML \ -val term_of_nat = HOLogic.mk_number \<^typ>\nat\ o @{code integer_of_nat}; +val term_of_nat = HOLogic.mk_number \<^Type>\nat\ o @{code integer_of_nat}; -val term_of_int = HOLogic.mk_number \<^typ>\int\ o @{code integer_of_int}; +val term_of_int = HOLogic.mk_number \<^Type>\int\ o @{code integer_of_int}; -fun term_of_pol (@{code Pc} k) = \<^term>\Pc\ $ term_of_int k - | term_of_pol (@{code Pinj} (n, p)) = \<^term>\Pinj\ $ term_of_nat n $ term_of_pol p - | term_of_pol (@{code PX} (p, n, q)) = \<^term>\PX\ $ term_of_pol p $ term_of_nat n $ term_of_pol q; +fun term_of_pol (@{code Pc} k) = \<^Const>\Pc\ $ term_of_int k + | term_of_pol (@{code Pinj} (n, p)) = \<^Const>\Pinj\ $ term_of_nat n $ term_of_pol p + | term_of_pol (@{code PX} (p, n, q)) = \<^Const>\PX\ $ term_of_pol p $ term_of_nat n $ term_of_pol q; local @@ -742,53 +742,43 @@ in (map tr ths1, map tr ths2, map tr ths3, map tr ths4, tr th5, tr th) end | NONE => error "get_ring_simps: lookup failed"); -fun ring_struct (Const (\<^const_name>\Ring.ring.add\, _) $ R $ _ $ _) = SOME R - | ring_struct (Const (\<^const_name>\Ring.a_minus\, _) $ R $ _ $ _) = SOME R - | ring_struct (Const (\<^const_name>\Group.monoid.mult\, _) $ R $ _ $ _) = SOME R - | ring_struct (Const (\<^const_name>\Ring.a_inv\, _) $ R $ _) = SOME R - | ring_struct (Const (\<^const_name>\Group.pow\, _) $ R $ _ $ _) = SOME R - | ring_struct (Const (\<^const_name>\Ring.ring.zero\, _) $ R) = SOME R - | ring_struct (Const (\<^const_name>\Group.monoid.one\, _) $ R) = SOME R - | ring_struct (Const (\<^const_name>\Algebra_Aux.of_integer\, _) $ R $ _) = SOME R +fun ring_struct \<^Const_>\Ring.ring.add _ _ for R _ _\ = SOME R + | ring_struct \<^Const_>\Ring.a_minus _ _ for R _ _\ = SOME R + | ring_struct \<^Const_>\Group.monoid.mult _ _ for R _ _\ = SOME R + | ring_struct \<^Const_>\Ring.a_inv _ _ for R _\ = SOME R + | ring_struct \<^Const_>\Group.pow _ _ _ for R _ _\ = SOME R + | ring_struct \<^Const_>\Ring.ring.zero _ _ for R\ = SOME R + | ring_struct \<^Const_>\Group.monoid.one _ _ for R\ = SOME R + | ring_struct \<^Const_>\Algebra_Aux.of_integer _ _ for R _\ = SOME R | ring_struct _ = NONE; -fun reif_polex vs (Const (\<^const_name>\Ring.ring.add\, _) $ _ $ a $ b) = - \<^const>\Add\ $ reif_polex vs a $ reif_polex vs b - | reif_polex vs (Const (\<^const_name>\Ring.a_minus\, _) $ _ $ a $ b) = - \<^const>\Sub\ $ reif_polex vs a $ reif_polex vs b - | reif_polex vs (Const (\<^const_name>\Group.monoid.mult\, _) $ _ $ a $ b) = - \<^const>\Mul\ $ reif_polex vs a $ reif_polex vs b - | reif_polex vs (Const (\<^const_name>\Ring.a_inv\, _) $ _ $ a) = - \<^const>\Neg\ $ reif_polex vs a - | reif_polex vs (Const (\<^const_name>\Group.pow\, _) $ _ $ a $ n) = - \<^const>\Pow\ $ reif_polex vs a $ n +fun reif_polex vs \<^Const_>\Ring.ring.add _ _ for _ a b\ = + \<^Const>\Add for \reif_polex vs a\ \reif_polex vs b\\ + | reif_polex vs \<^Const_>\Ring.a_minus _ _ for _ a b\ = + \<^Const>\Sub for \reif_polex vs a\ \reif_polex vs b\\ + | reif_polex vs \<^Const_>\Group.monoid.mult _ _ for _ a b\ = + \<^Const>\Mul for \reif_polex vs a\ \reif_polex vs b\\ + | reif_polex vs \<^Const_>\Ring.a_inv _ _ for _ a\ = + \<^Const>\Neg for \reif_polex vs a\\ + | reif_polex vs \<^Const_>\Group.pow _ _ _ for _ a n\ = + \<^Const>\Pow for \reif_polex vs a\ n\ | reif_polex vs (Free x) = - \<^const>\Var\ $ HOLogic.mk_number HOLogic.natT (find_index (equal x) vs) - | reif_polex vs (Const (\<^const_name>\Ring.ring.zero\, _) $ _) = - \<^term>\Const 0\ - | reif_polex vs (Const (\<^const_name>\Group.monoid.one\, _) $ _) = - \<^term>\Const 1\ - | reif_polex vs (Const (\<^const_name>\Algebra_Aux.of_integer\, _) $ _ $ n) = - \<^const>\Const\ $ n + \<^Const>\Var for \HOLogic.mk_number HOLogic.natT (find_index (equal x) vs)\\ + | reif_polex _ \<^Const_>\Ring.ring.zero _ _ for _\ = \<^term>\Const 0\ + | reif_polex _ \<^Const_>\Group.monoid.one _ _ for _\ = \<^term>\Const 1\ + | reif_polex _ \<^Const_>\Algebra_Aux.of_integer _ _ for _ n\ = \<^Const>\Const for n\ | reif_polex _ _ = error "reif_polex: bad expression"; -fun reif_polex' vs (Const (\<^const_name>\Groups.plus\, _) $ a $ b) = - \<^const>\Add\ $ reif_polex' vs a $ reif_polex' vs b - | reif_polex' vs (Const (\<^const_name>\Groups.minus\, _) $ a $ b) = - \<^const>\Sub\ $ reif_polex' vs a $ reif_polex' vs b - | reif_polex' vs (Const (\<^const_name>\Groups.times\, _) $ a $ b) = - \<^const>\Mul\ $ reif_polex' vs a $ reif_polex' vs b - | reif_polex' vs (Const (\<^const_name>\Groups.uminus\, _) $ a) = - \<^const>\Neg\ $ reif_polex' vs a - | reif_polex' vs (Const (\<^const_name>\Power.power\, _) $ a $ n) = - \<^const>\Pow\ $ reif_polex' vs a $ n - | reif_polex' vs (Free x) = - \<^const>\Var\ $ HOLogic.mk_number HOLogic.natT (find_index (equal x) vs) - | reif_polex' vs (Const (\<^const_name>\numeral\, _) $ b) = - \<^const>\Const\ $ (@{const numeral (int)} $ b) - | reif_polex' vs (Const (\<^const_name>\zero_class.zero\, _)) = \<^term>\Const 0\ - | reif_polex' vs (Const (\<^const_name>\one_class.one\, _)) = \<^term>\Const 1\ - | reif_polex' vs t = error "reif_polex: bad expression"; +fun reif_polex' vs \<^Const_>\plus _ for a b\ = \<^Const>\Add for \reif_polex' vs a\ \reif_polex' vs b\\ + | reif_polex' vs \<^Const_>\minus _ for a b\ = \<^Const>\Sub for \reif_polex' vs a\ \reif_polex' vs b\\ + | reif_polex' vs \<^Const_>\times _ for a b\ = \<^Const>\Mul for \reif_polex' vs a\ \reif_polex' vs b\\ + | reif_polex' vs \<^Const_>\uminus _ for a\ = \<^Const>\Neg for \reif_polex' vs a\\ + | reif_polex' vs \<^Const_>\power _ for a n\ = \<^Const>\Pow for \reif_polex' vs a\ n\ + | reif_polex' vs (Free x) = \<^Const>\Var for \HOLogic.mk_number \<^Type>\nat\ (find_index (equal x) vs)\\ + | reif_polex' _ \<^Const_>\numeral _ for b\ = \<^Const>\Const for \<^Const>\numeral \<^Type>\int\ for b\\ + | reif_polex' _ \<^Const_>\zero_class.zero _\ = \<^term>\Const 0\ + | reif_polex' _ \<^Const_>\one_class.one _\ = \<^term>\Const 1\ + | reif_polex' _ t = error "reif_polex: bad expression"; fun head_conv (_, _, _, _, head_simp, _) ys = (case strip_app ys of @@ -892,9 +882,8 @@ val props = map fst (Facts.props (Proof_Context.facts_of ctxt)) @ maps dest_conj prems; val ths = map (fn p as (x, _) => (case find_first - ((fn Const (\<^const_name>\Trueprop\, _) $ - (Const (\<^const_name>\Set.member\, _) $ - Free (y, _) $ (Const (\<^const_name>\carrier\, _) $ S)) => + ((fn \<^Const_>\Trueprop + for \<^Const_>\Set.member _ for \Free (y, _)\ \<^Const_>\carrier _ _ for S\\\ => x = y andalso R aconv S | _ => false) o Thm.prop_of) props of SOME th => th @@ -905,11 +894,7 @@ ths in_carrier_Nil end; -fun mk_ring T = - Const (\<^const_name>\cring_class_ops\, - Type (\<^type_name>\partial_object_ext\, [T, - Type (\<^type_name>\monoid_ext\, [T, - Type (\<^type_name>\ring_ext\, [T, \<^typ>\unit\])])])); +fun mk_ring T = \<^Const>\cring_class_ops T\; val iterations = \<^cterm>\1000::nat\; val Trueprop_cong = Thm.combination (Thm.reflexive \<^cterm>\Trueprop\); @@ -926,7 +911,7 @@ | NONE => (mk_ring T, SOME cT, @{thm in_carrier_trivial}, reif_polex' xs)); val rls as (_, _, _, _, _, norm_subst_correct) = get_ring_simps ctxt optcT R; val cxs = Thm.cterm_of ctxt (HOLogic.mk_list T (map Free xs)); - val ceqs = Thm.cterm_of ctxt (HOLogic.mk_list \<^typ>\polex * polex\ + val ceqs = Thm.cterm_of ctxt (HOLogic.mk_list \<^typ>\polex \ polex\ (map (HOLogic.mk_prod o apply2 reif) eqs')); val cp = Thm.cterm_of ctxt (reif (Thm.term_of ct)); val prem = Thm.equal_elim diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Conversions.thy --- a/src/HOL/Decision_Procs/Conversions.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Conversions.thy Wed Sep 29 22:54:38 2021 +0200 @@ -257,13 +257,12 @@ in fn n => case Thm.term_of n of - Const (\<^const_name>\one_class.one\, _) => numeral_1_eq_1_a - | Const (\<^const_name>\uminus\, _) $ Const (\<^const_name>\one_class.one\, _) => + \<^Const_>\one_class.one _\ => numeral_1_eq_1_a + | \<^Const_>\uminus _ for \<^Const_>\one_class.one _\\ => Thm.combination (Thm.reflexive (Thm.dest_fun n)) numeral_1_eq_1_a - | Const (\<^const_name>\zero_class.zero\, _) => Thm.reflexive n - | Const (\<^const_name>\numeral\, _) $ _ => Thm.reflexive n - | Const (\<^const_name>\uminus\, _) $ - (Const (\<^const_name>\numeral\, _) $ _) => Thm.reflexive n + | \<^Const_>\zero_class.zero _\ => Thm.reflexive n + | \<^Const_>\numeral _ for _\ => Thm.reflexive n + | \<^Const_>\uminus _ for \<^Const_>\numeral _ for _\\ => Thm.reflexive n | _ => err "expand1" n end; @@ -272,10 +271,8 @@ in fn eq => case Thm.term_of (Thm.rhs_of eq) of - Const (\<^const_name>\Num.numeral\, _) $ Const (\<^const_name>\Num.One\, _) => - Thm.transitive eq numeral_1_eq_1_a - | Const (\<^const_name>\uminus\, _) $ - (Const (\<^const_name>\Num.numeral\, _) $ Const (\<^const_name>\Num.One\, _)) => + \<^Const_>\Num.numeral _ for \<^Const_>\Num.One\\ => Thm.transitive eq numeral_1_eq_1_a + | \<^Const_>\uminus _ for \<^Const_>\Num.numeral _ for \<^Const_>\Num.One\\\ => Thm.transitive eq (Thm.combination (Thm.reflexive (Thm.dest_fun (Thm.rhs_of eq))) numeral_1_eq_1_a) @@ -777,7 +774,7 @@ val eq = Thm.combination (Thm.reflexive (Thm.dest_fun (Thm.dest_fun2 ct))) p_eq in case Thm.term_of (Thm.rhs_of p_eq) of - Const (\<^const_name>\True\, _) => + \<^Const_>\True\ => let val x_eq = x cx; val cx = Thm.rhs_of x_eq; @@ -788,7 +785,7 @@ (Thm.reflexive cy)) (inst [] [cx, cy] if_True) end - | Const (\<^const_name>\False\, _) => + | \<^Const_>\False\ => let val y_eq = y cy; val cy = Thm.rhs_of y_eq; @@ -812,7 +809,7 @@ val If_conv_a = If_conv (type_of_eqn drop_0_a); fun conv n ys = (case Thm.term_of n of - Const (\<^const_name>\zero_class.zero\, _) => inst [] [ys] drop_0_a + \<^Const_>\zero_class.zero _\ => inst [] [ys] drop_0_a | _ => (case strip_app ys of (\<^const_name>\Cons\, [x, xs]) => transitive' diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Cooper.thy --- a/src/HOL/Decision_Procs/Cooper.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Cooper.thy Wed Sep 29 22:54:38 2021 +0200 @@ -2386,17 +2386,17 @@ | num_of_term vs \<^term>\0::int\ = @{code C} (@{code int_of_integer} 0) | num_of_term vs \<^term>\1::int\ = @{code C} (@{code int_of_integer} 1) | num_of_term vs \<^term>\- 1::int\ = @{code C} (@{code int_of_integer} (~ 1)) - | num_of_term vs (\<^term>\numeral :: _ \ int\ $ t) = + | num_of_term vs \<^Const_>\numeral _ for t\ = @{code C} (@{code int_of_integer} (HOLogic.dest_numeral t)) - | num_of_term vs (\<^term>\- numeral :: _ \ int\ $ t) = + | num_of_term vs (\<^term>\- numeral :: _ \ int\ $ t) = (* FIXME !? *) @{code C} (@{code int_of_integer} (~(HOLogic.dest_numeral t))) | num_of_term vs (Bound i) = @{code Bound} (@{code nat_of_integer} i) - | num_of_term vs (\<^term>\uminus :: int \ int\ $ t') = @{code Neg} (num_of_term vs t') - | num_of_term vs (\<^term>\(+) :: int \ int \ int\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\uminus \<^Type>\int\ for t'\ = @{code Neg} (num_of_term vs t') + | num_of_term vs \<^Const_>\plus \<^Type>\int\ for t1 t2\ = @{code Add} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(-) :: int \ int \ int\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\minus \<^Type>\int\ for t1 t2\ = @{code Sub} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(*) :: int \ int \ int\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\times \<^Type>\int\ for t1 t2\ = (case try HOLogic.dest_number t1 of SOME (_, i) => @{code Mul} (@{code int_of_integer} i, num_of_term vs t2) | NONE => @@ -2405,34 +2405,34 @@ | NONE => error "num_of_term: unsupported multiplication")) | num_of_term vs t = error ("num_of_term: unknown term " ^ Syntax.string_of_term \<^context> t); -fun fm_of_term ps vs \<^term>\True\ = @{code T} - | fm_of_term ps vs \<^term>\False\ = @{code F} - | fm_of_term ps vs (\<^term>\(<) :: int \ int \ bool\ $ t1 $ t2) = +fun fm_of_term ps vs \<^Const_>\True\ = @{code T} + | fm_of_term ps vs \<^Const_>\False\ = @{code F} + | fm_of_term ps vs \<^Const_>\less \<^Type>\int\ for t1 t2\ = @{code Lt} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term ps vs (\<^term>\(\) :: int \ int \ bool\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\less_eq \<^Type>\int\ for t1 t2\ = @{code Le} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term ps vs (\<^term>\(=) :: int \ int \ bool\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\HOL.eq \<^Type>\int\ for t1 t2\ = @{code Eq} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term ps vs (\<^term>\(dvd) :: int \ int \ bool\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\dvd \<^Type>\int\ for t1 t2\ = (case try HOLogic.dest_number t1 of SOME (_, i) => @{code Dvd} (@{code int_of_integer} i, num_of_term vs t2) | NONE => error "num_of_term: unsupported dvd") - | fm_of_term ps vs (\<^term>\(=) :: bool \ bool \ bool\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\HOL.eq \<^Type>\bool\ for t1 t2\ = @{code Iff} (fm_of_term ps vs t1, fm_of_term ps vs t2) - | fm_of_term ps vs (\<^term>\HOL.conj\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\HOL.conj for t1 t2\ = @{code And} (fm_of_term ps vs t1, fm_of_term ps vs t2) - | fm_of_term ps vs (\<^term>\HOL.disj\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\HOL.disj for t1 t2\ = @{code Or} (fm_of_term ps vs t1, fm_of_term ps vs t2) - | fm_of_term ps vs (\<^term>\HOL.implies\ $ t1 $ t2) = + | fm_of_term ps vs \<^Const_>\HOL.implies for t1 t2\ = @{code Imp} (fm_of_term ps vs t1, fm_of_term ps vs t2) - | fm_of_term ps vs (\<^term>\HOL.Not\ $ t') = + | fm_of_term ps vs \<^Const_>\HOL.Not for t'\ = @{code Not} (fm_of_term ps vs t') - | fm_of_term ps vs (Const (\<^const_name>\Ex\, _) $ Abs (xn, xT, p)) = + | fm_of_term ps vs \<^Const_>\Ex _ for \Abs (xn, xT, p)\\ = let val (xn', p') = Syntax_Trans.variant_abs (xn, xT, p); (* FIXME !? *) val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs; in @{code E} (fm_of_term ps vs' p) end - | fm_of_term ps vs (Const (\<^const_name>\All\, _) $ Abs (xn, xT, p)) = + | fm_of_term ps vs \<^Const_>\All _ for \Abs (xn, xT, p)\\ = let val (xn', p') = Syntax_Trans.variant_abs (xn, xT, p); (* FIXME !? *) val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs; @@ -2444,44 +2444,44 @@ let val q = @{code integer_of_nat} n in fst (the (find_first (fn (_, m) => q = m) vs)) end - | term_of_num vs (@{code Neg} t') = \<^term>\uminus :: int \ int\ $ term_of_num vs t' - | term_of_num vs (@{code Add} (t1, t2)) = \<^term>\(+) :: int \ int \ int\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Sub} (t1, t2)) = \<^term>\(-) :: int \ int \ int\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Mul} (i, t2)) = \<^term>\(*) :: int \ int \ int\ $ - term_of_num vs (@{code C} i) $ term_of_num vs t2 + | term_of_num vs (@{code Neg} t') = \<^Const>\uminus \<^Type>\int\ for \term_of_num vs t'\\ + | term_of_num vs (@{code Add} (t1, t2)) = + \<^Const>\plus \<^Type>\int\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Sub} (t1, t2)) = + \<^Const>\minus \<^Type>\int\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Mul} (i, t2)) = + \<^Const>\times \<^Type>\int\ for \term_of_num vs (@{code C} i)\ \term_of_num vs t2\\ | term_of_num vs (@{code CN} (n, i, t)) = term_of_num vs (@{code Add} (@{code Mul} (i, @{code Bound} n), t)); -fun term_of_fm ps vs @{code T} = \<^term>\True\ - | term_of_fm ps vs @{code F} = \<^term>\False\ +fun term_of_fm ps vs @{code T} = \<^Const>\True\ + | term_of_fm ps vs @{code F} = \<^Const>\False\ | term_of_fm ps vs (@{code Lt} t) = - \<^term>\(<) :: int \ int \ bool\ $ term_of_num vs t $ \<^term>\0::int\ + \<^Const>\less \<^Type>\int\ for \term_of_num vs t\ \<^term>\0::int\\ | term_of_fm ps vs (@{code Le} t) = - \<^term>\(\) :: int \ int \ bool\ $ term_of_num vs t $ \<^term>\0::int\ + \<^Const>\less_eq \<^Type>\int\ for \term_of_num vs t\ \<^term>\0::int\\ | term_of_fm ps vs (@{code Gt} t) = - \<^term>\(<) :: int \ int \ bool\ $ \<^term>\0::int\ $ term_of_num vs t + \<^Const>\less \<^Type>\int\ for \<^term>\0::int\ \term_of_num vs t\\ | term_of_fm ps vs (@{code Ge} t) = - \<^term>\(\) :: int \ int \ bool\ $ \<^term>\0::int\ $ term_of_num vs t + \<^Const>\less_eq \<^Type>\int\ for \<^term>\0::int\ \term_of_num vs t\\ | term_of_fm ps vs (@{code Eq} t) = - \<^term>\(=) :: int \ int \ bool\ $ term_of_num vs t $ \<^term>\0::int\ + \<^Const>\HOL.eq \<^Type>\int\ for \term_of_num vs t\ \<^term>\0::int\\ | term_of_fm ps vs (@{code NEq} t) = term_of_fm ps vs (@{code Not} (@{code Eq} t)) | term_of_fm ps vs (@{code Dvd} (i, t)) = - \<^term>\(dvd) :: int \ int \ bool\ $ term_of_num vs (@{code C} i) $ term_of_num vs t + \<^Const>\dvd \<^Type>\int\ for \term_of_num vs (@{code C} i)\ \term_of_num vs t\\ | term_of_fm ps vs (@{code NDvd} (i, t)) = term_of_fm ps vs (@{code Not} (@{code Dvd} (i, t))) | term_of_fm ps vs (@{code Not} t') = - HOLogic.Not $ term_of_fm ps vs t' + \<^Const>\HOL.Not for \term_of_fm ps vs t'\\ | term_of_fm ps vs (@{code And} (t1, t2)) = - HOLogic.conj $ term_of_fm ps vs t1 $ term_of_fm ps vs t2 + \<^Const>\HOL.conj for \term_of_fm ps vs t1\ \term_of_fm ps vs t2\\ | term_of_fm ps vs (@{code Or} (t1, t2)) = - HOLogic.disj $ term_of_fm ps vs t1 $ term_of_fm ps vs t2 + \<^Const>\HOL.disj for \term_of_fm ps vs t1\ \term_of_fm ps vs t2\\ | term_of_fm ps vs (@{code Imp} (t1, t2)) = - HOLogic.imp $ term_of_fm ps vs t1 $ term_of_fm ps vs t2 + \<^Const>\HOL.implies for \term_of_fm ps vs t1\ \term_of_fm ps vs t2\\ | term_of_fm ps vs (@{code Iff} (t1, t2)) = - \<^term>\(=) :: bool \ bool \ bool\ $ term_of_fm ps vs t1 $ term_of_fm ps vs t2 + \<^Const>\HOL.eq \<^Type>\bool\ for \term_of_fm ps vs t1\ \term_of_fm ps vs t2\\ | term_of_fm ps vs (@{code Closed} n) = let val q = @{code integer_of_nat} n @@ -2491,12 +2491,12 @@ fun term_bools acc t = let val is_op = - member (=) [\<^term>\HOL.conj\, \<^term>\HOL.disj\, \<^term>\HOL.implies\, - \<^term>\(=) :: bool \ _\, - \<^term>\(=) :: int \ _\, \<^term>\(<) :: int \ _\, - \<^term>\(\) :: int \ _\, \<^term>\HOL.Not\, \<^term>\All :: (int \ _) \ _\, - \<^term>\Ex :: (int \ _) \ _\, \<^term>\True\, \<^term>\False\] - fun is_ty t = not (fastype_of t = HOLogic.boolT) + member (=) [\<^Const>\HOL.conj\, \<^Const>\HOL.disj\, \<^Const>\HOL.implies\, + \<^Const>\HOL.eq \<^Type>\bool\\, + \<^Const>\HOL.eq \<^Type>\int\\, \<^Const>\less \<^Type>\int\\, + \<^Const>\less_eq \<^Type>\int\\, \<^Const>\HOL.Not\, \<^Const>\All \<^Type>\int\\, + \<^Const>\Ex \<^Type>\int\\, \<^Const>\True\, \<^Const>\False\] + fun is_ty t = not (fastype_of t = \<^Type>\bool\) in (case t of (l as f $ a) $ b => diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Dense_Linear_Order.thy --- a/src/HOL/Decision_Procs/Dense_Linear_Order.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Dense_Linear_Order.thy Wed Sep 29 22:54:38 2021 +0200 @@ -719,10 +719,10 @@ val [lt, le] = map (Morphism.term phi) [\<^term>\(\)\, \<^term>\(\)\] fun h x t = case Thm.term_of t of - Const(\<^const_name>\HOL.eq\, _)$y$z => + \<^Const_>\HOL.eq _ for y z\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq else Ferrante_Rackoff_Data.Nox - | \<^term>\Not\$(Const(\<^const_name>\HOL.eq\, _)$y$z) => + | \<^Const_>\Not for \<^Const>\HOL.eq _ for y z\\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq else Ferrante_Rackoff_Data.Nox | b$y$z => if Term.could_unify (b, lt) then @@ -901,27 +901,27 @@ fun dest_frac ct = case Thm.term_of ct of - Const (\<^const_name>\Rings.divide\,_) $ a $ b=> + \<^Const_>\Rings.divide _ for a b\ => Rat.make (snd (HOLogic.dest_number a), snd (HOLogic.dest_number b)) - | Const(\<^const_name>\inverse\, _)$a => Rat.make(1, HOLogic.dest_number a |> snd) + | \<^Const_>\inverse _ for a\ => Rat.make(1, HOLogic.dest_number a |> snd) | t => Rat.of_int (snd (HOLogic.dest_number t)) fun whatis x ct = case Thm.term_of ct of - Const(\<^const_name>\Groups.plus\, _)$(Const(\<^const_name>\Groups.times\,_)$_$y)$_ => + \<^Const_>\plus _ for \<^Const_>\times _ for _ y\ _\ => if y aconv Thm.term_of x then ("c*x+t",[(funpow 2 Thm.dest_arg1) ct, Thm.dest_arg ct]) else ("Nox",[]) -| Const(\<^const_name>\Groups.plus\, _)$y$_ => +| \<^Const_>\plus _ for y _\ => if y aconv Thm.term_of x then ("x+t",[Thm.dest_arg ct]) else ("Nox",[]) -| Const(\<^const_name>\Groups.times\, _)$_$y => +| \<^Const_>\times _ for _ y\ => if y aconv Thm.term_of x then ("c*x",[Thm.dest_arg1 ct]) else ("Nox",[]) | t => if t aconv Thm.term_of x then ("x",[]) else ("Nox",[]); fun xnormalize_conv ctxt [] ct = Thm.reflexive ct -| xnormalize_conv ctxt (vs as (x::_)) ct = + | xnormalize_conv ctxt (vs as (x::_)) ct = case Thm.term_of ct of - Const(\<^const_name>\Orderings.less\,_)$_$Const(\<^const_name>\Groups.zero\,_) => + \<^Const_>\less _ for _ \<^Const_>\zero_class.zero _\\ => (case whatis x (Thm.dest_arg1 ct) of ("c*x+t",[c,t]) => let @@ -964,14 +964,14 @@ | _ => Thm.reflexive ct) -| Const(\<^const_name>\Orderings.less_eq\,_)$_$Const(\<^const_name>\Groups.zero\,_) => +| \<^Const_>\less_eq _ for _ \<^Const_>\zero_class.zero _\\ => (case whatis x (Thm.dest_arg1 ct) of ("c*x+t",[c,t]) => let val T = Thm.typ_of_cterm x val cT = Thm.ctyp_of_cterm x val cr = dest_frac c - val clt = Thm.cterm_of ctxt (Const (\<^const_name>\ord_class.less\, T --> T --> \<^typ>\bool\)) + val clt = Thm.cterm_of ctxt \<^Const>\less T\ val cz = Thm.dest_arg ct val neg = cr < @0 val cthp = Simplifier.rewrite ctxt @@ -996,7 +996,7 @@ val T = Thm.typ_of_cterm x val cT = Thm.ctyp_of_cterm x val cr = dest_frac c - val clt = Thm.cterm_of ctxt (Const (\<^const_name>\ord_class.less\, T --> T --> \<^typ>\bool\)) + val clt = Thm.cterm_of ctxt \<^Const>\less T\ val cz = Thm.dest_arg ct val neg = cr < @0 val cthp = Simplifier.rewrite ctxt @@ -1010,7 +1010,7 @@ in rth end | _ => Thm.reflexive ct) -| Const(\<^const_name>\HOL.eq\,_)$_$Const(\<^const_name>\Groups.zero\,_) => +| \<^Const_>\HOL.eq _ for _ \<^Const_>\zero_class.zero _\\ => (case whatis x (Thm.dest_arg1 ct) of ("c*x+t",[c,t]) => let @@ -1056,7 +1056,7 @@ val ss = simpset_of \<^context> in fun field_isolate_conv phi ctxt vs ct = case Thm.term_of ct of - Const(\<^const_name>\Orderings.less\,_)$a$b => + \<^Const_>\less _ for a b\ => let val (ca,cb) = Thm.dest_binop ct val T = Thm.ctyp_of_cterm ca val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] less_iff_diff_less_0 @@ -1065,7 +1065,7 @@ (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth)) in rth end -| Const(\<^const_name>\Orderings.less_eq\,_)$a$b => +| \<^Const_>\less_eq _ for a b\ => let val (ca,cb) = Thm.dest_binop ct val T = Thm.ctyp_of_cterm ca val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] le_iff_diff_le_0 @@ -1075,7 +1075,7 @@ val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth)) in rth end -| Const(\<^const_name>\HOL.eq\,_)$a$b => +| \<^Const_>\HOL.eq _ for a b\ => let val (ca,cb) = Thm.dest_binop ct val T = Thm.ctyp_of_cterm ca val th = Thm.instantiate' [SOME T] [SOME ca, SOME cb] eq_iff_diff_eq_0 @@ -1084,7 +1084,7 @@ (Semiring_Normalizer.semiring_normalize_ord_conv (put_simpset ss ctxt) (earlier_ord vs)))) th val rth = Thm.transitive nth (xnormalize_conv ctxt vs (Thm.rhs_of nth)) in rth end -| \<^term>\Not\ $(Const(\<^const_name>\HOL.eq\,_)$a$b) => Conv.arg_conv (field_isolate_conv phi ctxt vs) ct +| \<^Const_>\Not for \<^Const_>\HOL.eq _ for a b\\ => Conv.arg_conv (field_isolate_conv phi ctxt vs) ct | _ => Thm.reflexive ct end; @@ -1092,17 +1092,17 @@ let fun h x t = case Thm.term_of t of - Const(\<^const_name>\HOL.eq\, _)$y$z => + \<^Const_>\HOL.eq _ for y z\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Eq else Ferrante_Rackoff_Data.Nox - | \<^term>\Not\$(Const(\<^const_name>\HOL.eq\, _)$y$z) => + | \<^Const_>\Not for \<^Const_>\HOL.eq _ for y z\\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.NEq else Ferrante_Rackoff_Data.Nox - | Const(\<^const_name>\Orderings.less\,_)$y$z => + | \<^Const_>\less _ for y z\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Lt else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Gt else Ferrante_Rackoff_Data.Nox - | Const (\<^const_name>\Orderings.less_eq\,_)$y$z => + | \<^Const_>\less_eq _ for y z\ => if Thm.term_of x aconv y then Ferrante_Rackoff_Data.Le else if Thm.term_of x aconv z then Ferrante_Rackoff_Data.Ge else Ferrante_Rackoff_Data.Nox diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Ferrack.thy --- a/src/HOL/Decision_Procs/Ferrack.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Ferrack.thy Wed Sep 29 22:54:38 2021 +0200 @@ -2458,15 +2458,15 @@ fun num_of_term vs (Free vT) = mk_Bound (find_index (fn vT' => vT = vT') vs) | num_of_term vs \<^term>\real_of_int (0::int)\ = mk_C 0 | num_of_term vs \<^term>\real_of_int (1::int)\ = mk_C 1 - | num_of_term vs \<^term>\0::real\ = mk_C 0 - | num_of_term vs \<^term>\1::real\ = mk_C 1 + | num_of_term vs \<^Const_>\zero_class.zero \<^Type>\real\\ = mk_C 0 + | num_of_term vs \<^Const_>\one_class.one \<^Type>\real\\ = mk_C 1 | num_of_term vs (Bound i) = mk_Bound i - | num_of_term vs (\<^term>\uminus :: real \ real\ $ t') = @{code Neg} (num_of_term vs t') - | num_of_term vs (\<^term>\(+) :: real \ real \ real\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\uminus \<^Type>\real\ for t'\ = @{code Neg} (num_of_term vs t') + | num_of_term vs \<^Const_>\plus \<^Type>\real\ for t1 t2\ = @{code Add} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(-) :: real \ real \ real\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\minus \<^Type>\real\ for t1 t2\ = @{code Sub} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(*) :: real \ real \ real\ $ t1 $ t2) = (case num_of_term vs t1 + | num_of_term vs \<^Const_>\times \<^Type>\real\ for t1 t2\ = (case num_of_term vs t1 of @{code C} i => @{code Mul} (i, num_of_term vs t2) | _ => error "num_of_term: unsupported multiplication") | num_of_term vs (\<^term>\real_of_int :: int \ real\ $ t') = @@ -2476,57 +2476,49 @@ (mk_C (snd (HOLogic.dest_number t')) handle TERM _ => error ("num_of_term: unknown term")); -fun fm_of_term vs \<^term>\True\ = @{code T} - | fm_of_term vs \<^term>\False\ = @{code F} - | fm_of_term vs (\<^term>\(<) :: real \ real \ bool\ $ t1 $ t2) = +fun fm_of_term vs \<^Const_>\True\ = @{code T} + | fm_of_term vs \<^Const_>\False\ = @{code F} + | fm_of_term vs \<^Const_>\less \<^Type>\real\ for t1 t2\ = @{code Lt} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(\) :: real \ real \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\less_eq \<^Type>\real\ for t1 t2\ = @{code Le} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(=) :: real \ real \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.eq \<^Type>\real\ for t1 t2\ = @{code Eq} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(\) :: bool \ bool \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.eq \<^Type>\bool\ for t1 t2\ = @{code Iff} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.conj\ $ t1 $ t2) = @{code And} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.disj\ $ t1 $ t2) = @{code Or} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.implies\ $ t1 $ t2) = @{code Imp} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.Not\ $ t') = @{code Not} (fm_of_term vs t') - | fm_of_term vs (Const (\<^const_name>\Ex\, _) $ Abs (xn, xT, p)) = - @{code E} (fm_of_term (("", dummyT) :: vs) p) - | fm_of_term vs (Const (\<^const_name>\All\, _) $ Abs (xn, xT, p)) = - @{code A} (fm_of_term (("", dummyT) :: vs) p) + | fm_of_term vs \<^Const_>\HOL.conj for t1 t2\ = @{code And} (fm_of_term vs t1, fm_of_term vs t2) + | fm_of_term vs \<^Const_>\HOL.disj for t1 t2\ = @{code Or} (fm_of_term vs t1, fm_of_term vs t2) + | fm_of_term vs \<^Const_>\HOL.implies for t1 t2\ = @{code Imp} (fm_of_term vs t1, fm_of_term vs t2) + | fm_of_term vs \<^Const_>\HOL.Not for t'\ = @{code Not} (fm_of_term vs t') + | fm_of_term vs \<^Const_>\Ex _ for \Abs (xn, xT, p)\\ = @{code E} (fm_of_term (("", dummyT) :: vs) p) + | fm_of_term vs \<^Const_>\All _ for \Abs (xn, xT, p)\\ = @{code A} (fm_of_term (("", dummyT) :: vs) p) | fm_of_term vs t = error ("fm_of_term : unknown term " ^ Syntax.string_of_term \<^context> t); fun term_of_num vs (@{code C} i) = \<^term>\real_of_int :: int \ real\ $ HOLogic.mk_number HOLogic.intT (@{code integer_of_int} i) | term_of_num vs (@{code Bound} n) = Free (nth vs (@{code integer_of_nat} n)) - | term_of_num vs (@{code Neg} t') = \<^term>\uminus :: real \ real\ $ term_of_num vs t' - | term_of_num vs (@{code Add} (t1, t2)) = \<^term>\(+) :: real \ real \ real\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Sub} (t1, t2)) = \<^term>\(-) :: real \ real \ real\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Mul} (i, t2)) = \<^term>\(*) :: real \ real \ real\ $ - term_of_num vs (@{code C} i) $ term_of_num vs t2 + | term_of_num vs (@{code Neg} t') = \<^Const>\uminus \<^Type>\real\ for \term_of_num vs t'\\ + | term_of_num vs (@{code Add} (t1, t2)) = + \<^Const>\plus \<^Type>\real\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Sub} (t1, t2)) = + \<^Const>\minus \<^Type>\real\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Mul} (i, t2)) = + \<^Const>\times \<^Type>\real\ for \term_of_num vs (@{code C} i)\ \term_of_num vs t2\\ | term_of_num vs (@{code CN} (n, i, t)) = term_of_num vs (@{code Add} (@{code Mul} (i, @{code Bound} n), t)); -fun term_of_fm vs @{code T} = \<^term>\True\ - | term_of_fm vs @{code F} = \<^term>\False\ - | term_of_fm vs (@{code Lt} t) = \<^term>\(<) :: real \ real \ bool\ $ - term_of_num vs t $ \<^term>\0::real\ - | term_of_fm vs (@{code Le} t) = \<^term>\(\) :: real \ real \ bool\ $ - term_of_num vs t $ \<^term>\0::real\ - | term_of_fm vs (@{code Gt} t) = \<^term>\(<) :: real \ real \ bool\ $ - \<^term>\0::real\ $ term_of_num vs t - | term_of_fm vs (@{code Ge} t) = \<^term>\(\) :: real \ real \ bool\ $ - \<^term>\0::real\ $ term_of_num vs t - | term_of_fm vs (@{code Eq} t) = \<^term>\(=) :: real \ real \ bool\ $ - term_of_num vs t $ \<^term>\0::real\ +fun term_of_fm vs @{code T} = \<^Const>\True\ + | term_of_fm vs @{code F} = \<^Const>\False\ + | term_of_fm vs (@{code Lt} t) = \<^Const>\less \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ + | term_of_fm vs (@{code Le} t) = \<^Const>\less_eq \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ + | term_of_fm vs (@{code Gt} t) = \<^Const>\less \<^Type>\real\ for \<^term>\0::real\ \term_of_num vs t\\ + | term_of_fm vs (@{code Ge} t) = \<^Const>\less_eq \<^Type>\real\ for \<^term>\0::real\ \term_of_num vs t\\ + | term_of_fm vs (@{code Eq} t) = \<^Const>\HOL.eq \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ | term_of_fm vs (@{code NEq} t) = term_of_fm vs (@{code Not} (@{code Eq} t)) - | term_of_fm vs (@{code Not} t') = HOLogic.Not $ term_of_fm vs t' - | term_of_fm vs (@{code And} (t1, t2)) = HOLogic.conj $ term_of_fm vs t1 $ term_of_fm vs t2 - | term_of_fm vs (@{code Or} (t1, t2)) = HOLogic.disj $ term_of_fm vs t1 $ term_of_fm vs t2 - | term_of_fm vs (@{code Imp} (t1, t2)) = HOLogic.imp $ term_of_fm vs t1 $ term_of_fm vs t2 - | term_of_fm vs (@{code Iff} (t1, t2)) = \<^term>\(\) :: bool \ bool \ bool\ $ - term_of_fm vs t1 $ term_of_fm vs t2; + | term_of_fm vs (@{code Not} t') = \<^Const>\HOL.Not for \term_of_fm vs t'\\ + | term_of_fm vs (@{code And} (t1, t2)) = \<^Const>\HOL.conj for \term_of_fm vs t1\ \term_of_fm vs t2\\ + | term_of_fm vs (@{code Or} (t1, t2)) = \<^Const>\HOL.disj for \term_of_fm vs t1\ \term_of_fm vs t2\\ + | term_of_fm vs (@{code Imp} (t1, t2)) = \<^Const>\HOL.implies for \term_of_fm vs t1\ \term_of_fm vs t2\\ + | term_of_fm vs (@{code Iff} (t1, t2)) = \<^Const>\HOL.eq \<^Type>\bool\ for \term_of_fm vs t1\ \term_of_fm vs t2\\ in fn (ctxt, t) => let diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/MIR.thy --- a/src/HOL/Decision_Procs/MIR.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/MIR.thy Wed Sep 29 22:54:38 2021 +0200 @@ -5581,92 +5581,92 @@ | num_of_term vs \<^term>\1::real\ = mk_C 1 | num_of_term vs \<^term>\- 1::real\ = mk_C (~ 1) | num_of_term vs (Bound i) = mk_Bound i - | num_of_term vs (\<^term>\uminus :: real \ real\ $ t') = @{code Neg} (num_of_term vs t') - | num_of_term vs (\<^term>\(+) :: real \ real \ real\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\uminus \<^Type>\real\ for t'\ = @{code Neg} (num_of_term vs t') + | num_of_term vs \<^Const_>\plus \<^Type>\real\ for t1 t2\ = @{code Add} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(-) :: real \ real \ real\ $ t1 $ t2) = + | num_of_term vs \<^Const_>\minus \<^Type>\real\ for t1 t2\ = @{code Sub} (num_of_term vs t1, num_of_term vs t2) - | num_of_term vs (\<^term>\(*) :: real \ real \ real\ $ t1 $ t2) = - (case (num_of_term vs t1) - of @{code C} i => @{code Mul} (i, num_of_term vs t2) - | _ => error "num_of_term: unsupported Multiplication") - | num_of_term vs (\<^term>\of_int :: int \ real\ $ (\<^term>\numeral :: _ \ int\ $ t')) = + | num_of_term vs \<^Const_>\times \<^Type>\real\ for t1 t2\ = + (case num_of_term vs t1 of + @{code C} i => @{code Mul} (i, num_of_term vs t2) + | _ => error "num_of_term: unsupported Multiplication") + | num_of_term vs \<^Const_>\of_int \<^Type>\real\ for \<^Const_>\numeral \<^Type>\int\ for t'\\ = mk_C (HOLogic.dest_numeral t') - | num_of_term vs (\<^term>\of_int :: int \ real\ $ (\<^term>\- numeral :: _ \ int\ $ t')) = + | num_of_term vs (\<^Const_>\of_int \<^Type>\real\\ $ (\<^term>\- numeral :: _ \ int\ $ t')) = (* FIXME !? *) mk_C (~ (HOLogic.dest_numeral t')) - | num_of_term vs (\<^term>\of_int :: int \ real\ $ (\<^term>\floor :: real \ int\ $ t')) = + | num_of_term vs \<^Const_>\of_int \<^Type>\real\ for \<^Const_>\floor \<^Type>\real\ for t'\\ = @{code Floor} (num_of_term vs t') - | num_of_term vs (\<^term>\of_int :: int \ real\ $ (\<^term>\ceiling :: real \ int\ $ t')) = + | num_of_term vs \<^Const_>\of_int \<^Type>\real\ for \<^Const_>\ceiling \<^Type>\real\ for t'\\ = @{code Neg} (@{code Floor} (@{code Neg} (num_of_term vs t'))) - | num_of_term vs (\<^term>\numeral :: _ \ real\ $ t') = + | num_of_term vs \<^Const_>\numeral \<^Type>\real\ for t'\ = mk_C (HOLogic.dest_numeral t') - | num_of_term vs (\<^term>\- numeral :: _ \ real\ $ t') = + | num_of_term vs (\<^term>\- numeral :: _ \ real\ $ t') = (* FIXME !? *) mk_C (~ (HOLogic.dest_numeral t')) | num_of_term vs t = error ("num_of_term: unknown term " ^ Syntax.string_of_term \<^context> t); -fun fm_of_term vs \<^term>\True\ = @{code T} - | fm_of_term vs \<^term>\False\ = @{code F} - | fm_of_term vs (\<^term>\(<) :: real \ real \ bool\ $ t1 $ t2) = +fun fm_of_term vs \<^Const_>\True\ = @{code T} + | fm_of_term vs \<^Const_>\False\ = @{code F} + | fm_of_term vs \<^Const_>\less \<^Type>\real\ for t1 t2\ = @{code Lt} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(\) :: real \ real \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\less_eq \<^Type>\real\ for t1 t2\ = @{code Le} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(=) :: real \ real \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.eq \<^Type>\real\ for t1 t2\ = @{code Eq} (@{code Sub} (num_of_term vs t1, num_of_term vs t2)) - | fm_of_term vs (\<^term>\(rdvd)\ $ (\<^term>\of_int :: int \ real\ $ (\<^term>\numeral :: _ \ int\ $ t1)) $ t2) = + | fm_of_term vs \<^Const_>\rdvd for \<^Const_>\of_int \<^Type>\real\ for \<^Const_>\numeral \<^Type>\int\ for t1\\ t2\ = mk_Dvd (HOLogic.dest_numeral t1, num_of_term vs t2) - | fm_of_term vs (\<^term>\(rdvd)\ $ (\<^term>\of_int :: int \ real\ $ (\<^term>\- numeral :: _ \ int\ $ t1)) $ t2) = + | fm_of_term vs \<^Const_>\rdvd for \<^Const_>\of_int \<^Type>\real\ for \(\<^term>\- numeral :: _ \ int\ $ t1)\\ t2\ = (* FIXME !? *) mk_Dvd (~ (HOLogic.dest_numeral t1), num_of_term vs t2) - | fm_of_term vs (\<^term>\(=) :: bool \ bool \ bool\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.eq \<^Type>\bool\ for t1 t2\ = @{code Iff} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.conj\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.conj for t1 t2\ = @{code And} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.disj\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.disj for t1 t2\ = @{code Or} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.implies\ $ t1 $ t2) = + | fm_of_term vs \<^Const_>\HOL.implies for t1 t2\ = @{code Imp} (fm_of_term vs t1, fm_of_term vs t2) - | fm_of_term vs (\<^term>\HOL.Not\ $ t') = + | fm_of_term vs \<^Const_>\HOL.Not for t'\ = @{code Not} (fm_of_term vs t') - | fm_of_term vs (Const (\<^const_name>\Ex\, _) $ Abs (xn, xT, p)) = + | fm_of_term vs \<^Const_>\Ex _ for \Abs (xn, xT, p)\\ = @{code E} (fm_of_term (map (fn (v, n) => (v, n + 1)) vs) p) - | fm_of_term vs (Const (\<^const_name>\All\, _) $ Abs (xn, xT, p)) = + | fm_of_term vs \<^Const_>\All _ for \Abs (xn, xT, p)\\ = @{code A} (fm_of_term (map (fn (v, n) => (v, n + 1)) vs) p) | fm_of_term vs t = error ("fm_of_term : unknown term " ^ Syntax.string_of_term \<^context> t); -fun term_of_num vs (@{code C} i) = \<^term>\of_int :: int \ real\ $ - HOLogic.mk_number HOLogic.intT (@{code integer_of_int} i) +fun term_of_num vs (@{code C} i) = + \<^Const>\of_int \<^Type>\real\ for \HOLogic.mk_number HOLogic.intT (@{code integer_of_int} i)\\ | term_of_num vs (@{code Bound} n) = let val m = @{code integer_of_nat} n; in fst (the (find_first (fn (_, q) => m = q) vs)) end | term_of_num vs (@{code Neg} (@{code Floor} (@{code Neg} t'))) = - \<^term>\of_int :: int \ real\ $ (\<^term>\ceiling :: real \ int\ $ term_of_num vs t') - | term_of_num vs (@{code Neg} t') = \<^term>\uminus :: real \ real\ $ term_of_num vs t' - | term_of_num vs (@{code Add} (t1, t2)) = \<^term>\(+) :: real \ real \ real\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Sub} (t1, t2)) = \<^term>\(-) :: real \ real \ real\ $ - term_of_num vs t1 $ term_of_num vs t2 - | term_of_num vs (@{code Mul} (i, t2)) = \<^term>\(*) :: real \ real \ real\ $ - term_of_num vs (@{code C} i) $ term_of_num vs t2 - | term_of_num vs (@{code Floor} t) = \<^term>\of_int :: int \ real\ $ (\<^term>\floor :: real \ int\ $ term_of_num vs t) + \<^Const>\of_int \<^Type>\real\ for \<^Const>\ceiling \<^Type>\real\ for \term_of_num vs t'\\\ + | term_of_num vs (@{code Neg} t') = \<^Const>\uminus \<^Type>\real\ for \term_of_num vs t'\\ + | term_of_num vs (@{code Add} (t1, t2)) = + \<^Const>\plus \<^Type>\real\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Sub} (t1, t2)) = + \<^Const>\minus \<^Type>\real\ for \term_of_num vs t1\ \term_of_num vs t2\\ + | term_of_num vs (@{code Mul} (i, t2)) = + \<^Const>\times \<^Type>\real\ for \term_of_num vs (@{code C} i)\ \term_of_num vs t2\\ + | term_of_num vs (@{code Floor} t) = \<^Const>\of_int \<^Type>\real\ for \<^Const>\floor \<^Type>\real\ for \term_of_num vs t\\\ | term_of_num vs (@{code CN} (n, i, t)) = term_of_num vs (@{code Add} (@{code Mul} (i, @{code Bound} n), t)) | term_of_num vs (@{code CF} (c, t, s)) = term_of_num vs (@{code Add} (@{code Mul} (c, @{code Floor} t), s)); -fun term_of_fm vs @{code T} = \<^term>\True\ - | term_of_fm vs @{code F} = \<^term>\False\ +fun term_of_fm vs @{code T} = \<^Const>\True\ + | term_of_fm vs @{code F} = \<^Const>\False\ | term_of_fm vs (@{code Lt} t) = - \<^term>\(<) :: real \ real \ bool\ $ term_of_num vs t $ \<^term>\0::real\ + \<^Const>\less \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ | term_of_fm vs (@{code Le} t) = - \<^term>\(\) :: real \ real \ bool\ $ term_of_num vs t $ \<^term>\0::real\ + \<^Const>\less_eq \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ | term_of_fm vs (@{code Gt} t) = - \<^term>\(<) :: real \ real \ bool\ $ \<^term>\0::real\ $ term_of_num vs t + \<^Const>\less \<^Type>\real\ for \<^term>\0::real\ \term_of_num vs t\\ | term_of_fm vs (@{code Ge} t) = - \<^term>\(\) :: real \ real \ bool\ $ \<^term>\0::real\ $ term_of_num vs t + \<^Const>\less_eq \<^Type>\real\ for \<^term>\0::real\ \term_of_num vs t\\ | term_of_fm vs (@{code Eq} t) = - \<^term>\(=) :: real \ real \ bool\ $ term_of_num vs t $ \<^term>\0::real\ + \<^Const>\HOL.eq \<^Type>\real\ for \term_of_num vs t\ \<^term>\0::real\\ | term_of_fm vs (@{code NEq} t) = term_of_fm vs (@{code Not} (@{code Eq} t)) | term_of_fm vs (@{code Dvd} (i, t)) = - \<^term>\(rdvd)\ $ term_of_num vs (@{code C} i) $ term_of_num vs t + \<^Const>\rdvd for \term_of_num vs (@{code C} i)\ \term_of_num vs t\\ | term_of_fm vs (@{code NDvd} (i, t)) = term_of_fm vs (@{code Not} (@{code Dvd} (i, t))) | term_of_fm vs (@{code Not} t') = @@ -5678,7 +5678,7 @@ | term_of_fm vs (@{code Imp} (t1, t2)) = HOLogic.imp $ term_of_fm vs t1 $ term_of_fm vs t2 | term_of_fm vs (@{code Iff} (t1, t2)) = - \<^term>\(=) :: bool \ bool \ bool\ $ term_of_fm vs t1 $ term_of_fm vs t2; + \<^Const>\HOL.eq \<^Type>\bool\ for \term_of_fm vs t1\ \term_of_fm vs t2\\; in fn (ctxt, t) => diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy --- a/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Parametric_Ferrante_Rackoff.thy Wed Sep 29 22:54:38 2021 +0200 @@ -3922,9 +3922,6 @@ \ let -fun binopT T = T --> T --> T; -fun relT T = T --> T --> \<^typ>\bool\; - val mk_C = @{code C} o apply2 @{code int_of_integer}; val mk_poly_Bound = @{code poly.Bound} o @{code nat_of_integer}; val mk_Bound = @{code Bound} o @{code nat_of_integer}; @@ -3934,7 +3931,7 @@ fun try_dest_num t = SOME ((snd o HOLogic.dest_number) t) handle TERM _ => NONE; -fun dest_nat (t as Const (\<^const_name>\Suc\, _)) = HOLogic.dest_nat t +fun dest_nat (t as \<^Const_>\Suc\) = HOLogic.dest_nat t (* FIXME !? *) | dest_nat t = dest_num t; fun the_index ts t = @@ -3942,58 +3939,46 @@ val k = find_index (fn t' => t aconv t') ts; in if k < 0 then raise General.Subscript else k end; -fun num_of_term ps (Const (\<^const_name>\Groups.uminus\, _) $ t) = - @{code poly.Neg} (num_of_term ps t) - | num_of_term ps (Const (\<^const_name>\Groups.plus\, _) $ a $ b) = - @{code poly.Add} (num_of_term ps a, num_of_term ps b) - | num_of_term ps (Const (\<^const_name>\Groups.minus\, _) $ a $ b) = - @{code poly.Sub} (num_of_term ps a, num_of_term ps b) - | num_of_term ps (Const (\<^const_name>\Groups.times\, _) $ a $ b) = - @{code poly.Mul} (num_of_term ps a, num_of_term ps b) - | num_of_term ps (Const (\<^const_name>\Power.power\, _) $ a $ n) = +fun num_of_term ps \<^Const_>\uminus _ for t\ = @{code poly.Neg} (num_of_term ps t) + | num_of_term ps \<^Const_>\plus _ for a b\ = @{code poly.Add} (num_of_term ps a, num_of_term ps b) + | num_of_term ps \<^Const_>\minus _ for a b\ = @{code poly.Sub} (num_of_term ps a, num_of_term ps b) + | num_of_term ps \<^Const_>\times _ for a b\ = @{code poly.Mul} (num_of_term ps a, num_of_term ps b) + | num_of_term ps \<^Const_>\power _ for a n\ = @{code poly.Pw} (num_of_term ps a, @{code nat_of_integer} (dest_nat n)) - | num_of_term ps (Const (\<^const_name>\Rings.divide\, _) $ a $ b) = - mk_C (dest_num a, dest_num b) + | num_of_term ps \<^Const_>\divide _ for a b\ = mk_C (dest_num a, dest_num b) | num_of_term ps t = (case try_dest_num t of SOME k => mk_C (k, 1) | NONE => mk_poly_Bound (the_index ps t)); -fun tm_of_term fs ps (Const(\<^const_name>\Groups.uminus\, _) $ t) = - @{code Neg} (tm_of_term fs ps t) - | tm_of_term fs ps (Const(\<^const_name>\Groups.plus\, _) $ a $ b) = - @{code Add} (tm_of_term fs ps a, tm_of_term fs ps b) - | tm_of_term fs ps (Const(\<^const_name>\Groups.minus\, _) $ a $ b) = - @{code Sub} (tm_of_term fs ps a, tm_of_term fs ps b) - | tm_of_term fs ps (Const(\<^const_name>\Groups.times\, _) $ a $ b) = - @{code Mul} (num_of_term ps a, tm_of_term fs ps b) +fun tm_of_term fs ps \<^Const_>\uminus _ for t\ = @{code Neg} (tm_of_term fs ps t) + | tm_of_term fs ps \<^Const_>\plus _ for a b\ = @{code Add} (tm_of_term fs ps a, tm_of_term fs ps b) + | tm_of_term fs ps \<^Const_>\minus _ for a b\ = @{code Sub} (tm_of_term fs ps a, tm_of_term fs ps b) + | tm_of_term fs ps \<^Const_>\times _ for a b\ = @{code Mul} (num_of_term ps a, tm_of_term fs ps b) | tm_of_term fs ps t = (@{code CP} (num_of_term ps t) handle TERM _ => mk_Bound (the_index fs t) | General.Subscript => mk_Bound (the_index fs t)); -fun fm_of_term fs ps \<^term>\True\ = @{code T} - | fm_of_term fs ps \<^term>\False\ = @{code F} - | fm_of_term fs ps (Const (\<^const_name>\HOL.Not\, _) $ p) = - @{code Not} (fm_of_term fs ps p) - | fm_of_term fs ps (Const (\<^const_name>\HOL.conj\, _) $ p $ q) = - @{code And} (fm_of_term fs ps p, fm_of_term fs ps q) - | fm_of_term fs ps (Const (\<^const_name>\HOL.disj\, _) $ p $ q) = - @{code Or} (fm_of_term fs ps p, fm_of_term fs ps q) - | fm_of_term fs ps (Const (\<^const_name>\HOL.implies\, _) $ p $ q) = +fun fm_of_term fs ps \<^Const_>\True\ = @{code T} + | fm_of_term fs ps \<^Const_>\False\ = @{code F} + | fm_of_term fs ps \<^Const_>\HOL.Not for p\ = @{code Not} (fm_of_term fs ps p) + | fm_of_term fs ps \<^Const_>\HOL.conj for p q\ = @{code And} (fm_of_term fs ps p, fm_of_term fs ps q) + | fm_of_term fs ps \<^Const_>\HOL.disj for p q\ = @{code Or} (fm_of_term fs ps p, fm_of_term fs ps q) + | fm_of_term fs ps \<^Const_>\HOL.implies for p q\ = @{code Imp} (fm_of_term fs ps p, fm_of_term fs ps q) - | fm_of_term fs ps (\<^term>\HOL.iff\ $ p $ q) = + | fm_of_term fs ps \<^Const_>\HOL.eq \<^Type>\bool\ for p q\ = @{code Iff} (fm_of_term fs ps p, fm_of_term fs ps q) - | fm_of_term fs ps (Const (\<^const_name>\HOL.eq\, T) $ p $ q) = + | fm_of_term fs ps \<^Const_>\HOL.eq _ for p q\ = @{code Eq} (@{code Sub} (tm_of_term fs ps p, tm_of_term fs ps q)) - | fm_of_term fs ps (Const (\<^const_name>\Orderings.less\, _) $ p $ q) = + | fm_of_term fs ps \<^Const_>\less _ for p q\ = @{code Lt} (@{code Sub} (tm_of_term fs ps p, tm_of_term fs ps q)) - | fm_of_term fs ps (Const (\<^const_name>\Orderings.less_eq\, _) $ p $ q) = + | fm_of_term fs ps \<^Const_>\less_eq _ for p q\ = @{code Le} (@{code Sub} (tm_of_term fs ps p, tm_of_term fs ps q)) - | fm_of_term fs ps (Const (\<^const_name>\Ex\, _) $ Abs (abs as (_, xT, _))) = + | fm_of_term fs ps (\<^Const_>\Ex _\ $ Abs (abs as (_, xT, _))) = let val (xn', p') = Syntax_Trans.variant_abs abs; (* FIXME !? *) in @{code E} (fm_of_term (Free (xn', xT) :: fs) ps p') end - | fm_of_term fs ps (Const (\<^const_name>\All\,_) $ Abs (abs as (_, xT, _))) = + | fm_of_term fs ps (\<^Const_>\All _\ $ Abs (abs as (_, xT, _))) = let val (xn', p') = Syntax_Trans.variant_abs abs; (* FIXME !? *) in @{code A} (fm_of_term (Free (xn', xT) :: fs) ps p') end @@ -4003,64 +3988,57 @@ let val (c, d) = apply2 (@{code integer_of_int}) (a, b) in - (if d = 1 then HOLogic.mk_number T c - else if d = 0 then Const (\<^const_name>\Groups.zero\, T) - else - Const (\<^const_name>\Rings.divide\, binopT T) $ - HOLogic.mk_number T c $ HOLogic.mk_number T d) + if d = 1 then HOLogic.mk_number T c + else if d = 0 then \<^Const>\zero_class.zero T\ + else \<^Const>\divide T for \HOLogic.mk_number T c\ \HOLogic.mk_number T d\\ end | term_of_num T ps (@{code poly.Bound} i) = nth ps (@{code integer_of_nat} i) | term_of_num T ps (@{code poly.Add} (a, b)) = - Const (\<^const_name>\Groups.plus\, binopT T) $ term_of_num T ps a $ term_of_num T ps b + \<^Const>\plus T for \term_of_num T ps a\ \term_of_num T ps b\\ | term_of_num T ps (@{code poly.Mul} (a, b)) = - Const (\<^const_name>\Groups.times\, binopT T) $ term_of_num T ps a $ term_of_num T ps b + \<^Const>\times T for \term_of_num T ps a\ \term_of_num T ps b\\ | term_of_num T ps (@{code poly.Sub} (a, b)) = - Const (\<^const_name>\Groups.minus\, binopT T) $ term_of_num T ps a $ term_of_num T ps b + \<^Const>\minus T for \term_of_num T ps a\ \term_of_num T ps b\\ | term_of_num T ps (@{code poly.Neg} a) = - Const (\<^const_name>\Groups.uminus\, T --> T) $ term_of_num T ps a + \<^Const>\uminus T for \term_of_num T ps a\\ | term_of_num T ps (@{code poly.Pw} (a, n)) = - Const (\<^const_name>\Power.power\, T --> \<^typ>\nat\ --> T) $ - term_of_num T ps a $ HOLogic.mk_number HOLogic.natT (@{code integer_of_nat} n) + \<^Const>\power T for \term_of_num T ps a\ \HOLogic.mk_number \<^Type>\nat\ (@{code integer_of_nat} n)\\ | term_of_num T ps (@{code poly.CN} (c, n, p)) = term_of_num T ps (@{code poly.Add} (c, @{code poly.Mul} (@{code poly.Bound} n, p))); fun term_of_tm T fs ps (@{code CP} p) = term_of_num T ps p | term_of_tm T fs ps (@{code Bound} i) = nth fs (@{code integer_of_nat} i) | term_of_tm T fs ps (@{code Add} (a, b)) = - Const (\<^const_name>\Groups.plus\, binopT T) $ term_of_tm T fs ps a $ term_of_tm T fs ps b + \<^Const>\plus T for \term_of_tm T fs ps a\ \term_of_tm T fs ps b\\ | term_of_tm T fs ps (@{code Mul} (a, b)) = - Const (\<^const_name>\Groups.times\, binopT T) $ term_of_num T ps a $ term_of_tm T fs ps b + \<^Const>\times T for \term_of_num T ps a\ \term_of_tm T fs ps b\\ | term_of_tm T fs ps (@{code Sub} (a, b)) = - Const (\<^const_name>\Groups.minus\, binopT T) $ term_of_tm T fs ps a $ term_of_tm T fs ps b + \<^Const>\minus T for \term_of_tm T fs ps a\ \term_of_tm T fs ps b\\ | term_of_tm T fs ps (@{code Neg} a) = - Const (\<^const_name>\Groups.uminus\, T --> T) $ term_of_tm T fs ps a + \<^Const>\uminus T for \term_of_tm T fs ps a\\ | term_of_tm T fs ps (@{code CNP} (n, c, p)) = term_of_tm T fs ps (@{code Add} (@{code Mul} (c, @{code Bound} n), p)); -fun term_of_fm T fs ps @{code T} = \<^term>\True\ - | term_of_fm T fs ps @{code F} = \<^term>\False\ - | term_of_fm T fs ps (@{code Not} p) = \<^term>\HOL.Not\ $ term_of_fm T fs ps p +fun term_of_fm T fs ps @{code T} = \<^Const>\True\ + | term_of_fm T fs ps @{code F} = \<^Const>\False\ + | term_of_fm T fs ps (@{code Not} p) = \<^Const>\HOL.Not for \term_of_fm T fs ps p\\ | term_of_fm T fs ps (@{code And} (p, q)) = - \<^term>\HOL.conj\ $ term_of_fm T fs ps p $ term_of_fm T fs ps q + \<^Const>\HOL.conj for \term_of_fm T fs ps p\ \term_of_fm T fs ps q\\ | term_of_fm T fs ps (@{code Or} (p, q)) = - \<^term>\HOL.disj\ $ term_of_fm T fs ps p $ term_of_fm T fs ps q + \<^Const>\HOL.disj for \term_of_fm T fs ps p\ \term_of_fm T fs ps q\\ | term_of_fm T fs ps (@{code Imp} (p, q)) = - \<^term>\HOL.implies\ $ term_of_fm T fs ps p $ term_of_fm T fs ps q + \<^Const>\HOL.implies for \term_of_fm T fs ps p\ \term_of_fm T fs ps q\\ | term_of_fm T fs ps (@{code Iff} (p, q)) = - \<^term>\HOL.iff\ $ term_of_fm T fs ps p $ term_of_fm T fs ps q + \<^Const>\HOL.eq \<^Type>\bool\ for \term_of_fm T fs ps p\ \term_of_fm T fs ps q\\ | term_of_fm T fs ps (@{code Lt} p) = - Const (\<^const_name>\Orderings.less\, relT T) $ - term_of_tm T fs ps p $ Const (\<^const_name>\Groups.zero\, T) + \<^Const>\less T for \term_of_tm T fs ps p\ \<^Const>\zero_class.zero T\\ | term_of_fm T fs ps (@{code Le} p) = - Const (\<^const_name>\Orderings.less_eq\, relT T) $ - term_of_tm T fs ps p $ Const (\<^const_name>\Groups.zero\, T) + \<^Const>\less_eq T for \term_of_tm T fs ps p\ \<^Const>\zero_class.zero T\\ | term_of_fm T fs ps (@{code Eq} p) = - Const (\<^const_name>\HOL.eq\, relT T) $ - term_of_tm T fs ps p $ Const (\<^const_name>\Groups.zero\, T) + \<^Const>\HOL.eq T for \term_of_tm T fs ps p\ \<^Const>\zero_class.zero T\\ | term_of_fm T fs ps (@{code NEq} p) = - \<^term>\Not\ $ - (Const (\<^const_name>\HOL.eq\, relT T) $ - term_of_tm T fs ps p $ Const (\<^const_name>\Groups.zero\, T)) + \<^Const>\Not for (* FIXME HOL.Not!? *) + \<^Const>\HOL.eq T for \term_of_tm T fs ps p\ \<^Const>\zero_class.zero T\\\ | term_of_fm T fs ps _ = error "term_of_fm: quantifiers"; fun frpar_procedure alternative T ps fm = diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/Reflective_Field.thy --- a/src/HOL/Decision_Procs/Reflective_Field.thy Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/Reflective_Field.thy Wed Sep 29 22:54:38 2021 +0200 @@ -619,23 +619,23 @@ qed ML \ -val term_of_nat = HOLogic.mk_number \<^typ>\nat\ o @{code integer_of_nat}; +val term_of_nat = HOLogic.mk_number \<^Type>\nat\ o @{code integer_of_nat}; -val term_of_int = HOLogic.mk_number \<^typ>\int\ o @{code integer_of_int}; +val term_of_int = HOLogic.mk_number \<^Type>\int\ o @{code integer_of_int}; -fun term_of_pexpr (@{code PExpr1} x) = \<^term>\PExpr1\ $ term_of_pexpr1 x - | term_of_pexpr (@{code PExpr2} x) = \<^term>\PExpr2\ $ term_of_pexpr2 x -and term_of_pexpr1 (@{code PCnst} k) = \<^term>\PCnst\ $ term_of_int k - | term_of_pexpr1 (@{code PVar} n) = \<^term>\PVar\ $ term_of_nat n - | term_of_pexpr1 (@{code PAdd} (x, y)) = \<^term>\PAdd\ $ term_of_pexpr x $ term_of_pexpr y - | term_of_pexpr1 (@{code PSub} (x, y)) = \<^term>\PSub\ $ term_of_pexpr x $ term_of_pexpr y - | term_of_pexpr1 (@{code PNeg} x) = \<^term>\PNeg\ $ term_of_pexpr x -and term_of_pexpr2 (@{code PMul} (x, y)) = \<^term>\PMul\ $ term_of_pexpr x $ term_of_pexpr y - | term_of_pexpr2 (@{code PPow} (x, n)) = \<^term>\PPow\ $ term_of_pexpr x $ term_of_nat n +fun term_of_pexpr (@{code PExpr1} x) = \<^Const>\PExpr1\ $ term_of_pexpr1 x + | term_of_pexpr (@{code PExpr2} x) = \<^Const>\PExpr2\ $ term_of_pexpr2 x +and term_of_pexpr1 (@{code PCnst} k) = \<^Const>\PCnst\ $ term_of_int k + | term_of_pexpr1 (@{code PVar} n) = \<^Const>\PVar\ $ term_of_nat n + | term_of_pexpr1 (@{code PAdd} (x, y)) = \<^Const>\PAdd\ $ term_of_pexpr x $ term_of_pexpr y + | term_of_pexpr1 (@{code PSub} (x, y)) = \<^Const>\PSub\ $ term_of_pexpr x $ term_of_pexpr y + | term_of_pexpr1 (@{code PNeg} x) = \<^Const>\PNeg\ $ term_of_pexpr x +and term_of_pexpr2 (@{code PMul} (x, y)) = \<^Const>\PMul\ $ term_of_pexpr x $ term_of_pexpr y + | term_of_pexpr2 (@{code PPow} (x, n)) = \<^Const>\PPow\ $ term_of_pexpr x $ term_of_nat n fun term_of_result (x, (y, zs)) = HOLogic.mk_prod (term_of_pexpr x, HOLogic.mk_prod - (term_of_pexpr y, HOLogic.mk_list \<^typ>\pexpr\ (map term_of_pexpr zs))); + (term_of_pexpr y, HOLogic.mk_list \<^Type>\pexpr\ (map term_of_pexpr zs))); local @@ -680,59 +680,47 @@ open Ring_Tac; -fun field_struct (Const (\<^const_name>\Ring.ring.add\, _) $ R $ _ $ _) = SOME R - | field_struct (Const (\<^const_name>\Ring.a_minus\, _) $ R $ _ $ _) = SOME R - | field_struct (Const (\<^const_name>\Group.monoid.mult\, _) $ R $ _ $ _) = SOME R - | field_struct (Const (\<^const_name>\Ring.a_inv\, _) $ R $ _) = SOME R - | field_struct (Const (\<^const_name>\Group.pow\, _) $ R $ _ $ _) = SOME R - | field_struct (Const (\<^const_name>\Algebra_Aux.m_div\, _) $ R $ _ $ _) = SOME R - | field_struct (Const (\<^const_name>\Ring.ring.zero\, _) $ R) = SOME R - | field_struct (Const (\<^const_name>\Group.monoid.one\, _) $ R) = SOME R - | field_struct (Const (\<^const_name>\Algebra_Aux.of_integer\, _) $ R $ _) = SOME R +fun field_struct \<^Const_>\Ring.ring.add _ _ for R _ _\ = SOME R + | field_struct \<^Const_>\Ring.a_minus _ _ for R _ _\ = SOME R + | field_struct \<^Const_>\Group.monoid.mult _ _ for R _ _\ = SOME R + | field_struct \<^Const_>\Ring.a_inv _ _ for R _\ = SOME R + | field_struct \<^Const_>\Group.pow _ _ _ for R _ _\ = SOME R + | field_struct \<^Const_>\Algebra_Aux.m_div _ _for R _ _\ = SOME R + | field_struct \<^Const_>\Ring.ring.zero _ _ for R\ = SOME R + | field_struct \<^Const_>\Group.monoid.one _ _ for R\ = SOME R + | field_struct \<^Const_>\Algebra_Aux.of_integer _ _ for R _\ = SOME R | field_struct _ = NONE; -fun reif_fexpr vs (Const (\<^const_name>\Ring.ring.add\, _) $ _ $ a $ b) = - \<^const>\FAdd\ $ reif_fexpr vs a $ reif_fexpr vs b - | reif_fexpr vs (Const (\<^const_name>\Ring.a_minus\, _) $ _ $ a $ b) = - \<^const>\FSub\ $ reif_fexpr vs a $ reif_fexpr vs b - | reif_fexpr vs (Const (\<^const_name>\Group.monoid.mult\, _) $ _ $ a $ b) = - \<^const>\FMul\ $ reif_fexpr vs a $ reif_fexpr vs b - | reif_fexpr vs (Const (\<^const_name>\Ring.a_inv\, _) $ _ $ a) = - \<^const>\FNeg\ $ reif_fexpr vs a - | reif_fexpr vs (Const (\<^const_name>\Group.pow\, _) $ _ $ a $ n) = - \<^const>\FPow\ $ reif_fexpr vs a $ n - | reif_fexpr vs (Const (\<^const_name>\Algebra_Aux.m_div\, _) $ _ $ a $ b) = - \<^const>\FDiv\ $ reif_fexpr vs a $ reif_fexpr vs b +fun reif_fexpr vs \<^Const_>\Ring.ring.add _ _ for _ a b\ = + \<^Const>\FAdd for \reif_fexpr vs a\ \reif_fexpr vs b\\ + | reif_fexpr vs \<^Const_>\Ring.a_minus _ _ for _ a b\ = + \<^Const>\FSub for \reif_fexpr vs a\ \reif_fexpr vs b\\ + | reif_fexpr vs \<^Const_>\Group.monoid.mult _ _ for _ a b\ = + \<^Const>\FMul for \reif_fexpr vs a\ \reif_fexpr vs b\\ + | reif_fexpr vs \<^Const_>\Ring.a_inv _ _ for _ a\ = + \<^Const>\FNeg for \reif_fexpr vs a\\ + | reif_fexpr vs \<^Const>\Group.pow _ _ _ for _ a n\ = + \<^Const>\FPow for \reif_fexpr vs a\ n\ + | reif_fexpr vs \<^Const_>\Algebra_Aux.m_div _ _ for _ a b\ = + \<^Const>\FDiv for \reif_fexpr vs a\ \reif_fexpr vs b\\ | reif_fexpr vs (Free x) = - \<^const>\FVar\ $ HOLogic.mk_number HOLogic.natT (find_index (equal x) vs) - | reif_fexpr vs (Const (\<^const_name>\Ring.ring.zero\, _) $ _) = - \<^term>\FCnst 0\ - | reif_fexpr vs (Const (\<^const_name>\Group.monoid.one\, _) $ _) = - \<^term>\FCnst 1\ - | reif_fexpr vs (Const (\<^const_name>\Algebra_Aux.of_integer\, _) $ _ $ n) = - \<^const>\FCnst\ $ n + \<^Const>\FVar for \HOLogic.mk_number HOLogic.natT (find_index (equal x) vs)\\ + | reif_fexpr vs \<^Const_>\Ring.ring.zero _ _ for _\ = \<^term>\FCnst 0\ + | reif_fexpr vs \<^Const_>\Group.monoid.one _ _ for _\ = \<^term>\FCnst 1\ + | reif_fexpr vs \<^Const_>\Algebra_Aux.of_integer _ _ for _ n\ = \<^Const>\FCnst for n\ | reif_fexpr _ _ = error "reif_fexpr: bad expression"; -fun reif_fexpr' vs (Const (\<^const_name>\Groups.plus\, _) $ a $ b) = - \<^const>\FAdd\ $ reif_fexpr' vs a $ reif_fexpr' vs b - | reif_fexpr' vs (Const (\<^const_name>\Groups.minus\, _) $ a $ b) = - \<^const>\FSub\ $ reif_fexpr' vs a $ reif_fexpr' vs b - | reif_fexpr' vs (Const (\<^const_name>\Groups.times\, _) $ a $ b) = - \<^const>\FMul\ $ reif_fexpr' vs a $ reif_fexpr' vs b - | reif_fexpr' vs (Const (\<^const_name>\Groups.uminus\, _) $ a) = - \<^const>\FNeg\ $ reif_fexpr' vs a - | reif_fexpr' vs (Const (\<^const_name>\Power.power\, _) $ a $ n) = - \<^const>\FPow\ $ reif_fexpr' vs a $ n - | reif_fexpr' vs (Const (\<^const_name>\divide\, _) $ a $ b) = - \<^const>\FDiv\ $ reif_fexpr' vs a $ reif_fexpr' vs b +fun reif_fexpr' vs \<^Const_>\plus _ for a b\ = \<^Const>\FAdd for \reif_fexpr' vs a\ \reif_fexpr' vs b\\ + | reif_fexpr' vs \<^Const_>\minus _ for a b\ = \<^Const>\FSub for \reif_fexpr' vs a\ \reif_fexpr' vs b\\ + | reif_fexpr' vs \<^Const_>\times _ for a b\ = \<^Const>\FMul for \reif_fexpr' vs a\ \reif_fexpr' vs b\\ + | reif_fexpr' vs \<^Const_>\uminus _ for a\ = \<^Const>\FNeg for \reif_fexpr' vs a\\ + | reif_fexpr' vs \<^Const_>\power _ for a n\ = \<^Const>\FPow for \reif_fexpr' vs a\ n\ + | reif_fexpr' vs \<^Const_>\divide _ for a b\ = \<^Const>\FDiv for \reif_fexpr' vs a\ \reif_fexpr' vs b\\ | reif_fexpr' vs (Free x) = - \<^const>\FVar\ $ HOLogic.mk_number HOLogic.natT (find_index (equal x) vs) - | reif_fexpr' vs (Const (\<^const_name>\zero_class.zero\, _)) = - \<^term>\FCnst 0\ - | reif_fexpr' vs (Const (\<^const_name>\one_class.one\, _)) = - \<^term>\FCnst 1\ - | reif_fexpr' vs (Const (\<^const_name>\numeral\, _) $ b) = - \<^const>\FCnst\ $ (@{const numeral (int)} $ b) + \<^Const>\FVar for \HOLogic.mk_number HOLogic.natT (find_index (equal x) vs)\\ + | reif_fexpr' vs \<^Const_>\zero_class.zero _\ = \<^term>\FCnst 0\ + | reif_fexpr' vs \<^Const_>\one_class.one _\ = \<^term>\FCnst 1\ + | reif_fexpr' vs \<^Const_>\numeral _ for b\ = \<^Const>\FCnst for \<^Const>\numeral \<^Type>\int\ for b\\ | reif_fexpr' _ _ = error "reif_fexpr: bad expression"; fun eq_field_simps @@ -861,7 +849,7 @@ fun conv xs qs = (case strip_app qs of (\<^const_name>\Nil\, []) => inst [] [xs] nonzero_Nil | (\<^const_name>\Cons\, [p, ps]) => (case Thm.term_of ps of - Const (\<^const_name>\Nil\, _) => + \<^Const_>\Nil _\ => transitive' (inst [] [xs, p] nonzero_singleton) (cong1 (cong2 (args2 peval_conv') Thm.reflexive)) | _ => transitive' (inst [] [xs, p, ps] nonzero_Cons) @@ -873,7 +861,7 @@ let val (prems, concl) = Logic.strip_horn g; fun find_eq s = (case s of - (_ $ (Const (\<^const_name>\HOL.eq\, Type (_, [T, _])) $ t $ u)) => + (_ $ \<^Const_>\HOL.eq T for t u\) => (case (field_struct t, field_struct u) of (SOME R, _) => SOME ((t, u), R, T, NONE, mk_in_carrier ctxt R [], reif_fexpr) | (_, SOME R) => SOME ((t, u), R, T, NONE, mk_in_carrier ctxt R [], reif_fexpr) diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/approximation.ML --- a/src/HOL/Decision_Procs/approximation.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/approximation.ML Wed Sep 29 22:54:38 2021 +0200 @@ -15,12 +15,8 @@ fun reorder_bounds_tac ctxt prems i = let - fun variable_of_bound (Const (\<^const_name>\Trueprop\, _) $ - (Const (\<^const_name>\Set.member\, _) $ - Free (name, _) $ _)) = name - | variable_of_bound (Const (\<^const_name>\Trueprop\, _) $ - (Const (\<^const_name>\HOL.eq\, _) $ - Free (name, _) $ _)) = name + fun variable_of_bound \<^Const_>\Trueprop for \<^Const_>\Set.member _ for \Free (name, _)\ _\\ = name + | variable_of_bound \<^Const_>\Trueprop for \<^Const_>\HOL.eq _ for \Free (name, _)\ _\\ = name | variable_of_bound t = raise TERM ("variable_of_bound", [t]) val variable_bounds @@ -43,18 +39,18 @@ end fun approximate ctxt t = case fastype_of t - of \<^typ>\bool\ => + of \<^Type>\bool\ => Approximation_Computation.approx_bool ctxt t - | \<^typ>\(float interval) option\ => + | \<^typ>\float interval option\ => Approximation_Computation.approx_arith ctxt t - | \<^typ>\(float interval) option list\ => + | \<^typ>\float interval option list\ => Approximation_Computation.approx_form_eval ctxt t | _ => error ("Bad term: " ^ Syntax.string_of_term ctxt t); fun rewrite_interpret_form_tac ctxt prec splitting taylor i st = let fun lookup_splitting (Free (name, _)) = (case AList.lookup (op =) splitting name - of SOME s => HOLogic.mk_number \<^typ>\nat\ s + of SOME s => HOLogic.mk_number \<^Type>\nat\ s | NONE => \<^term>\0 :: nat\) | lookup_splitting t = raise TERM ("lookup_splitting", [t]) val vs = nth (Thm.prems_of st) (i - 1) @@ -63,16 +59,16 @@ |> Term.strip_comb |> snd |> List.last |> HOLogic.dest_list val p = prec - |> HOLogic.mk_number \<^typ>\nat\ + |> HOLogic.mk_number \<^Type>\nat\ |> Thm.cterm_of ctxt in case taylor of NONE => let val n = vs |> length - |> HOLogic.mk_number \<^typ>\nat\ + |> HOLogic.mk_number \<^Type>\nat\ |> Thm.cterm_of ctxt val s = vs |> map lookup_splitting - |> HOLogic.mk_list \<^typ>\nat\ + |> HOLogic.mk_list \<^Type>\nat\ |> Thm.cterm_of ctxt in (resolve_tac ctxt [Thm.instantiate (TVars.empty, @@ -86,7 +82,7 @@ then raise (TERM ("More than one variable used for taylor series expansion", [Thm.prop_of st])) else let val t = t - |> HOLogic.mk_number \<^typ>\nat\ + |> HOLogic.mk_number \<^Type>\nat\ |> Thm.cterm_of ctxt val s = vs |> map lookup_splitting |> hd |> Thm.cterm_of ctxt @@ -97,42 +93,38 @@ end end -fun calculated_subterms (\<^const>\Trueprop\ $ t) = calculated_subterms t - | calculated_subterms (\<^const>\HOL.implies\ $ _ $ t) = calculated_subterms t - | calculated_subterms (\<^term>\(\) :: real \ real \ bool\ $ t1 $ t2) = [t1, t2] - | calculated_subterms (\<^term>\(<) :: real \ real \ bool\ $ t1 $ t2) = [t1, t2] - | calculated_subterms (\<^term>\(\) :: real \ real set \ bool\ $ t1 $ - (\<^term>\atLeastAtMost :: real \ real \ real set\ $ t2 $ t3)) = [t1, t2, t3] +fun calculated_subterms \<^Const_>\Trueprop for t\ = calculated_subterms t + | calculated_subterms \<^Const_>\implies for _ t\ = calculated_subterms t + | calculated_subterms \<^Const_>\less_eq \<^Type>\real\ for t1 t2\ = [t1, t2] + | calculated_subterms \<^Const_>\less \<^Type>\real\ for t1 t2\ = [t1, t2] + | calculated_subterms \<^Const_>\Set.member \<^Type>\real\ for + t1 \<^Const_>\atLeastAtMost \<^Type>\real\ for t2 t3\\ = [t1, t2, t3] | calculated_subterms t = raise TERM ("calculated_subterms", [t]) -fun dest_interpret_form (\<^const>\interpret_form\ $ b $ xs) = (b, xs) +fun dest_interpret_form \<^Const_>\interpret_form for b xs\ = (b, xs) | dest_interpret_form t = raise TERM ("dest_interpret_form", [t]) -fun dest_interpret (\<^const>\interpret_floatarith\ $ b $ xs) = (b, xs) +fun dest_interpret \<^Const_>\interpret_floatarith for b xs\ = (b, xs) | dest_interpret t = raise TERM ("dest_interpret", [t]) -fun dest_interpret_env (\<^const>\interpret_form\ $ _ $ xs) = xs - | dest_interpret_env (\<^const>\interpret_floatarith\ $ _ $ xs) = xs +fun dest_interpret_env \<^Const_>\interpret_form for _ xs\ = xs + | dest_interpret_env \<^Const_>\interpret_floatarith for _ xs\ = xs | dest_interpret_env t = raise TERM ("dest_interpret_env", [t]) -fun dest_float (\<^const>\Float\ $ m $ e) = (snd (HOLogic.dest_number m), snd (HOLogic.dest_number e)) +fun dest_float \<^Const_>\Float for m e\ = (snd (HOLogic.dest_number m), snd (HOLogic.dest_number e)) | dest_float t = raise TERM ("dest_float", [t]) -fun dest_ivl - (Const (\<^const_name>\Some\, _) $ - (Const (\<^const_name>\Interval\, _) $ ((Const (\<^const_name>\Pair\, _) $ u $ l)))) = +fun dest_ivl \<^Const_>\Some _ for \<^Const_>\Interval _ for \<^Const_>\Pair _ _ for u l\\\ = SOME (dest_float u, dest_float l) - | dest_ivl (Const (\<^const_name>\None\, _)) = NONE + | dest_ivl \<^Const_>\None _\ = NONE | dest_ivl t = raise TERM ("dest_result", [t]) -fun mk_approx' prec t = (\<^const>\approx'\ - $ HOLogic.mk_number \<^typ>\nat\ prec - $ t $ \<^term>\[] :: (float interval) option list\) +fun mk_approx' prec t = + \<^Const>\approx' for \HOLogic.mk_number \<^Type>\nat\ prec\ t \<^Const>\Nil \<^typ>\float interval option\\\ -fun mk_approx_form_eval prec t xs = (\<^const>\approx_form_eval\ - $ HOLogic.mk_number \<^typ>\nat\ prec - $ t $ xs) +fun mk_approx_form_eval prec t xs = + \<^Const>\approx_form_eval for \HOLogic.mk_number \<^Type>\nat\ prec\ t xs\ fun float2_float10 prec round_down (m, e) = ( let @@ -166,21 +158,21 @@ fun mk_result prec (SOME (l, u)) = (let fun mk_float10 rnd x = (let val (m, e) = float2_float10 prec rnd x - in if e = 0 then HOLogic.mk_number \<^typ>\real\ m - else if e = 1 then \<^term>\divide :: real \ real \ real\ $ - HOLogic.mk_number \<^typ>\real\ m $ + in if e = 0 then HOLogic.mk_number \<^Type>\real\ m + else if e = 1 then \<^Const>\divide \<^Type>\real\\ $ + HOLogic.mk_number \<^Type>\real\ m $ \<^term>\10\ - else \<^term>\divide :: real \ real \ real\ $ - HOLogic.mk_number \<^typ>\real\ m $ + else \<^Const>\divide \<^Type>\real\\ $ + HOLogic.mk_number \<^Type>\real\ m $ (\<^term>\power 10 :: nat \ real\ $ - HOLogic.mk_number \<^typ>\nat\ (~e)) end) - in \<^term>\atLeastAtMost :: real \ real \ real set\ $ mk_float10 true l $ mk_float10 false u end) + HOLogic.mk_number \<^Type>\nat\ (~e)) end) + in \<^Const>\atLeastAtMost \<^Type>\real\ for \mk_float10 true l\ \mk_float10 false u\\ end) | mk_result _ NONE = \<^term>\UNIV :: real set\ fun realify t = let val t = Logic.varify_global t - val m = map (fn (name, _) => (name, \<^typ>\real\)) (Term.add_tvars t []) + val m = map (fn (name, _) => (name, \<^Type>\real\)) (Term.add_tvars t []) val t = Term.subst_TVars m t in t end @@ -237,12 +229,12 @@ |> HOLogic.dest_Trueprop |> dest_interpret_form |> (fn (data, xs) => - mk_approx_form_eval prec data (HOLogic.mk_list \<^typ>\(float interval) option\ - (map (fn _ => \<^term>\None :: (float interval) option\) (HOLogic.dest_list xs))) + mk_approx_form_eval prec data (HOLogic.mk_list \<^typ>\float interval option\ + (map (fn _ => \<^Const>\None \<^typ>\float interval option\\) (HOLogic.dest_list xs))) |> approximate ctxt |> HOLogic.dest_list |> curry ListPair.zip (HOLogic.dest_list xs @ calculated_subterms arith_term) - |> map (fn (elem, s) => \<^term>\(\) :: real \ real set \ bool\ $ elem $ mk_result prec (dest_ivl s)) + |> map (fn (elem, s) => \<^Const>\Set.member \<^Type>\real\ for elem \mk_result prec (dest_ivl s)\\) |> foldr1 HOLogic.mk_conj)) fun approx_arith prec ctxt t = realify t @@ -257,8 +249,8 @@ |> mk_result prec fun approx prec ctxt t = - if type_of t = \<^typ>\prop\ then approx_form prec ctxt t - else if type_of t = \<^typ>\bool\ then approx_form prec ctxt (\<^const>\Trueprop\ $ t) + if type_of t = \<^Type>\prop\ then approx_form prec ctxt t + else if type_of t = \<^Type>\bool\ then approx_form prec ctxt \<^Const>\Trueprop for t\ else approx_arith prec ctxt t fun approximate_cmd modes raw_t state = diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/approximation_generator.ML --- a/src/HOL/Decision_Procs/approximation_generator.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/approximation_generator.ML Wed Sep 29 22:54:38 2021 +0200 @@ -33,33 +33,33 @@ fun real_of_man_exp m e = Real.fromManExp {man = Real.fromInt m, exp = e} -fun mapprox_float (\<^term>\Float\ $ m $ e) = real_of_man_exp (int_of_term m) (int_of_term e) +fun mapprox_float \<^Const_>\Float for m e\ = real_of_man_exp (int_of_term m) (int_of_term e) | mapprox_float t = Real.fromInt (snd (HOLogic.dest_number t)) handle TERM _ => raise TERM ("mapprox_float", [t]); (* TODO: define using compiled terms? *) -fun mapprox_floatarith (\<^term>\Add\ $ a $ b) xs = mapprox_floatarith a xs + mapprox_floatarith b xs - | mapprox_floatarith (\<^term>\Minus\ $ a) xs = ~ (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Mult\ $ a $ b) xs = mapprox_floatarith a xs * mapprox_floatarith b xs - | mapprox_floatarith (\<^term>\Inverse\ $ a) xs = 1.0 / mapprox_floatarith a xs - | mapprox_floatarith (\<^term>\Cos\ $ a) xs = Math.cos (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Arctan\ $ a) xs = Math.atan (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Abs\ $ a) xs = abs (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Max\ $ a $ b) xs = +fun mapprox_floatarith \<^Const_>\Add for a b\ xs = mapprox_floatarith a xs + mapprox_floatarith b xs + | mapprox_floatarith \<^Const_>\Minus for a\ xs = ~ (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Mult for a b\ xs = mapprox_floatarith a xs * mapprox_floatarith b xs + | mapprox_floatarith \<^Const_>\Inverse for a\ xs = 1.0 / mapprox_floatarith a xs + | mapprox_floatarith \<^Const_>\Cos for a\ xs = Math.cos (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Arctan for a\ xs = Math.atan (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Abs for a\ xs = abs (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Max for a b\ xs = Real.max (mapprox_floatarith a xs, mapprox_floatarith b xs) - | mapprox_floatarith (\<^term>\Min\ $ a $ b) xs = + | mapprox_floatarith \<^Const_>\Min for a b\ xs = Real.min (mapprox_floatarith a xs, mapprox_floatarith b xs) - | mapprox_floatarith \<^term>\Pi\ _ = Math.pi - | mapprox_floatarith (\<^term>\Sqrt\ $ a) xs = Math.sqrt (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Exp\ $ a) xs = Math.exp (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Powr\ $ a $ b) xs = + | mapprox_floatarith \<^Const_>\Pi\ _ = Math.pi + | mapprox_floatarith \<^Const_>\Sqrt for a\ xs = Math.sqrt (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Exp for a\ xs = Math.exp (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Powr for a b\ xs = Math.pow (mapprox_floatarith a xs, mapprox_floatarith b xs) - | mapprox_floatarith (\<^term>\Ln\ $ a) xs = Math.ln (mapprox_floatarith a xs) - | mapprox_floatarith (\<^term>\Power\ $ a $ n) xs = + | mapprox_floatarith \<^Const_>\Ln for a\ xs = Math.ln (mapprox_floatarith a xs) + | mapprox_floatarith \<^Const_>\Power for a n\ xs = Math.pow (mapprox_floatarith a xs, Real.fromInt (nat_of_term n)) - | mapprox_floatarith (\<^term>\Floor\ $ a) xs = Real.fromInt (floor (mapprox_floatarith a xs)) - | mapprox_floatarith (\<^term>\Var\ $ n) xs = nth xs (nat_of_term n) - | mapprox_floatarith (\<^term>\Num\ $ m) _ = mapprox_float m + | mapprox_floatarith \<^Const_>\Floor for a\ xs = Real.fromInt (floor (mapprox_floatarith a xs)) + | mapprox_floatarith \<^Const_>\Var for n\ xs = nth xs (nat_of_term n) + | mapprox_floatarith \<^Const_>\Num for m\ _ = mapprox_float m | mapprox_floatarith t _ = raise TERM ("mapprox_floatarith", [t]) fun mapprox_atLeastAtMost eps x a b xs = @@ -69,23 +69,20 @@ mapprox_floatarith a xs + eps <= x' andalso x' + eps <= mapprox_floatarith b xs end -fun mapprox_form eps (\<^term>\Bound\ $ x $ a $ b $ f) xs = +fun mapprox_form eps \<^Const_>\Bound for x a b f\ xs = (not (mapprox_atLeastAtMost eps x a b xs)) orelse mapprox_form eps f xs -| mapprox_form eps (\<^term>\Assign\ $ x $ a $ f) xs = +| mapprox_form eps \<^Const_>\Assign for x a f\ xs = (Real.!= (mapprox_floatarith x xs, mapprox_floatarith a xs)) orelse mapprox_form eps f xs -| mapprox_form eps (\<^term>\Less\ $ a $ b) xs = mapprox_floatarith a xs + eps < mapprox_floatarith b xs -| mapprox_form eps (\<^term>\LessEqual\ $ a $ b) xs = mapprox_floatarith a xs + eps <= mapprox_floatarith b xs -| mapprox_form eps (\<^term>\AtLeastAtMost\ $ x $ a $ b) xs = mapprox_atLeastAtMost eps x a b xs -| mapprox_form eps (\<^term>\Conj\ $ f $ g) xs = mapprox_form eps f xs andalso mapprox_form eps g xs -| mapprox_form eps (\<^term>\Disj\ $ f $ g) xs = mapprox_form eps f xs orelse mapprox_form eps g xs +| mapprox_form eps \<^Const_>\Less for a b\ xs = mapprox_floatarith a xs + eps < mapprox_floatarith b xs +| mapprox_form eps \<^Const_>\LessEqual for a b\ xs = mapprox_floatarith a xs + eps <= mapprox_floatarith b xs +| mapprox_form eps \<^Const_>\AtLeastAtMost for x a b\ xs = mapprox_atLeastAtMost eps x a b xs +| mapprox_form eps \<^Const_>\Conj for f g\ xs = mapprox_form eps f xs andalso mapprox_form eps g xs +| mapprox_form eps \<^Const_>\Disj for f g\ xs = mapprox_form eps f xs orelse mapprox_form eps g xs | mapprox_form _ t _ = raise TERM ("mapprox_form", [t]) -fun dest_interpret_form (\<^const>\interpret_form\ $ b $ xs) = (b, xs) +fun dest_interpret_form \<^Const_>\interpret_form for b xs\ = (b, xs) | dest_interpret_form t = raise TERM ("dest_interpret_form", [t]) -fun optionT t = Type (\<^type_name>\option\, [t]) -fun mk_Some t = Const (\<^const_name>\Some\, t --> optionT t) - fun random_float_list size xs seed = fold (K (apsnd (random_float size) #-> (fn c => apfst (fn b => b::c)))) xs ([],seed) @@ -96,7 +93,7 @@ fun term_of_Float (@{code Float} (m, e)) = @{term Float} $ term_of_int m $ term_of_int e -fun is_True \<^term>\True\ = true +fun is_True \<^Const_>\True\ = true | is_True _ = false val postproc_form_eqs = @@ -130,12 +127,12 @@ let val (rs, seed') = random_float_list size xs seed fun mk_approx_form e ts = - \<^const>\approx_form\ $ - HOLogic.mk_number \<^typ>\nat\ prec $ + \<^Const>\approx_form\ $ + HOLogic.mk_number \<^Type>\nat\ prec $ e $ - (HOLogic.mk_list \<^typ>\(float interval) option\ - (map (fn t => mk_Some \<^typ>\float interval\ $ (\<^term>\interval_of::float\_\ $ t)) ts)) $ - \<^term>\[] :: nat list\ + (HOLogic.mk_list \<^typ>\float interval option\ + (map (fn t => \<^Const>\Some \<^typ>\float interval\\ $ \<^Const>\interval_of \<^Type>\float\ for t\) ts)) $ + \<^Const>\Nil \<^Type>\nat\\ in (if mapprox_form eps e (map (real_of_Float o fst) rs) @@ -150,7 +147,7 @@ val ts' = map (AList.lookup op = (map dest_Free xs ~~ ts) #> the_default Term.dummy - #> curry op $ \<^term>\real_of_float::float\_\ + #> curry op $ \<^Const>\real_of_float\ #> conv_term ctxt (rewrite_with ctxt postproc_form_eqs)) frees in diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/cooper_tac.ML --- a/src/HOL/Decision_Procs/cooper_tac.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/cooper_tac.ML Wed Sep 29 22:54:38 2021 +0200 @@ -26,7 +26,7 @@ val np = length ps val (fm',np) = List.foldr (fn ((x, T), (fm,n)) => mk_all ((x, T), (fm,n))) (List.foldr HOLogic.mk_imp c rhs, np) ps - val (vs, _) = List.partition (fn t => q orelse (type_of t) = \<^typ>\nat\) + val (vs, _) = List.partition (fn t => q orelse (type_of t) = \<^Type>\nat\) (Misc_Legacy.term_frees fm' @ Misc_Legacy.term_vars fm'); val fm2 = List.foldr mk_all2 fm' vs in (fm2, np + length vs, length rhs) end; @@ -84,7 +84,7 @@ (* The result of the quantifier elimination *) val (th, tac) = (case Thm.prop_of pre_thm of - Const (\<^const_name>\Pure.imp\, _) $ (Const (\<^const_name>\Trueprop\, _) $ t1) $ _ => + \<^Const_>\Pure.imp for \<^Const_>\Trueprop for t1\ _\ => let val pth = linzqe_oracle (ctxt, Envir.eta_long [] t1) in diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/ferrack_tac.ML --- a/src/HOL/Decision_Procs/ferrack_tac.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/ferrack_tac.ML Wed Sep 29 22:54:38 2021 +0200 @@ -63,7 +63,7 @@ fun assm_tac i = REPEAT_DETERM_N nh (assume_tac ctxt i) (* The result of the quantifier elimination *) val (th, tac) = case Thm.prop_of pre_thm of - Const (\<^const_name>\Pure.imp\, _) $ (Const (\<^const_name>\Trueprop\, _) $ t1) $ _ => + \<^Const_>\Pure.imp for \<^Const_>\Trueprop for t1\ _\ => let val pth = linr_oracle (ctxt, Envir.eta_long [] t1) in ((pth RS iffD2) RS pre_thm, diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/ferrante_rackoff.ML --- a/src/HOL/Decision_Procs/ferrante_rackoff.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/ferrante_rackoff.ML Wed Sep 29 22:54:38 2021 +0200 @@ -33,12 +33,12 @@ {isolate_conv = icv, whatis = wi, simpset = simpset}):entry) = let fun uset (vars as (x::vs)) p = case Thm.term_of p of - Const(\<^const_name>\HOL.conj\, _)$ _ $ _ => + \<^Const_>\HOL.conj for _ _\ => let val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb val (lS,lth) = uset vars l val (rS, rth) = uset vars r in (lS@rS, Drule.binop_cong_rule b lth rth) end - | Const(\<^const_name>\HOL.disj\, _)$ _ $ _ => + | \<^Const_>\HOL.disj for _ _\ => let val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb val (lS,lth) = uset vars l val (rS, rth) = uset vars r @@ -78,7 +78,7 @@ fun main vs p = let val ((xn,ce),(x,fm)) = (case Thm.term_of p of - Const(\<^const_name>\Ex\,_)$Abs(xn,xT,_) => + \<^Const_>\Ex _ for \Abs(xn,xT,_)\\ => Thm.dest_comb p ||> Thm.dest_abs (SOME xn) |>> pair xn | _ => raise CTERM ("main QE only treats existential quantifiers!", [p])) val cT = Thm.ctyp_of_cterm x @@ -99,8 +99,8 @@ in fun provein x S = case Thm.term_of S of - Const(\<^const_name>\Orderings.bot\, _) => raise CTERM ("provein : not a member!", [S]) - | Const(\<^const_name>\insert\, _) $ y $_ => + \<^Const_>\Orderings.bot _\ => raise CTERM ("provein : not a member!", [S]) + | \<^Const_>\insert _ for y _\ => let val (cy,S') = Thm.dest_binop S in if Thm.term_of x aconv y then Thm.instantiate' [] [SOME x, SOME S'] insI1 else Thm.implies_elim (Thm.instantiate' [] [SOME x, SOME S', SOME cy] insI2) @@ -123,12 +123,12 @@ fun decomp_mpinf fm = case Thm.term_of fm of - Const(\<^const_name>\HOL.conj\,_)$_$_ => + \<^Const_>\HOL.conj for _ _\ => let val (p,q) = Thm.dest_binop fm in ([p,q], myfwd (minf_conj,pinf_conj, nmi_conj, npi_conj,ld_conj) (Thm.lambda x p) (Thm.lambda x q)) end - | Const(\<^const_name>\HOL.disj\,_)$_$_ => + | \<^Const_>\HOL.disj for _ _\ => let val (p,q) = Thm.dest_binop fm in ([p,q],myfwd (minf_disj, pinf_disj, nmi_disj, npi_disj,ld_disj) (Thm.lambda x p) (Thm.lambda x q)) @@ -176,19 +176,17 @@ let fun h bounds tm = (case Thm.term_of tm of - Const (\<^const_name>\HOL.eq\, T) $ _ $ _ => - if domain_type T = HOLogic.boolT then find_args bounds tm - else Thm.dest_fun2 tm - | Const (\<^const_name>\Not\, _) $ _ => h bounds (Thm.dest_arg tm) - | Const (\<^const_name>\All\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\Ex\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\HOL.conj\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\HOL.disj\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\HOL.implies\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Pure.imp\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Pure.eq\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Pure.all\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\Trueprop\, _) $ _ => h bounds (Thm.dest_arg tm) + \<^Const_>\HOL.eq \<^Type>\bool\ for _ _\ => find_args bounds tm + | \<^Const_>\Not for _\ => h bounds (Thm.dest_arg tm) + | \<^Const_>\All _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\Ex _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\conj for _ _\ => find_args bounds tm + | \<^Const_>\disj for _ _\ => find_args bounds tm + | \<^Const_>\implies for _ _\ => find_args bounds tm + | \<^Const_>\Pure.imp for _ _\ => find_args bounds tm + | \<^Const_>\Pure.eq _ for _ _\ => find_args bounds tm + | \<^Const_>\Pure.all _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\Trueprop for _\ => h bounds (Thm.dest_arg tm) | _ => Thm.dest_fun2 tm) and find_args bounds tm = (h bounds (Thm.dest_arg tm) handle CTERM _ => Thm.dest_arg1 tm) diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/langford.ML --- a/src/HOL/Decision_Procs/langford.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/langford.ML Wed Sep 29 22:54:38 2021 +0200 @@ -15,8 +15,8 @@ let fun h acc ct = (case Thm.term_of ct of - Const (\<^const_name>\Orderings.bot\, _) => acc - | Const (\<^const_name>\insert\, _) $ _ $ t => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)); + \<^Const_>\bot _\ => acc + | \<^Const_>\insert _ for _ _\ => h (Thm.dest_arg1 ct :: acc) (Thm.dest_arg ct)); in h [] end; fun prove_finite cT u = @@ -34,7 +34,7 @@ fun basic_dloqe ctxt stupid dlo_qeth dlo_qeth_nolb dlo_qeth_noub gather ep = (case Thm.term_of ep of - Const (\<^const_name>\Ex\, _) $ _ => + \<^Const_>\Ex _ for _\ => let val p = Thm.dest_arg ep val ths = @@ -53,10 +53,10 @@ val qe = (case (Thm.term_of L, Thm.term_of U) of - (Const (\<^const_name>\Orderings.bot\, _),_) => + (\<^Const_>\bot _\, _) => let val (neU, fU) = proveneF U in simp_rule ctxt (Thm.transitive ths (dlo_qeth_nolb OF [neU, fU])) end - | (_, Const (\<^const_name>\Orderings.bot\, _)) => + | (_, \<^Const_>\bot _\) => let val (neL,fL) = proveneF L in simp_rule ctxt (Thm.transitive ths (dlo_qeth_noub OF [neL, fL])) end | _ => @@ -71,13 +71,13 @@ let fun h acc ct = (case Thm.term_of ct of - \<^term>\HOL.conj\ $ _ $ _ => h (h acc (Thm.dest_arg ct)) (Thm.dest_arg1 ct) + \<^Const>\HOL.conj for _ _\ => h (h acc (Thm.dest_arg ct)) (Thm.dest_arg1 ct) | _ => ct :: acc) in h [] end; fun conjuncts ct = (case Thm.term_of ct of - \<^term>\HOL.conj\ $ _ $ _ => Thm.dest_arg1 ct :: conjuncts (Thm.dest_arg ct) + \<^Const>\HOL.conj for _ _\ => Thm.dest_arg1 ct :: conjuncts (Thm.dest_arg ct) | _ => [ct]); fun fold1 f = foldr1 (uncurry f); (* FIXME !? *) @@ -89,12 +89,12 @@ let fun h acc th = (case Thm.prop_of th of - \<^term>\Trueprop\ $ (\<^term>\HOL.conj\ $ p $ q) => + \<^Const_>\Trueprop for \<^Const_>\HOL.conj for p q\\ => h (h acc (th RS conjunct2)) (th RS conjunct1) - | \<^term>\Trueprop\ $ p => (p, th) :: acc) + | \<^Const_>\Trueprop for p\ => (p, th) :: acc) in fold (Termtab.insert Thm.eq_thm) (h [] th) Termtab.empty end; -fun is_conj (\<^term>\HOL.conj\$_$_) = true +fun is_conj \<^Const_>\HOL.conj for _ _\ = true | is_conj _ = false; fun prove_conj tab cjs = @@ -122,7 +122,7 @@ fun is_eqx x eq = (case Thm.term_of eq of - Const (\<^const_name>\HOL.eq\, _) $ l $ r => + \<^Const_>\HOL.eq _ for l r\ => l aconv Thm.term_of x orelse r aconv Thm.term_of x | _ => false); @@ -130,7 +130,7 @@ fun proc ctxt ct = (case Thm.term_of ct of - Const (\<^const_name>\Ex\, _) $ Abs (xn, _, _) => + \<^Const_>\Ex _ for \Abs (xn, _, _)\\ => let val e = Thm.dest_fun ct val (x,p) = Thm.dest_abs (SOME xn) (Thm.dest_arg ct) @@ -197,19 +197,17 @@ let fun h bounds tm = (case Thm.term_of tm of - Const (\<^const_name>\HOL.eq\, T) $ _ $ _ => - if domain_type T = HOLogic.boolT then find_args bounds tm - else Thm.dest_fun2 tm - | Const (\<^const_name>\Not\, _) $ _ => h bounds (Thm.dest_arg tm) - | Const (\<^const_name>\All\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\Pure.all\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\Ex\, _) $ _ => find_body bounds (Thm.dest_arg tm) - | Const (\<^const_name>\HOL.conj\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\HOL.disj\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\HOL.implies\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Pure.imp\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Pure.eq\, _) $ _ $ _ => find_args bounds tm - | Const (\<^const_name>\Trueprop\, _) $ _ => h bounds (Thm.dest_arg tm) + \<^Const_>\HOL.eq \<^Type>\bool\ for _ _\ => find_args bounds tm + | \<^Const_>\Not for _\ => h bounds (Thm.dest_arg tm) + | \<^Const_>\All _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\Pure.all _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\Ex _ for _\ => find_body bounds (Thm.dest_arg tm) + | \<^Const_>\HOL.conj for _ _\ => find_args bounds tm + | \<^Const_>\HOL.disj for _ _\ => find_args bounds tm + | \<^Const_>\HOL.implies for _ _\ => find_args bounds tm + | \<^Const_>\Pure.imp for _ _\ => find_args bounds tm + | \<^Const_>\Pure.eq _ for _ _\ => find_args bounds tm + | \<^Const_>\Trueprop for _\ => h bounds (Thm.dest_arg tm) | _ => Thm.dest_fun2 tm) and find_args bounds tm = (h bounds (Thm.dest_arg tm) handle CTERM _ => h bounds (Thm.dest_arg1 tm)) diff -r dc73f9e6476b -r e80c4cde6064 src/HOL/Decision_Procs/mir_tac.ML --- a/src/HOL/Decision_Procs/mir_tac.ML Wed Sep 29 18:22:32 2021 +0200 +++ b/src/HOL/Decision_Procs/mir_tac.ML Wed Sep 29 22:54:38 2021 +0200 @@ -105,7 +105,7 @@ (* The result of the quantifier elimination *) val (th, tac) = case Thm.prop_of pre_thm of - Const (\<^const_name>\Pure.imp\, _) $ (Const (\<^const_name>\Trueprop\, _) $ t1) $ _ => + \<^Const_>\Pure.imp for \<^Const_>\Trueprop for t1\ _\ => let val pth = mirfr_oracle (ctxt, Envir.eta_long [] t1) in