# HG changeset patch # User wenzelm # Date 1631390532 -7200 # Node ID ee04dc00bf0a9cc5a651b6adabcc5bdf1a333d3d # Parent 54279cfcf03751e0afc00279a51647e136a12dd8 more antiquotations; diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Datatype.thy --- a/src/ZF/Datatype.thy Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Datatype.thy Sat Sep 11 22:02:12 2021 +0200 @@ -63,7 +63,7 @@ struct val trace = Unsynchronized.ref false; - fun mk_new ([],[]) = Const(\<^const_name>\True\,FOLogic.oT) + fun mk_new ([],[]) = \<^Const>\True\ | mk_new (largs,rargs) = Balanced_Tree.make FOLogic.mk_conj (map FOLogic.mk_eq (ListPair.zip (largs,rargs))); @@ -89,7 +89,7 @@ if #big_rec_name lcon_info = #big_rec_name rcon_info andalso not (null (#free_iffs lcon_info)) then if lname = rname then mk_new (largs, rargs) - else Const(\<^const_name>\False\,FOLogic.oT) + else \<^Const>\False\ else raise Match val _ = if !trace then writeln ("NEW = " ^ Syntax.string_of_term ctxt new) diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Tools/datatype_package.ML --- a/src/ZF/Tools/datatype_package.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Tools/datatype_package.ML Sat Sep 11 22:02:12 2021 +0200 @@ -187,7 +187,7 @@ (*Find each recursive argument and add a recursive call for it*) fun rec_args [] = [] - | rec_args ((Const(\<^const_name>\mem\,_)$arg$X)::prems) = + | rec_args (\<^Const_>\mem for arg X\::prems) = (case head_of X of Const(a,_) => (*recursive occurrence?*) if member (op =) rec_names a @@ -310,7 +310,7 @@ | SOME recursor_def => let (*Replace subterms rec`x (where rec is a Free var) by recursor_tm(x) *) - fun subst_rec (Const(\<^const_name>\apply\,_) $ Free _ $ arg) = recursor_tm $ arg + fun subst_rec \<^Const_>\apply for \Free _\ arg\ = recursor_tm $ arg | subst_rec tm = let val (head, args) = strip_comb tm in list_comb (head, map subst_rec args) end; diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Tools/induct_tacs.ML --- a/src/ZF/Tools/induct_tacs.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Tools/induct_tacs.ML Sat Sep 11 22:02:12 2021 +0200 @@ -70,8 +70,7 @@ exception Find_tname of string fun find_tname ctxt var As = - let fun mk_pair (Const(\<^const_name>\mem\,_) $ Free (v,_) $ A) = - (v, #1 (dest_Const (head_of A))) + let fun mk_pair \<^Const_>\mem for \Free (v,_)\ A\ = (v, #1 (dest_Const (head_of A))) | mk_pair _ = raise Match val pairs = map_filter (try (mk_pair o FOLogic.dest_Trueprop)) As val x = @@ -99,7 +98,7 @@ datatype_info thy tn |> (if exh then #exhaustion else #induct) |> Thm.transfer thy; - val (Const(\<^const_name>\mem\,_) $ Var(ixn,_) $ _) = + val \<^Const_>\mem for \Var(ixn,_)\ _\ = (case Thm.prems_of rule of [] => error "induction is not available for this datatype" | major::_ => FOLogic.dest_Trueprop major) @@ -120,15 +119,14 @@ fun rep_datatype_i elim induct case_eqns recursor_eqns thy = let (*analyze the LHS of a case equation to get a constructor*) - fun const_of (Const(\<^const_name>\IFOL.eq\, _) $ (_ $ c) $ _) = c + fun const_of \<^Const_>\IFOL.eq _ for \_ $ c\ _\ = c | const_of eqn = error ("Ill-formed case equation: " ^ Syntax.string_of_term_global thy eqn); val constructors = map (head_of o const_of o FOLogic.dest_Trueprop o Thm.prop_of) case_eqns; - val Const (\<^const_name>\mem\, _) $ _ $ data = - FOLogic.dest_Trueprop (hd (Thm.prems_of elim)); + val \<^Const_>\mem for _ data\ = FOLogic.dest_Trueprop (hd (Thm.prems_of elim)); val Const(big_rec_name, _) = head_of data; diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Tools/inductive_package.ML --- a/src/ZF/Tools/inductive_package.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Tools/inductive_package.ML Sat Sep 11 22:02:12 2021 +0200 @@ -99,7 +99,7 @@ val z' = mk_variant"z" and X' = mk_variant"X" and w' = mk_variant"w"; - fun dest_tprop (Const(\<^const_name>\Trueprop\,_) $ P) = P + fun dest_tprop \<^Const_>\Trueprop for P\ = P | dest_tprop Q = error ("Ill-formed premise of introduction rule: " ^ Syntax.string_of_term ctxt0 Q); @@ -297,8 +297,7 @@ (*Used to make induction rules; ind_alist = [(rec_tm1,pred1),...] associates predicates with rec ops prem is a premise of an intr rule*) - fun add_induct_prem ind_alist (prem as Const (\<^const_name>\Trueprop\, _) $ - (Const (\<^const_name>\mem\, _) $ t $ X), iprems) = + fun add_induct_prem ind_alist (prem as \<^Const_>\Trueprop for \\<^Const_>\mem for t X\\\, iprems) = (case AList.lookup (op aconv) ind_alist X of SOME pred => prem :: FOLogic.mk_Trueprop (pred $ t) :: iprems | NONE => (*possibly membership in M(rec_tm), for M monotone*) @@ -514,7 +513,7 @@ (*strip quantifier and the implication*) val induct0 = inst (quant_induct RS @{thm spec} RSN (2, @{thm rev_mp})); - val Const (\<^const_name>\Trueprop\, _) $ (pred_var $ _) = Thm.concl_of induct0 + val \<^Const_>\Trueprop for \pred_var $ _\\ = Thm.concl_of induct0 val induct0 = CP.split_rule_var ctxt4 diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Tools/primrec_package.ML --- a/src/ZF/Tools/primrec_package.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Tools/primrec_package.ML Sat Sep 11 22:02:12 2021 +0200 @@ -115,8 +115,7 @@ case AList.lookup (op =) eqns cname of NONE => (warning ("no equation for constructor " ^ cname ^ "\nin definition of function " ^ fname); - (Const (\<^const_name>\zero\, Ind_Syntax.iT), - #2 recursor_pair, Const (\<^const_name>\zero\, Ind_Syntax.iT))) + (\<^Const>\zero\, #2 recursor_pair, \<^Const>\zero\)) | SOME (rhs, cargs', eq) => (rhs, inst_recursor (recursor_pair, cargs'), eq) val allowed_terms = map use_fabs (#2 (strip_comb recursor_rhs)) diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/Tools/typechk.ML --- a/src/ZF/Tools/typechk.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/Tools/typechk.ML Sat Sep 11 22:02:12 2021 +0200 @@ -76,8 +76,7 @@ if length rls <= maxr then resolve_tac ctxt rls i else no_tac end); -fun is_rigid_elem (Const(\<^const_name>\Trueprop\,_) $ (Const(\<^const_name>\mem\,_) $ a $ _)) = - not (is_Var (head_of a)) +fun is_rigid_elem \<^Const_>\Trueprop for \\<^Const_>\mem for a _\\\ = not (is_Var (head_of a)) | is_rigid_elem _ = false; (*Try solving a:A by assumption provided a is rigid!*) diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/arith_data.ML --- a/src/ZF/arith_data.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/arith_data.ML Sat Sep 11 22:02:12 2021 +0200 @@ -24,8 +24,8 @@ val iT = Ind_Syntax.iT; -val zero = Const(\<^const_name>\zero\, iT); -val succ = Const(\<^const_name>\succ\, iT --> iT); +val zero = \<^Const>\zero\; +val succ = \<^Const>\succ\; fun mk_succ t = succ $ t; val one = mk_succ zero; @@ -44,9 +44,9 @@ (* dest_sum *) -fun dest_sum (Const(\<^const_name>\zero\,_)) = [] - | dest_sum (Const(\<^const_name>\succ\,_) $ t) = one :: dest_sum t - | dest_sum (Const(\<^const_name>\Arith.add\,_) $ t $ u) = dest_sum t @ dest_sum u +fun dest_sum \<^Const_>\zero\ = [] + | dest_sum \<^Const_>\succ for t\ = one :: dest_sum t + | dest_sum \<^Const_>\Arith.add for t u\ = dest_sum t @ dest_sum u | dest_sum tm = [tm]; (*Apply the given rewrite (if present) just once*) diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/ind_syntax.ML --- a/src/ZF/ind_syntax.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/ind_syntax.ML Sat Sep 11 22:02:12 2021 +0200 @@ -18,7 +18,7 @@ (** Abstract syntax definitions for ZF **) -val iT = Type(\<^type_name>\i\, []); +val iT = \<^Type>\i\; (*Creates All(%v.v:A --> P(v)) rather than Ball(A,P) *) fun mk_all_imp (A,P) = @@ -29,17 +29,16 @@ fun mk_Collect (a, D, t) = \<^const>\Collect\ $ D $ absfree (a, iT) t; (*simple error-checking in the premises of an inductive definition*) -fun chk_prem rec_hd (Const (\<^const_name>\conj\, _) $ _ $ _) = +fun chk_prem rec_hd \<^Const_>\conj for _ _\ = error"Premises may not be conjuctive" - | chk_prem rec_hd (Const (\<^const_name>\mem\, _) $ t $ X) = + | chk_prem rec_hd \<^Const_>\mem for t X\ = (Logic.occs(rec_hd,t) andalso error "Recursion term on left of member symbol"; ()) | chk_prem rec_hd t = (Logic.occs(rec_hd,t) andalso error "Recursion term in side formula"; ()); (*Return the conclusion of a rule, of the form t:X*) fun rule_concl rl = - let val Const (\<^const_name>\Trueprop\, _) $ (Const (\<^const_name>\mem\, _) $ t $ X) = - Logic.strip_imp_concl rl + let val \<^Const_>\Trueprop for \\<^Const_>\mem for t X\\\ = Logic.strip_imp_concl rl in (t,X) end; (*As above, but return error message if bad*) @@ -61,7 +60,7 @@ type constructor_spec = (string * typ * mixfix) * string * term list * term list; -fun dest_mem (Const (\<^const_name>\mem\, _) $ x $ A) = (x, A) +fun dest_mem \<^Const_>\mem for x A\ = (x, A) | dest_mem _ = error "Constructor specifications must have the form x:A"; (*read a constructor specification*) diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/int_arith.ML --- a/src/ZF/int_arith.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/int_arith.ML Sat Sep 11 22:02:12 2021 +0200 @@ -44,7 +44,7 @@ fun mk_numeral i = \<^const>\integ_of\ $ mk_bin i; -fun dest_numeral (Const(\<^const_name>\integ_of\, _) $ w) = dest_bin w +fun dest_numeral \<^Const_>\integ_of for w\ = dest_bin w | dest_numeral t = raise TERM ("dest_numeral", [t]); fun find_first_numeral past (t::terms) = @@ -65,9 +65,9 @@ | long_mk_sum (t :: ts) = mk_plus (t, mk_sum ts); (*decompose additions AND subtractions as a sum*) -fun dest_summing (pos, Const (\<^const_name>\zadd\, _) $ t $ u, ts) = +fun dest_summing (pos, \<^Const_>\zadd for t u\, ts) = dest_summing (pos, t, dest_summing (pos, u, ts)) - | dest_summing (pos, Const (\<^const_name>\zdiff\, _) $ t $ u, ts) = + | dest_summing (pos, \<^Const_>\zdiff for t u\, ts) = dest_summing (pos, t, dest_summing (not pos, u, ts)) | dest_summing (pos, t, ts) = if pos then t::ts else \<^const>\zminus\ $ t :: ts; @@ -93,7 +93,7 @@ fun mk_coeff (k, t) = mk_times (mk_numeral k, t); (*Express t as a product of (possibly) a numeral with other sorted terms*) -fun dest_coeff sign (Const (\<^const_name>\zminus\, _) $ t) = dest_coeff (~sign) t +fun dest_coeff sign \<^Const_>\zminus for t\ = dest_coeff (~sign) t | dest_coeff sign t = let val ts = sort Term_Ord.term_ord (dest_prod t) val (n, ts') = find_first_numeral [] ts diff -r 54279cfcf037 -r ee04dc00bf0a src/ZF/simpdata.ML --- a/src/ZF/simpdata.ML Sat Sep 11 21:58:02 2021 +0200 +++ b/src/ZF/simpdata.ML Sat Sep 11 22:02:12 2021 +0200 @@ -19,11 +19,11 @@ | NONE => [th]) | _ => [th] in case Thm.concl_of th of - Const(\<^const_name>\Trueprop\,_) $ P => + \<^Const_>\Trueprop for P\ => (case P of - Const(\<^const_name>\mem\,_) $ a $ b => tryrules mem_pairs b - | Const(\<^const_name>\True\,_) => [] - | Const(\<^const_name>\False\,_) => [] + \<^Const_>\mem for a b\ => tryrules mem_pairs b + | \<^Const_>\True\ => [] + | \<^Const_>\False\ => [] | A => tryrules conn_pairs A) | _ => [th] end;