# HG changeset patch # User wenzelm # Date 1724613001 -7200 # Node ID c7723cc15de8c8d8e5341d06bb586d16c9d92913 # Parent 079fe4292526a2d458f06dfd93ba94a922354e3a more markup for syntax consts; diff -r 079fe4292526 -r c7723cc15de8 src/Benchmarks/Quickcheck_Benchmark/Needham_Schroeder_Base.thy --- a/src/Benchmarks/Quickcheck_Benchmark/Needham_Schroeder_Base.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/Benchmarks/Quickcheck_Benchmark/Needham_Schroeder_Base.thy Sun Aug 25 21:10:01 2024 +0200 @@ -28,6 +28,8 @@ syntax "_MTuple" :: "['a, args] => 'a * 'b" ("(2\_,/ _\)") +syntax_consts + "_MTuple" == MPair translations "\x, y, z\" == "\x, \y, z\\" "\x, y\" == "CONST MPair x y" diff -r 079fe4292526 -r c7723cc15de8 src/Doc/Tutorial/Protocol/Message.thy --- a/src/Doc/Tutorial/Protocol/Message.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/Doc/Tutorial/Protocol/Message.thy Sun Aug 25 21:10:01 2024 +0200 @@ -81,6 +81,8 @@ text\Concrete syntax: messages appear as \\A,B,NA\\, etc...\ syntax "_MTuple" :: "['a, args] \ 'a * 'b" ("(2\_,/ _\)") +syntax_consts + "_MTuple" == MPair translations "\x, y, z\" == "\x, \y, z\\" "\x, y\" == "CONST MPair x y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Algebra/FiniteProduct.thy --- a/src/HOL/Algebra/FiniteProduct.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Algebra/FiniteProduct.thy Sun Aug 25 21:10:01 2024 +0200 @@ -308,6 +308,8 @@ syntax "_finprod" :: "index \ idt \ 'a set \ 'b \ 'b" ("(3\__\_. _)" [1000, 0, 51, 10] 10) +syntax_consts + "_finprod" \ finprod translations "\\<^bsub>G\<^esub>i\A. b" \ "CONST finprod G (%i. b) A" \ \Beware of argument permutation!\ diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Algebra/Lattice.thy --- a/src/HOL/Algebra/Lattice.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Algebra/Lattice.thy Sun Aug 25 21:10:01 2024 +0200 @@ -36,6 +36,10 @@ "_sup1" :: "('a, 'b) gorder_scheme \ pttrns \ 'a \ 'a" ("(3SSUP\ _./ _)" [0, 10] 10) "_sup" :: "('a, 'b) gorder_scheme \ pttrn \ 'c set \ 'a \ 'a" ("(3SSUP\ _:_./ _)" [0, 0, 10] 10) +syntax_consts + "_inf1" "_inf" == infi and + "_sup1" "_sup" == supr + translations "IINF\<^bsub>L\<^esub> x. B" == "CONST infi L CONST UNIV (%x. B)" "IINF\<^bsub>L\<^esub> x:A. B" == "CONST infi L A (%x. B)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Algebra/Ring.thy --- a/src/HOL/Algebra/Ring.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Algebra/Ring.thy Sun Aug 25 21:10:01 2024 +0200 @@ -46,6 +46,8 @@ syntax "_finsum" :: "index \ idt \ 'a set \ 'b \ 'b" ("(3\__\_. _)" [1000, 0, 51, 10] 10) +syntax_consts + "_finsum" \ finsum translations "\\<^bsub>G\<^esub>i\A. b" \ "CONST finsum G (\i. b) A" \ \Beware of argument permutation!\ diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Bochner_Integration.thy --- a/src/HOL/Analysis/Bochner_Integration.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Bochner_Integration.thy Sun Aug 25 21:10:01 2024 +0200 @@ -892,12 +892,18 @@ syntax "_lebesgue_integral" :: "pttrn \ real \ 'a measure \ real" ("\((2 _./ _)/ \_)" [60,61] 110) +syntax_consts + "_lebesgue_integral" == lebesgue_integral + translations "\ x. f \M" == "CONST lebesgue_integral M (\x. f)" syntax "_ascii_lebesgue_integral" :: "pttrn \ 'a measure \ real \ real" ("(3LINT (1_)/|(_)./ _)" [0,110,60] 60) +syntax_consts + "_ascii_lebesgue_integral" == lebesgue_integral + translations "LINT x|M. f" == "CONST lebesgue_integral M (\x. f)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Euclidean_Space.thy --- a/src/HOL/Analysis/Euclidean_Space.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Euclidean_Space.thy Sun Aug 25 21:10:01 2024 +0200 @@ -34,6 +34,7 @@ "(\u\Basis. inner x u = 0) \ (x = 0)" syntax "_type_dimension" :: "type \ nat" ("(1DIM/(1'(_')))") +syntax_consts "_type_dimension" \ card translations "DIM('a)" \ "CONST card (CONST Basis :: 'a set)" typed_print_translation \ [(\<^const_syntax>\card\, diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Finite_Cartesian_Product.thy --- a/src/HOL/Analysis/Finite_Cartesian_Product.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Finite_Cartesian_Product.thy Sun Aug 25 21:10:01 2024 +0200 @@ -40,6 +40,7 @@ \<^item> \'a^'b::_\ becomes \('a, 'b) vec\ without extra sort-constraint \ syntax "_vec_type" :: "type \ type \ type" (infixl "^" 15) +syntax_types "_vec_type" \ vec parse_translation \ let fun vec t u = Syntax.const \<^type_syntax>\vec\ $ t $ u; diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Finite_Product_Measure.thy --- a/src/HOL/Analysis/Finite_Product_Measure.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Finite_Product_Measure.thy Sun Aug 25 21:10:01 2024 +0200 @@ -170,6 +170,8 @@ syntax "_PiM" :: "pttrn \ 'i set \ 'a measure \ ('i => 'a) measure" ("(3\\<^sub>M _\_./ _)" 10) +syntax_consts + "_PiM" == PiM translations "\\<^sub>M x\I. M" == "CONST PiM I (%x. M)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Infinite_Set_Sum.thy --- a/src/HOL/Analysis/Infinite_Set_Sum.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Infinite_Set_Sum.thy Sun Aug 25 21:10:01 2024 +0200 @@ -100,6 +100,8 @@ syntax "_infsetsum" :: "pttrn \ 'a set \ 'b \ 'b::{banach, second_countable_topology}" ("(2\\<^sub>a_\_./ _)" [0, 51, 10] 10) +syntax_consts + "_infsetsum" \ infsetsum translations \ \Beware of argument permutation!\ "\\<^sub>ai\A. b" \ "CONST infsetsum (\i. b) A" @@ -109,6 +111,8 @@ syntax "_uinfsetsum" :: "pttrn \ 'b \ 'b::{banach, second_countable_topology}" ("(2\\<^sub>a_./ _)" [0, 10] 10) +syntax_consts + "_uinfsetsum" \ infsetsum translations \ \Beware of argument permutation!\ "\\<^sub>ai. b" \ "CONST infsetsum (\i. b) (CONST UNIV)" @@ -118,6 +122,8 @@ syntax "_qinfsetsum" :: "pttrn \ bool \ 'a \ 'a::{banach, second_countable_topology}" ("(2\\<^sub>a_ | (_)./ _)" [0, 0, 10] 10) +syntax_consts + "_qinfsetsum" \ infsetsum translations "\\<^sub>ax|P. t" => "CONST infsetsum (\x. t) {x. P}" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Infinite_Sum.thy --- a/src/HOL/Analysis/Infinite_Sum.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Infinite_Sum.thy Sun Aug 25 21:10:01 2024 +0200 @@ -50,6 +50,8 @@ "_infsum" :: "pttrn \ 'a set \ 'b \ 'b::topological_comm_monoid_add" ("(3INFSUM (_/:_)./ _)" [0, 51, 10] 10) syntax "_infsum" :: "pttrn \ 'a set \ 'b \ 'b::topological_comm_monoid_add" ("(2\\<^sub>\(_/\_)./ _)" [0, 51, 10] 10) +syntax_consts + "_infsum" \ infsum translations \ \Beware of argument permutation!\ "\\<^sub>\i\A. b" \ "CONST infsum (\i. b) A" @@ -57,6 +59,8 @@ "_univinfsum" :: "pttrn \ 'a \ 'a" ("(3INFSUM _./ _)" [0, 10] 10) syntax "_univinfsum" :: "pttrn \ 'a \ 'a" ("(2\\<^sub>\_./ _)" [0, 10] 10) +syntax_consts + "_univinfsum" \ infsum translations "\\<^sub>\x. t" \ "CONST infsum (\x. t) (CONST UNIV)" @@ -64,6 +68,8 @@ "_qinfsum" :: "pttrn \ bool \ 'a \ 'a" ("(3INFSUM _ |/ _./ _)" [0, 0, 10] 10) syntax "_qinfsum" :: "pttrn \ bool \ 'a \ 'a" ("(2\\<^sub>\_ | (_)./ _)" [0, 0, 10] 10) +syntax_consts + "_qinfsum" \ infsum translations "\\<^sub>\x|P. t" => "CONST infsum (\x. t) {x. P}" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Interval_Integral.thy --- a/src/HOL/Analysis/Interval_Integral.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Interval_Integral.thy Sun Aug 25 21:10:01 2024 +0200 @@ -148,6 +148,9 @@ "_ascii_interval_lebesgue_integral" :: "pttrn \ real \ real \ real measure \ real \ real" ("(5LINT _=_.._|_. _)" [0,60,60,61,100] 60) +syntax_consts + "_ascii_interval_lebesgue_integral" == interval_lebesgue_integral + translations "LINT x=a..b|M. f" == "CONST interval_lebesgue_integral M a b (\x. f)" @@ -159,6 +162,9 @@ "_ascii_interval_lebesgue_borel_integral" :: "pttrn \ real \ real \ real \ real" ("(4LBINT _=_.._. _)" [0,60,60,61] 60) +syntax_consts + "_ascii_interval_lebesgue_borel_integral" == interval_lebesgue_integral + translations "LBINT x=a..b. f" == "CONST interval_lebesgue_integral CONST lborel a b (\x. f)" @@ -1045,11 +1051,17 @@ syntax "_complex_lebesgue_borel_integral" :: "pttrn \ real \ complex" ("(2CLBINT _. _)" [0,60] 60) +syntax_consts + "_complex_lebesgue_borel_integral" == complex_lebesgue_integral + translations "CLBINT x. f" == "CONST complex_lebesgue_integral CONST lborel (\x. f)" syntax "_complex_set_lebesgue_borel_integral" :: "pttrn \ real set \ real \ complex" ("(3CLBINT _:_. _)" [0,60,61] 60) +syntax_consts + "_complex_set_lebesgue_borel_integral" == complex_set_lebesgue_integral + translations "CLBINT x:A. f" == "CONST complex_set_lebesgue_integral CONST lborel A (\x. f)" @@ -1065,6 +1077,9 @@ "_ascii_complex_interval_lebesgue_borel_integral" :: "pttrn \ ereal \ ereal \ real \ complex" ("(4CLBINT _=_.._. _)" [0,60,60,61] 60) +syntax_consts + "_ascii_complex_interval_lebesgue_borel_integral" == complex_interval_lebesgue_integral + translations "CLBINT x=a..b. f" == "CONST complex_interval_lebesgue_integral CONST lborel a b (\x. f)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Measure_Space.thy --- a/src/HOL/Analysis/Measure_Space.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Measure_Space.thy Sun Aug 25 21:10:01 2024 +0200 @@ -1006,6 +1006,9 @@ syntax "_almost_everywhere" :: "pttrn \ 'a \ bool \ bool" ("AE _ in _. _" [0,0,10] 10) +syntax_consts + "_almost_everywhere" \ almost_everywhere + translations "AE x in M. P" \ "CONST almost_everywhere M (\x. P)" @@ -1016,6 +1019,9 @@ "_set_almost_everywhere" :: "pttrn \ 'a set \ 'a \ bool \ bool" ("AE _\_ in _./ _" [0,0,0,10] 10) +syntax_consts + "_set_almost_everywhere" \ set_almost_everywhere + translations "AE x\A in M. P" \ "CONST set_almost_everywhere A M (\x. P)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Nonnegative_Lebesgue_Integration.thy --- a/src/HOL/Analysis/Nonnegative_Lebesgue_Integration.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Nonnegative_Lebesgue_Integration.thy Sun Aug 25 21:10:01 2024 +0200 @@ -586,6 +586,9 @@ syntax "_simple_integral" :: "pttrn \ ennreal \ 'a measure \ ennreal" ("\\<^sup>S _. _ \_" [60,61] 110) +syntax_consts + "_simple_integral" == simple_integral + translations "\\<^sup>S x. f \M" == "CONST simple_integral M (%x. f)" @@ -819,6 +822,9 @@ syntax "_nn_integral" :: "pttrn \ ennreal \ 'a measure \ ennreal" ("\\<^sup>+((2 _./ _)/ \_)" [60,61] 110) +syntax_consts + "_nn_integral" == nn_integral + translations "\\<^sup>+x. f \M" == "CONST nn_integral M (\x. f)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Set_Integral.thy --- a/src/HOL/Analysis/Set_Integral.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Set_Integral.thy Sun Aug 25 21:10:01 2024 +0200 @@ -26,6 +26,9 @@ "_ascii_set_lebesgue_integral" :: "pttrn \ 'a set \ 'a measure \ real \ real" ("(4LINT (_):(_)/|(_)./ _)" [0,0,0,10] 10) +syntax_consts + "_ascii_set_lebesgue_integral" == set_lebesgue_integral + translations "LINT x:A|M. f" == "CONST set_lebesgue_integral M A (\x. f)" @@ -576,6 +579,9 @@ "_complex_lebesgue_integral" :: "pttrn \ complex \ 'a measure \ complex" ("\\<^sup>C _. _ \_" [0,0] 110) +syntax_consts + "_complex_lebesgue_integral" == complex_lebesgue_integral + translations "\\<^sup>Cx. f \M" == "CONST complex_lebesgue_integral M (\x. f)" @@ -583,6 +589,9 @@ "_ascii_complex_lebesgue_integral" :: "pttrn \ 'a measure \ real \ real" ("(3CLINT _|_. _)" [0,0,10] 10) +syntax_consts + "_ascii_complex_lebesgue_integral" == complex_lebesgue_integral + translations "CLINT x|M. f" == "CONST complex_lebesgue_integral M (\x. f)" @@ -617,6 +626,9 @@ "_ascii_complex_set_lebesgue_integral" :: "pttrn \ 'a set \ 'a measure \ real \ real" ("(4CLINT _:_|_. _)" [0,0,0,10] 10) +syntax_consts + "_ascii_complex_set_lebesgue_integral" == complex_set_lebesgue_integral + translations "CLINT x:A|M. f" == "CONST complex_set_lebesgue_integral M A (\x. f)" @@ -640,6 +652,10 @@ "_set_lebesgue_integral" :: "pttrn => 'a set => 'a measure => ereal => ereal" ("(\((_)\(_)./ _)/\_)" [0,0,0,110] 10) +syntax_consts +"_set_nn_integral" == set_nn_integral and +"_set_lebesgue_integral" == set_lebesgue_integral + translations "\\<^sup>+x \ A. f \M" == "CONST set_nn_integral M A (\x. f)" "\x \ A. f \M" == "CONST set_lebesgue_integral M A (\x. f)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Analysis/Sparse_In.thy --- a/src/HOL/Analysis/Sparse_In.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Analysis/Sparse_In.thy Sun Aug 25 21:10:01 2024 +0200 @@ -166,11 +166,15 @@ syntax "_eventually_cosparse" :: "pttrn => 'a set => bool => bool" ("(3\\<^sub>\_\_./ _)" [0, 0, 10] 10) +syntax_consts + "_eventually_cosparse" == eventually translations "\\<^sub>\x\A. P" == "CONST eventually (\x. P) (CONST cosparse A)" syntax "_qeventually_cosparse" :: "pttrn \ bool \ 'a \ 'a" ("(3\\<^sub>\_ | (_)./ _)" [0, 0, 10] 10) +syntax_consts + "_qeventually_cosparse" == eventually translations "\\<^sub>\x|P. t" => "CONST eventually (\x. t) (CONST cosparse {x. P})" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Auth/Message.thy --- a/src/HOL/Auth/Message.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Auth/Message.thy Sun Aug 25 21:10:01 2024 +0200 @@ -51,6 +51,8 @@ text\Concrete syntax: messages appear as \\A,B,NA\\, etc...\ syntax "_MTuple" :: "['a, args] \ 'a * 'b" ("(2\_,/ _\)") +syntax_consts + "_MTuple" \ MPair translations "\x, y, z\" \ "\x, \y, z\\" "\x, y\" \ "CONST MPair x y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Bali/AxSem.thy --- a/src/HOL/Bali/AxSem.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Bali/AxSem.thy Sun Aug 25 21:10:01 2024 +0200 @@ -205,6 +205,8 @@ syntax "_peek_res" :: "pttrn \ 'a assn \ 'a assn" ("\_:. _" [0,3] 3) +syntax_consts + "_peek_res" == peek_res translations "\w:. P" == "CONST peek_res (\w. P)" @@ -266,6 +268,8 @@ syntax "_peek_st" :: "pttrn \ 'a assn \ 'a assn" ("\_.. _" [0,3] 3) +syntax_consts + "_peek_st" == peek_st translations "\s.. P" == "CONST peek_st (\s. P)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Bali/Basis.thy --- a/src/HOL/Bali/Basis.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Bali/Basis.thy Sun Aug 25 21:10:01 2024 +0200 @@ -195,6 +195,10 @@ "_Oall" :: "[pttrn, 'a option, bool] \ bool" ("(3\_\_:/ _)" [0,0,10] 10) "_Oex" :: "[pttrn, 'a option, bool] \ bool" ("(3\_\_:/ _)" [0,0,10] 10) +syntax_consts + "_Oall" \ Ball and + "_Oex" \ Bex + translations "\x\A: P" \ "\x\CONST set_option A. P" "\x\A: P" \ "\x\CONST set_option A. P" @@ -257,6 +261,8 @@ text \list patterns -- extends pre-defined type "pttrn" used in abstractions\ syntax "_lpttrn" :: "[pttrn, pttrn] \ pttrn" ("_#/_" [901,900] 900) +syntax_consts + "_lpttrn" \ lsplit translations "\y # x # xs. b" \ "CONST lsplit (\y x # xs. b)" "\x # xs. b" \ "CONST lsplit (\x xs. b)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Bali/State.thy --- a/src/HOL/Bali/State.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Bali/State.thy Sun Aug 25 21:10:01 2024 +0200 @@ -135,6 +135,10 @@ Heap :: "loc \ oref" Stat :: "qtname \ oref" +syntax_consts + Heap == Inl and + Stat == Inr + translations "Heap" => "CONST Inl" "Stat" => "CONST Inr" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Codegenerator_Test/Code_Lazy_Test.thy --- a/src/HOL/Codegenerator_Test/Code_Lazy_Test.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Codegenerator_Test/Code_Lazy_Test.thy Sun Aug 25 21:10:01 2024 +0200 @@ -24,6 +24,7 @@ no_notation lazy_llist ("_") syntax "_llist" :: "args => 'a list" ("\<^bold>[(_)\<^bold>]") +syntax_consts "_llist" == lazy_llist translations "\<^bold>[x, xs\<^bold>]" == "x\<^bold>#\<^bold>[xs\<^bold>]" "\<^bold>[x\<^bold>]" == "x\<^bold>#\<^bold>[\<^bold>]" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/Cfun.thy --- a/src/HOL/HOLCF/Cfun.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/Cfun.thy Sun Aug 25 21:10:01 2024 +0200 @@ -52,6 +52,9 @@ syntax "_Lambda" :: "[cargs, logic] \ logic" ("(3\ _./ _)" [1000, 10] 10) +syntax_consts + "_Lambda" \ Abs_cfun + parse_ast_translation \ (* rewrite (LAM x y z. t) => (_cabs x (_cabs y (_cabs z t))) *) (* cf. Syntax.lambda_ast_tr from src/Pure/Syntax/syn_trans.ML *) diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/ConvexPD.thy --- a/src/HOL/HOLCF/ConvexPD.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/ConvexPD.thy Sun Aug 25 21:10:01 2024 +0200 @@ -181,6 +181,9 @@ syntax "_convex_pd" :: "args \ logic" ("{_}\") +syntax_consts + "_convex_pd" == convex_add + translations "{x,xs}\" == "{x}\ \\ {xs}\" "{x}\" == "CONST convex_unit\x" @@ -348,6 +351,9 @@ "_convex_bind" :: "[logic, logic, logic] \ logic" ("(3\\_\_./ _)" [0, 0, 10] 10) +syntax_consts + "_convex_bind" == convex_bind + translations "\\x\xs. e" == "CONST convex_bind\xs\(\ x. e)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/IOA/Sequence.thy --- a/src/HOL/HOLCF/IOA/Sequence.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/IOA/Sequence.thy Sun Aug 25 21:10:01 2024 +0200 @@ -72,6 +72,8 @@ syntax "_totlist" :: "args \ 'a Seq" ("[(_)!]") "_partlist" :: "args \ 'a Seq" ("[(_)?]") +syntax_consts + "_totlist" "_partlist" \ Consq translations "[x, xs!]" \ "x \ [xs!]" "[x!]" \ "x\nil" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/LowerPD.thy --- a/src/HOL/HOLCF/LowerPD.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/LowerPD.thy Sun Aug 25 21:10:01 2024 +0200 @@ -136,6 +136,9 @@ syntax "_lower_pd" :: "args \ logic" ("{_}\") +syntax_consts + "_lower_pd" == lower_add + translations "{x,xs}\" == "{x}\ \\ {xs}\" "{x}\" == "CONST lower_unit\x" @@ -342,6 +345,9 @@ "_lower_bind" :: "[logic, logic, logic] \ logic" ("(3\\_\_./ _)" [0, 0, 10] 10) +syntax_consts + "_lower_bind" == lower_bind + translations "\\x\xs. e" == "CONST lower_bind\xs\(\ x. e)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/Pcpo.thy --- a/src/HOL/HOLCF/Pcpo.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/Pcpo.thy Sun Aug 25 21:10:01 2024 +0200 @@ -153,6 +153,7 @@ text \Old "UU" syntax:\ syntax UU :: logic +syntax_consts UU \ bottom translations "UU" \ "CONST bottom" text \Simproc to rewrite \<^term>\\ = x\ to \<^term>\x = \\.\ diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/Porder.thy --- a/src/HOL/HOLCF/Porder.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/Porder.thy Sun Aug 25 21:10:01 2024 +0200 @@ -118,6 +118,9 @@ syntax "_BLub" :: "[pttrn, 'a set, 'b] \ 'b" ("(3\_\_./ _)" [0,0, 10] 10) +syntax_consts + "_BLub" \ lub + translations "LUB x:A. t" \ "CONST lub ((\x. t) ` A)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/Representable.thy --- a/src/HOL/HOLCF/Representable.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/Representable.thy Sun Aug 25 21:10:01 2024 +0200 @@ -32,6 +32,7 @@ assumes cast_liftdefl: "cast\(liftdefl TYPE('a)) = liftemb oo liftprj" syntax "_LIFTDEFL" :: "type \ logic" ("(1LIFTDEFL/(1'(_')))") +syntax_consts "_LIFTDEFL" \ liftdefl translations "LIFTDEFL('t)" \ "CONST liftdefl TYPE('t)" definition liftdefl_of :: "udom defl \ udom u defl" @@ -51,6 +52,7 @@ assumes liftdefl_eq: "liftdefl TYPE('a) = liftdefl_of\(defl TYPE('a))" syntax "_DEFL" :: "type \ logic" ("(1DEFL/(1'(_')))") +syntax_consts "_DEFL" \ defl translations "DEFL('t)" \ "CONST defl TYPE('t)" instance "domain" \ predomain diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/Sprod.thy --- a/src/HOL/HOLCF/Sprod.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/Sprod.thy Sun Aug 25 21:10:01 2024 +0200 @@ -41,6 +41,7 @@ where "ssplit = (\ f p. seq\p\(f\(sfst\p)\(ssnd\p)))" syntax "_stuple" :: "[logic, args] \ logic" ("(1'(:_,/ _:'))") +syntax_consts "_stuple" \ spair translations "(:x, y, z:)" \ "(:x, (:y, z:):)" "(:x, y:)" \ "CONST spair\x\y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/UpperPD.thy --- a/src/HOL/HOLCF/UpperPD.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/UpperPD.thy Sun Aug 25 21:10:01 2024 +0200 @@ -134,6 +134,9 @@ syntax "_upper_pd" :: "args \ logic" ("{_}\") +syntax_consts + "_upper_pd" == upper_add + translations "{x,xs}\" == "{x}\ \\ {xs}\" "{x}\" == "CONST upper_unit\x" @@ -335,6 +338,9 @@ "_upper_bind" :: "[logic, logic, logic] \ logic" ("(3\\_\_./ _)" [0, 0, 10] 10) +syntax_consts + "_upper_bind" == upper_bind + translations "\\x\xs. e" == "CONST upper_bind\xs\(\ x. e)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/HOLCF/ex/Letrec.thy --- a/src/HOL/HOLCF/ex/Letrec.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/HOLCF/ex/Letrec.thy Sun Aug 25 21:10:01 2024 +0200 @@ -22,6 +22,9 @@ "_recbinds" :: "[recbindt, recbinds] \ recbinds" ("_;/ _") "_Letrec" :: "[recbinds, logic] \ logic" ("(Letrec (_)/ in (_))" 10) +syntax_consts + "_recbind" "_recbinds" "_recbindt" "_Letrec" == CLetrec + translations (recbindt) "x = a, (y,ys) = (b,bs)" == (recbindt) "(x,y,ys) = (a,b,bs)" (recbindt) "x = a, y = b" == (recbindt) "(x,y) = (a,b)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Cardinality.thy --- a/src/HOL/Library/Cardinality.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Cardinality.thy Sun Aug 25 21:10:01 2024 +0200 @@ -32,6 +32,8 @@ syntax "_type_card" :: "type => nat" ("(1CARD/(1'(_')))") +syntax_consts "_type_card" == card + translations "CARD('t)" => "CONST card (CONST UNIV :: 't set)" print_translation \ diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/FSet.thy --- a/src/HOL/Library/FSet.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/FSet.thy Sun Aug 25 21:10:01 2024 +0200 @@ -167,6 +167,9 @@ syntax "_insert_fset" :: "args => 'a fset" ("{|(_)|}") +syntax_consts + "_insert_fset" == finsert + translations "{|x, xs|}" == "CONST finsert x {|xs|}" "{|x|}" == "CONST finsert x {||}" @@ -200,6 +203,10 @@ "_fBall" :: "pttrn \ 'a fset \ bool \ bool" ("(3\(_/|\|_)./ _)" [0, 0, 10] 10) "_fBex" :: "pttrn \ 'a fset \ bool \ bool" ("(3\(_/|\|_)./ _)" [0, 0, 10] 10) +syntax_consts + "_fBall" \ FSet.Ball and + "_fBex" \ FSet.Bex + translations "\x|\|A. P" \ "CONST FSet.Ball A (\x. P)" "\x|\|A. P" \ "CONST FSet.Bex A (\x. P)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/FuncSet.thy --- a/src/HOL/Library/FuncSet.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/FuncSet.thy Sun Aug 25 21:10:01 2024 +0200 @@ -25,6 +25,9 @@ syntax "_Pi" :: "pttrn \ 'a set \ 'b set \ ('a \ 'b) set" ("(3\ _\_./ _)" 10) "_lam" :: "pttrn \ 'a set \ ('a \ 'b) \ ('a \ 'b)" ("(3\_\_./ _)" [0,0,3] 3) +syntax_consts + "_Pi" \ Pi and + "_lam" \ restrict translations "\ x\A. B" \ "CONST Pi A (\x. B)" "\x\A. f" \ "CONST restrict (\x. f) A" @@ -350,6 +353,8 @@ syntax "_PiE" :: "pttrn \ 'a set \ 'b set \ ('a \ 'b) set" ("(3\\<^sub>E _\_./ _)" 10) +syntax_consts + "_PiE" \ Pi\<^sub>E translations "\\<^sub>E x\A. B" \ "CONST Pi\<^sub>E A (\x. B)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Groups_Big_Fun.thy --- a/src/HOL/Library/Groups_Big_Fun.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Groups_Big_Fun.thy Sun Aug 25 21:10:01 2024 +0200 @@ -202,6 +202,8 @@ "_Sum_any" :: "pttrn \ 'a \ 'a::comm_monoid_add" ("(3SUM _. _)" [0, 10] 10) syntax "_Sum_any" :: "pttrn \ 'a \ 'a::comm_monoid_add" ("(3\_. _)" [0, 10] 10) +syntax_consts + "_Sum_any" \ Sum_any translations "\a. b" \ "CONST Sum_any (\a. b)" @@ -255,6 +257,8 @@ "_Prod_any" :: "pttrn \ 'a \ 'a::comm_monoid_mult" ("(3PROD _. _)" [0, 10] 10) syntax "_Prod_any" :: "pttrn \ 'a \ 'a::comm_monoid_mult" ("(3\_. _)" [0, 10] 10) +syntax_consts + "_Prod_any" == Prod_any translations "\a. b" == "CONST Prod_any (\a. b)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Monad_Syntax.thy --- a/src/HOL/Library/Monad_Syntax.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Monad_Syntax.thy Sun Aug 25 21:10:01 2024 +0200 @@ -46,6 +46,11 @@ "_do_bind" :: "[pttrn, 'a] \ do_bind" ("(2_ <-/ _)" 13) "_thenM" :: "['a, 'b] \ 'c" (infixl ">>" 54) +syntax_consts + "_do_block" "_do_cons" \ bind_do and + "_do_bind" "_thenM" \ bind and + "_do_let" \ Let + translations "_do_block (_do_cons (_do_then t) (_do_final e))" \ "CONST bind_do t (\_. e)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Multiset.thy --- a/src/HOL/Library/Multiset.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Multiset.thy Sun Aug 25 21:10:01 2024 +0200 @@ -93,6 +93,8 @@ syntax "_multiset" :: "args \ 'a multiset" ("{#(_)#}") +syntax_consts + "_multiset" == add_mset translations "{#x, xs#}" == "CONST add_mset x {#xs#}" "{#x#}" == "CONST add_mset x {#}" @@ -169,6 +171,10 @@ "_MBall" :: "pttrn \ 'a set \ bool \ bool" ("(3\_:#_./ _)" [0, 0, 10] 10) "_MBex" :: "pttrn \ 'a set \ bool \ bool" ("(3\_:#_./ _)" [0, 0, 10] 10) +syntax_consts + "_MBall" \ Multiset.Ball and + "_MBex" \ Multiset.Bex + translations "\x\#A. P" \ "CONST Multiset.Ball A (\x. P)" "\x\#A. P" \ "CONST Multiset.Bex A (\x. P)" @@ -1248,6 +1254,8 @@ "_MCollect" :: "pttrn \ 'a multiset \ bool \ 'a multiset" ("(1{#_ :# _./ _#})") syntax "_MCollect" :: "pttrn \ 'a multiset \ bool \ 'a multiset" ("(1{#_ \# _./ _#})") +syntax_consts + "_MCollect" == filter_mset translations "{#x \# M. P#}" == "CONST filter_mset (\x. P) M" @@ -1821,6 +1829,8 @@ "_comprehension_mset" :: "'a \ 'b \ 'b multiset \ 'a multiset" ("({#_/. _ :# _#})") syntax "_comprehension_mset" :: "'a \ 'b \ 'b multiset \ 'a multiset" ("({#_/. _ \# _#})") +syntax_consts + "_comprehension_mset" \ image_mset translations "{#e. x \# M#}" \ "CONST image_mset (\x. e) M" @@ -1828,6 +1838,8 @@ "_comprehension_mset'" :: "'a \ 'b \ 'b multiset \ bool \ 'a multiset" ("({#_/ | _ :# _./ _#})") syntax "_comprehension_mset'" :: "'a \ 'b \ 'b multiset \ bool \ 'a multiset" ("({#_/ | _ \# _./ _#})") +syntax_consts + "_comprehension_mset'" \ image_mset translations "{#e | x\#M. P#}" \ "{#e. x \# {# x\#M. P#}#}" @@ -2675,6 +2687,8 @@ "_sum_mset_image" :: "pttrn \ 'b set \ 'a \ 'a::comm_monoid_add" ("(3SUM _:#_. _)" [0, 51, 10] 10) syntax "_sum_mset_image" :: "pttrn \ 'b set \ 'a \ 'a::comm_monoid_add" ("(3\_\#_. _)" [0, 51, 10] 10) +syntax_consts + "_sum_mset_image" \ sum_mset translations "\i \# A. b" \ "CONST sum_mset (CONST image_mset (\i. b) A)" @@ -2854,6 +2868,8 @@ "_prod_mset_image" :: "pttrn \ 'b set \ 'a \ 'a::comm_monoid_mult" ("(3PROD _:#_. _)" [0, 51, 10] 10) syntax "_prod_mset_image" :: "pttrn \ 'b set \ 'a \ 'a::comm_monoid_mult" ("(3\_\#_. _)" [0, 51, 10] 10) +syntax_consts + "_prod_mset_image" \ prod_mset translations "\i \# A. b" \ "CONST prod_mset (CONST image_mset (\i. b) A)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Numeral_Type.thy --- a/src/HOL/Library/Numeral_Type.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Numeral_Type.thy Sun Aug 25 21:10:01 2024 +0200 @@ -540,6 +540,10 @@ "_NumeralType0" :: type ("0") "_NumeralType1" :: type ("1") +syntax_types + "_NumeralType0" == num0 and + "_NumeralType1" == num1 + translations (type) "1" == (type) "num1" (type) "0" == (type) "num0" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Phantom_Type.thy --- a/src/HOL/Library/Phantom_Type.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Phantom_Type.thy Sun Aug 25 21:10:01 2024 +0200 @@ -18,6 +18,7 @@ by(simp_all add: o_def id_def) syntax "_Phantom" :: "type \ logic" ("(1Phantom/(1'(_')))") +syntax_consts "_Phantom" == phantom translations "Phantom('t)" => "CONST phantom :: _ \ ('t, _) phantom" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Library/Type_Length.thy --- a/src/HOL/Library/Type_Length.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Library/Type_Length.thy Sun Aug 25 21:10:01 2024 +0200 @@ -19,6 +19,9 @@ syntax "_type_length" :: "type \ nat" (\(1LENGTH/(1'(_')))\) +syntax_consts + "_type_length" \ len_of + translations "LENGTH('a)" \ "CONST len_of (CONST Pure.type :: 'a itself)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Metis_Examples/Message.thy --- a/src/HOL/Metis_Examples/Message.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Metis_Examples/Message.thy Sun Aug 25 21:10:01 2024 +0200 @@ -50,6 +50,8 @@ text\Concrete syntax: messages appear as \\A,B,NA\\, etc...\ syntax "_MTuple" :: "['a, args] => 'a * 'b" ("(2\_,/ _\)") +syntax_consts + "_MTuple" == MPair translations "\x, y, z\" == "\x, \y, z\\" "\x, y\" == "CONST MPair x y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Probability/Fin_Map.thy --- a/src/HOL/Probability/Fin_Map.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Probability/Fin_Map.thy Sun Aug 25 21:10:01 2024 +0200 @@ -90,6 +90,8 @@ syntax "_Pi'" :: "[pttrn, 'a set, 'b set] => ('a => 'b) set" ("(3\'' _\_./ _)" 10) +syntax_consts + "_Pi'" == Pi' translations "\' x\A. B" == "CONST Pi' A (\x. B)" @@ -635,6 +637,8 @@ syntax "_PiF" :: "pttrn \ 'i set \ 'a measure \ ('i => 'a) measure" ("(3\\<^sub>F _\_./ _)" 10) +syntax_consts + "_PiF" == PiF translations "\\<^sub>F x\I. M" == "CONST PiF I (%x. M)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Probability/Probability_Measure.thy --- a/src/HOL/Probability/Probability_Measure.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Probability/Probability_Measure.thy Sun Aug 25 21:10:01 2024 +0200 @@ -250,6 +250,9 @@ syntax "_prob" :: "pttrn \ logic \ logic \ logic" (\('\

'((/_ in _./ _)'))\) +syntax_consts + "_prob" == measure + translations "\

(x in M. P)" => "CONST measure M {x \ CONST space M. P}" @@ -322,6 +325,9 @@ syntax "_conditional_prob" :: "pttrn \ logic \ logic \ logic \ logic" (\('\

'(_ in _. _ \/ _'))\) +syntax_consts + "_conditional_prob" == cond_prob + translations "\

(x in M. P \ Q)" => "CONST cond_prob M (\x. P) (\x. Q)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Quotient_Examples/Lift_FSet.thy --- a/src/HOL/Quotient_Examples/Lift_FSet.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Quotient_Examples/Lift_FSet.thy Sun Aug 25 21:10:01 2024 +0200 @@ -98,6 +98,9 @@ syntax "_insert_fset" :: "args => 'a fset" ("{|(_)|}") +syntax_consts + "_insert_fset" == fcons + translations "{|x, xs|}" == "CONST fcons x {|xs|}" "{|x|}" == "CONST fcons x {||}" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/Quotient_Examples/Quotient_FSet.thy --- a/src/HOL/Quotient_Examples/Quotient_FSet.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/Quotient_Examples/Quotient_FSet.thy Sun Aug 25 21:10:01 2024 +0200 @@ -291,6 +291,9 @@ syntax "_insert_fset" :: "args => 'a fset" ("{|(_)|}") +syntax_consts + "_insert_fset" == insert_fset + translations "{|x, xs|}" == "CONST insert_fset x {|xs|}" "{|x|}" == "CONST insert_fset x {||}" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/SET_Protocol/Message_SET.thy --- a/src/HOL/SET_Protocol/Message_SET.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/SET_Protocol/Message_SET.thy Sun Aug 25 21:10:01 2024 +0200 @@ -70,6 +70,8 @@ (*Concrete syntax: messages appear as \\A,B,NA\\, etc...*) syntax "_MTuple" :: "['a, args] \ 'a * 'b" ("(2\_,/ _\)") +syntax_consts + "_MTuple" == MPair translations "\x, y, z\" == "\x, \y, z\\" "\x, y\" == "CONST MPair x y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/SPARK/SPARK_Setup.thy --- a/src/HOL/SPARK/SPARK_Setup.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/SPARK/SPARK_Setup.thy Sun Aug 25 21:10:01 2024 +0200 @@ -57,6 +57,9 @@ syntax "_updsbind" :: "['a, 'a] => updbind" ("(2_ [:=]/ _)") +syntax_consts + "_updsbind" == fun_upds + translations "f(xs[:=]y)" == "CONST fun_upds f xs y" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/UNITY/PPROD.thy --- a/src/HOL/UNITY/PPROD.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/UNITY/PPROD.thy Sun Aug 25 21:10:01 2024 +0200 @@ -16,6 +16,8 @@ syntax "_PLam" :: "[pttrn, nat set, 'b set] => (nat => 'b) set" ("(3plam _:_./ _)" 10) +syntax_consts + "_PLam" == PLam translations "plam x : A. B" == "CONST PLam A (%x. B)" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/UNITY/Union.thy --- a/src/HOL/UNITY/Union.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/UNITY/Union.thy Sun Aug 25 21:10:01 2024 +0200 @@ -41,6 +41,8 @@ syntax "_JOIN1" :: "[pttrns, 'b set] => 'b set" ("(3\_./ _)" 10) "_JOIN" :: "[pttrn, 'a set, 'b set] => 'b set" ("(3\_\_./ _)" 10) +syntax_consts + "_JOIN1" "_JOIN" == JOIN translations "\x \ A. B" == "CONST JOIN A (\x. B)" "\x y. B" == "\x. \y. B" diff -r 079fe4292526 -r c7723cc15de8 src/HOL/ex/Code_Lazy_Demo.thy --- a/src/HOL/ex/Code_Lazy_Demo.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/HOL/ex/Code_Lazy_Demo.thy Sun Aug 25 21:10:01 2024 +0200 @@ -40,6 +40,7 @@ | LCons (lhd: 'a) (ltl: "'a llist") (infixr "###" 65) syntax "_llist" :: "args => 'a list" ("\<^bold>\(_)\<^bold>\") +syntax_consts "_llist" == LCons translations "\<^bold>\x, xs\<^bold>\" == "x###\<^bold>\xs\<^bold>\" "\<^bold>\x\<^bold>\" == "x###\<^bold>\\<^bold>\" diff -r 079fe4292526 -r c7723cc15de8 src/Pure/Examples/Higher_Order_Logic.thy --- a/src/Pure/Examples/Higher_Order_Logic.thy Sun Aug 25 20:54:20 2024 +0200 +++ b/src/Pure/Examples/Higher_Order_Logic.thy Sun Aug 25 21:10:01 2024 +0200 @@ -402,6 +402,7 @@ where someI: "P x \ P (Eps P)" syntax "_Eps" :: "pttrn \ o \ 'a" ("(3SOME _./ _)" [0, 10] 10) +syntax_consts "_Eps" \ Eps translations "SOME x. P" \ "CONST Eps (\x. P)" text \