# HG changeset patch # User wenzelm # Date 1724591242 -7200 # Node ID bc936d3d8b451ead91ccaf08bfa9c846cdc1e907 # Parent be8c0e039a5ed82d88998bb2d77ae3d78ce99582 tuned, following be8c0e039a5e; diff -r be8c0e039a5e -r bc936d3d8b45 src/CCL/Set.thy --- a/src/CCL/Set.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/CCL/Set.thy Sun Aug 25 15:07:22 2024 +0200 @@ -19,10 +19,10 @@ syntax "_Coll" :: "[idt, o] \ 'a set" ("(1{_./ _})") +syntax_consts + "_Coll" == Collect translations "{x. P}" == "CONST Collect(\x. P)" -syntax_consts - "_Coll" == Collect lemma CollectI: "P(a) \ a : {x. P(x)}" apply (rule mem_Collect_iff [THEN iffD2]) @@ -52,12 +52,12 @@ syntax "_Ball" :: "[idt, 'a set, o] \ o" ("(ALL _:_./ _)" [0, 0, 0] 10) "_Bex" :: "[idt, 'a set, o] \ o" ("(EX _:_./ _)" [0, 0, 0] 10) +syntax_consts + "_Ball" == Ball and + "_Bex" == Bex translations "ALL x:A. P" == "CONST Ball(A, \x. P)" "EX x:A. P" == "CONST Bex(A, \x. P)" -syntax_consts - "_Ball" == Ball and - "_Bex" == Bex lemma ballI: "(\x. x:A \ P(x)) \ ALL x:A. P(x)" by (simp add: Ball_def) @@ -129,12 +129,12 @@ syntax "_INTER" :: "[idt, 'a set, 'b set] \ 'b set" ("(INT _:_./ _)" [0, 0, 0] 10) "_UNION" :: "[idt, 'a set, 'b set] \ 'b set" ("(UN _:_./ _)" [0, 0, 0] 10) +syntax_consts + "_INTER" == INTER and + "_UNION" == UNION translations "INT x:A. B" == "CONST INTER(A, \x. B)" "UN x:A. B" == "CONST UNION(A, \x. B)" -syntax_consts - "_INTER" == INTER and - "_UNION" == UNION definition Inter :: "(('a set)set) \ 'a set" where "Inter(S) == (INT x:S. x)" diff -r be8c0e039a5e -r bc936d3d8b45 src/CCL/Term.thy --- a/src/CCL/Term.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/CCL/Term.thy Sun Aug 25 15:07:22 2024 +0200 @@ -49,8 +49,8 @@ where let_def: "let1(t, f) == case(t,f(true),f(false), \x y. f(), \u. f(lam x. u(x)))" syntax "_let1" :: "[idt,i,i]\i" ("(3let _ be _/ in _)" [0,0,60] 60) +syntax_consts "_let1" == let1 translations "let x be a in e" == "CONST let1(a, \x. e)" -syntax_consts "_let1" == let1 definition letrec :: "[[i,i\i]\i,(i\i)\i]\i" where "letrec(h, b) == b(\x. fix(\f. lam x. h(x,\y. f`y))`x)" @@ -68,6 +68,10 @@ "_letrec" :: "[idt,idt,i,i]\i" ("(3letrec _ _ be _/ in _)" [0,0,0,60] 60) "_letrec2" :: "[idt,idt,idt,i,i]\i" ("(3letrec _ _ _ be _/ in _)" [0,0,0,0,60] 60) "_letrec3" :: "[idt,idt,idt,idt,i,i]\i" ("(3letrec _ _ _ _ be _/ in _)" [0,0,0,0,0,60] 60) +syntax_consts + "_letrec" == letrec and + "_letrec2" == letrec2 and + "_letrec3" == letrec3 parse_translation \ let fun abs_tr t u = Syntax_Trans.abs_tr [t, u]; @@ -123,10 +127,6 @@ (\<^const_syntax>\letrec3\, K letrec3_tr')] end \ -syntax_consts - "_letrec" == letrec and - "_letrec2" == letrec2 and - "_letrec3" == letrec3 definition nrec :: "[i,i,[i,i]\i]\i" where "nrec(n,b,c) == letrec g x be ncase(x, b, \y. c(y,g(y))) in g(n)" diff -r be8c0e039a5e -r bc936d3d8b45 src/CCL/Type.thy --- a/src/CCL/Type.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/CCL/Type.thy Sun Aug 25 15:07:22 2024 +0200 @@ -14,10 +14,10 @@ syntax "_Subtype" :: "[idt, 'a set, o] \ 'a set" ("(1{_: _ ./ _})") +syntax_consts + "_Subtype" == Subtype translations "{x: A. B}" == "CONST Subtype(A, \x. B)" -syntax_consts - "_Subtype" == Subtype definition Unit :: "i set" where "Unit == {x. x=one}" @@ -39,6 +39,9 @@ "_Sigma" :: "[idt, i set, i set] \ i set" ("(3SUM _:_./ _)" [0,0,60] 60) "_arrow" :: "[i set, i set] \ i set" ("(_ ->/ _)" [54, 53] 53) "_star" :: "[i set, i set] \ i set" ("(_ */ _)" [56, 55] 55) +syntax_consts + "_Pi" "_arrow" \ Pi and + "_Sigma" "_star" \ Sigma translations "PROD x:A. B" \ "CONST Pi(A, \x. B)" "A -> B" \ "CONST Pi(A, \_. B)" @@ -50,9 +53,6 @@ (\<^const_syntax>\Sigma\, fn _ => Syntax_Trans.dependent_tr' (\<^syntax_const>\_Sigma\, \<^syntax_const>\_star\))] \ -syntax_consts - "_Pi" "_arrow" \ Pi and - "_Sigma" "_star" \ Sigma definition Nat :: "i set" where "Nat == lfp(\X. Unit + X)" diff -r be8c0e039a5e -r bc936d3d8b45 src/CTT/CTT.thy --- a/src/CTT/CTT.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/CTT/CTT.thy Sun Aug 25 15:07:22 2024 +0200 @@ -58,12 +58,12 @@ syntax "_PROD" :: "[idt,t,t]\t" ("(3\_:_./ _)" 10) "_SUM" :: "[idt,t,t]\t" ("(3\_:_./ _)" 10) +syntax_consts + "_PROD" \ Prod and + "_SUM" \ Sum translations "\x:A. B" \ "CONST Prod(A, \x. B)" "\x:A. B" \ "CONST Sum(A, \x. B)" -syntax_consts - "_PROD" \ Prod and - "_SUM" \ Sum abbreviation Arrow :: "[t,t]\t" (infixr "\" 30) where "A \ B \ \_:A. B" diff -r be8c0e039a5e -r bc936d3d8b45 src/Cube/Cube.thy --- a/src/Cube/Cube.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/Cube/Cube.thy Sun Aug 25 15:07:22 2024 +0200 @@ -39,6 +39,13 @@ "_Lam" :: "[idt, term, term] \ term" ("(3\<^bold>\_:_./ _)" [0, 0, 0] 10) "_Pi" :: "[idt, term, term] \ term" ("(3\_:_./ _)" [0, 0] 10) "_arrow" :: "[term, term] \ term" (infixr "\" 10) +syntax_consts + "_Trueprop" \ Trueprop and + "_MT_context" \ MT_context and + "_Context" \ Context and + "_Has_type" \ Has_type and + "_Lam" \ Abs and + "_Pi" "_arrow" \ Prod translations "_Trueprop(G, t)" \ "CONST Trueprop(G, t)" ("prop") "x:X" \ ("prop") "\ x:X" @@ -52,13 +59,6 @@ [(\<^const_syntax>\Prod\, fn _ => Syntax_Trans.dependent_tr' (\<^syntax_const>\_Pi\, \<^syntax_const>\_arrow\))] \ -syntax_consts - "_Trueprop" \ Trueprop and - "_MT_context" \ MT_context and - "_Context" \ Context and - "_Has_type" \ Has_type and - "_Lam" \ Abs and - "_Pi" "_arrow" \ Prod axiomatization where s_b: "*: \" and diff -r be8c0e039a5e -r bc936d3d8b45 src/FOL/IFOL.thy --- a/src/FOL/IFOL.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/FOL/IFOL.thy Sun Aug 25 15:07:22 2024 +0200 @@ -102,8 +102,8 @@ where \x \ y \ \ (x = y)\ syntax "_Uniq" :: "pttrn \ o \ o" ("(2\\<^sub>\\<^sub>1 _./ _)" [0, 10] 10) +syntax_consts "_Uniq" \ Uniq translations "\\<^sub>\\<^sub>1x. P" \ "CONST Uniq (\x. P)" -syntax_consts "_Uniq" \ Uniq print_translation \ [Syntax_Trans.preserve_binder_abs_tr' \<^const_syntax>\Uniq\ \<^syntax_const>\_Uniq\] @@ -747,10 +747,10 @@ "" :: \letbind => letbinds\ (\_\) "_binds" :: \[letbind, letbinds] => letbinds\ (\_;/ _\) "_Let" :: \[letbinds, 'a] => 'a\ (\(let (_)/ in (_))\ 10) +syntax_consts "_Let" \ Let translations "_Let(_binds(b, bs), e)" == "_Let(b, _Let(bs, e))" "let x = a in e" == "CONST Let(a, \x. e)" -syntax_consts "_Let" \ Let lemma LetI: assumes \\x. x = t \ P(u(x))\ diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/Bin.thy --- a/src/ZF/Bin.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/Bin.thy Sun Aug 25 15:07:22 2024 +0200 @@ -117,10 +117,11 @@ "_Int" :: "num_token \ i" (\#_\ 1000) "_Neg_Int" :: "num_token \ i" (\#-_\ 1000) +syntax_consts + "_Int0" "_Int1" "_Int2" "_Int" "_Neg_Int1" "_Neg_Int2" "_Neg_Int" \ integ_of + ML_file \Tools/numeral_syntax.ML\ -syntax_consts - "_Int0" "_Int1" "_Int2" "_Int" "_Neg_Int1" "_Neg_Int2" "_Neg_Int" \ integ_of declare bin.intros [simp,TC] diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/Induct/Multiset.thy --- a/src/ZF/Induct/Multiset.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/Induct/Multiset.thy Sun Aug 25 15:07:22 2024 +0200 @@ -75,9 +75,9 @@ syntax "_MColl" :: "[pttrn, i, o] \ i" (\(1{# _ \ _./ _#})\) +syntax_consts "_MColl" \ MCollect translations "{#x \ M. P#}" == "CONST MCollect(M, \x. P)" -syntax_consts "_MColl" \ MCollect (* multiset orderings *) diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/List.thy --- a/src/ZF/List.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/List.thy Sun Aug 25 15:07:22 2024 +0200 @@ -17,11 +17,11 @@ syntax "_Nil" :: i (\[]\) "_List" :: "is \ i" (\[(_)]\) +syntax_consts "_List" \ Cons translations "[x, xs]" == "CONST Cons(x, [xs])" "[x]" == "CONST Cons(x, [])" "[]" == "CONST Nil" -syntax_consts "_List" \ Cons consts length :: "i\i" diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/OrdQuant.thy --- a/src/ZF/OrdQuant.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/OrdQuant.thy Sun Aug 25 15:07:22 2024 +0200 @@ -26,14 +26,14 @@ "_oall" :: "[idt, i, o] \ o" (\(3\_<_./ _)\ 10) "_oex" :: "[idt, i, o] \ o" (\(3\_<_./ _)\ 10) "_OUNION" :: "[idt, i, i] \ i" (\(3\_<_./ _)\ 10) +syntax_consts + "_oall" \ oall and + "_oex" \ oex and + "_OUNION" \ OUnion translations "\x "CONST oall(a, \x. P)" "\x "CONST oex(a, \x. P)" "\x "CONST OUnion(a, \x. B)" -syntax_consts - "_oall" \ oall and - "_oex" \ oex and - "_OUNION" \ OUnion subsubsection \simplification of the new quantifiers\ @@ -198,12 +198,12 @@ syntax "_rall" :: "[pttrn, i\o, o] \ o" (\(3\_[_]./ _)\ 10) "_rex" :: "[pttrn, i\o, o] \ o" (\(3\_[_]./ _)\ 10) +syntax_consts + "_rall" \ rall and + "_rex" \ rex translations "\x[M]. P" \ "CONST rall(M, \x. P)" "\x[M]. P" \ "CONST rex(M, \x. P)" -syntax_consts - "_rall" \ rall and - "_rex" \ rex subsubsection\Relativized universal quantifier\ diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/QPair.thy --- a/src/ZF/QPair.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/QPair.thy Sun Aug 25 15:07:22 2024 +0200 @@ -46,10 +46,10 @@ syntax "_QSUM" :: "[idt, i, i] \ i" (\(3QSUM _ \ _./ _)\ 10) +syntax_consts + "_QSUM" \ QSigma translations "QSUM x \ A. B" => "CONST QSigma(A, \x. B)" -syntax_consts - "_QSUM" \ QSigma abbreviation qprod (infixr \<*>\ 80) where diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/UNITY/Union.thy --- a/src/ZF/UNITY/Union.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/UNITY/Union.thy Sun Aug 25 15:07:22 2024 +0200 @@ -43,12 +43,12 @@ syntax "_JOIN1" :: "[pttrns, i] \ i" (\(3\_./ _)\ 10) "_JOIN" :: "[pttrn, i, i] \ i" (\(3\_ \ _./ _)\ 10) +syntax_consts + "_JOIN1" "_JOIN" == JOIN translations "\x \ A. B" == "CONST JOIN(A, (\x. B))" "\x y. B" == "\x. \y. B" "\x. B" == "CONST JOIN(CONST state, (\x. B))" -syntax_consts - "_JOIN1" "_JOIN" == JOIN subsection\SKIP\ diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/ZF_Base.thy --- a/src/ZF/ZF_Base.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/ZF_Base.thy Sun Aug 25 15:07:22 2024 +0200 @@ -38,12 +38,12 @@ syntax "_Ball" :: "[pttrn, i, o] \ o" (\(3\_\_./ _)\ 10) "_Bex" :: "[pttrn, i, o] \ o" (\(3\_\_./ _)\ 10) +syntax_consts + "_Ball" \ Ball and + "_Bex" \ Bex translations "\x\A. P" \ "CONST Ball(A, \x. P)" "\x\A. P" \ "CONST Bex(A, \x. P)" -syntax_consts - "_Ball" \ Ball and - "_Bex" \ Bex subsection \Variations on Replacement\ @@ -56,10 +56,10 @@ syntax "_Replace" :: "[pttrn, pttrn, i, o] \ i" (\(1{_ ./ _ \ _, _})\) +syntax_consts + "_Replace" \ Replace translations "{y. x\A, Q}" \ "CONST Replace(A, \x y. Q)" -syntax_consts - "_Replace" \ Replace (* Functional form of replacement -- analgous to ML's map functional *) @@ -69,10 +69,10 @@ syntax "_RepFun" :: "[i, pttrn, i] \ i" (\(1{_ ./ _ \ _})\ [51,0,51]) +syntax_consts + "_RepFun" \ RepFun translations "{b. x\A}" \ "CONST RepFun(A, \x. b)" -syntax_consts - "_RepFun" \ RepFun (* Separation and Pairing can be derived from the Replacement and Powerset Axioms using the following definitions. *) @@ -81,10 +81,10 @@ syntax "_Collect" :: "[pttrn, i, o] \ i" (\(1{_ \ _ ./ _})\) +syntax_consts + "_Collect" \ Collect translations "{x\A. P}" \ "CONST Collect(A, \x. P)" -syntax_consts - "_Collect" \ Collect subsection \General union and intersection\ @@ -95,12 +95,12 @@ syntax "_UNION" :: "[pttrn, i, i] \ i" (\(3\_\_./ _)\ 10) "_INTER" :: "[pttrn, i, i] \ i" (\(3\_\_./ _)\ 10) +syntax_consts + "_UNION" == Union and + "_INTER" == Inter translations "\x\A. B" == "CONST Union({B. x\A})" "\x\A. B" == "CONST Inter({B. x\A})" -syntax_consts - "_UNION" == Union and - "_INTER" == Inter subsection \Finite sets and binary operations\ @@ -134,11 +134,11 @@ "" :: "i \ is" (\_\) "_Enum" :: "[i, is] \ is" (\_,/ _\) "_Finset" :: "is \ i" (\{(_)}\) +syntax_consts + "_Finset" == cons translations "{x, xs}" == "CONST cons(x, {xs})" "{x}" == "CONST cons(x, 0)" -syntax_consts - "_Finset" == cons subsection \Axioms\ @@ -199,14 +199,14 @@ "" :: "pttrn \ patterns" (\_\) "_patterns" :: "[pttrn, patterns] \ patterns" (\_,/_\) "_Tuple" :: "[i, is] \ i" (\\(_,/ _)\\) +syntax_consts + "_pattern" "_patterns" == split and + "_Tuple" == Pair translations "\x, y, z\" == "\x, \y, z\\" "\x, y\" == "CONST Pair(x, y)" "\\x,y,zs\.b" == "CONST split(\x \y,zs\.b)" "\\x,y\.b" == "CONST split(\x y. b)" -syntax_consts - "_pattern" "_patterns" == split and - "_Tuple" == Pair definition Sigma :: "[i, i \ i] \ i" where "Sigma(A,B) \ \x\A. \y\B(x). {\x,y\}" @@ -268,14 +268,14 @@ "_PROD" :: "[pttrn, i, i] \ i" (\(3\_\_./ _)\ 10) "_SUM" :: "[pttrn, i, i] \ i" (\(3\_\_./ _)\ 10) "_lam" :: "[pttrn, i, i] \ i" (\(3\_\_./ _)\ 10) +syntax_consts + "_PROD" == Pi and + "_SUM" == Sigma and + "_lam" == Lambda translations "\x\A. B" == "CONST Pi(A, \x. B)" "\x\A. B" == "CONST Sigma(A, \x. B)" "\x\A. f" == "CONST Lambda(A, \x. f)" -syntax_consts - "_PROD" == Pi and - "_SUM" == Sigma and - "_lam" == Lambda subsection \ASCII syntax\ diff -r be8c0e039a5e -r bc936d3d8b45 src/ZF/func.thy --- a/src/ZF/func.thy Sun Aug 25 15:02:19 2024 +0200 +++ b/src/ZF/func.thy Sun Aug 25 15:07:22 2024 +0200 @@ -452,10 +452,10 @@ "" :: "updbind \ updbinds" (\_\) "_updbinds" :: "[updbind, updbinds] \ updbinds" (\_,/ _\) "_Update" :: "[i, updbinds] \ i" (\_/'((_)')\ [900,0] 900) +syntax_consts "_Update" "_updbind" \ update translations "_Update (f, _updbinds(b,bs))" == "_Update (_Update(f,b), bs)" "f(x:=y)" == "CONST update(f,x,y)" -syntax_consts "_Update" "_updbind" \ update lemma update_apply [simp]: "f(x:=y) ` z = (if z=x then y else f`z)" apply (simp add: update_def)