diff -r f6e595e4f608 -r 261cd8722677 src/HOL/List.thy --- a/src/HOL/List.thy Mon Sep 23 12:59:10 2024 +0200 +++ b/src/HOL/List.thy Mon Sep 23 13:32:38 2024 +0200 @@ -9,8 +9,8 @@ begin datatype (set: 'a) list = - Nil ("[]") - | Cons (hd: 'a) (tl: "'a list") (infixr "#" 65) + Nil (\[]\) + | Cons (hd: 'a) (tl: "'a list") (infixr \#\ 65) for map: map rel: list_all2 @@ -47,9 +47,9 @@ nonterminal list_args syntax - "" :: "'a \ list_args" ("_") - "_list_args" :: "'a \ list_args \ list_args" ("_,/ _") - "_list" :: "list_args => 'a list" ("[(_)]") + "" :: "'a \ list_args" (\_\) + "_list_args" :: "'a \ list_args \ list_args" (\_,/ _\) + "_list" :: "list_args => 'a list" (\[(_)]\) syntax_consts "_list_args" "_list" == Cons translations @@ -72,7 +72,7 @@ definition coset :: "'a list \ 'a set" where [simp]: "coset xs = - set xs" -primrec append :: "'a list \ 'a list \ 'a list" (infixr "@" 65) where +primrec append :: "'a list \ 'a list \ 'a list" (infixr \@\ 65) where append_Nil: "[] @ ys = ys" | append_Cons: "(x#xs) @ ys = x # xs @ ys" @@ -86,9 +86,9 @@ text \Special input syntax for filter:\ syntax (ASCII) - "_filter" :: "[pttrn, 'a list, bool] => 'a list" ("(1[_<-_./ _])") + "_filter" :: "[pttrn, 'a list, bool] => 'a list" (\(1[_<-_./ _])\) syntax - "_filter" :: "[pttrn, 'a list, bool] => 'a list" ("(1[_\_ ./ _])") + "_filter" :: "[pttrn, 'a list, bool] => 'a list" (\(1[_\_ ./ _])\) syntax_consts "_filter" \ filter translations @@ -122,7 +122,7 @@ \ \Warning: simpset does not contain this definition, but separate theorems for \n = 0\ and \n = Suc k\\ -primrec (nonexhaustive) nth :: "'a list => nat => 'a" (infixl "!" 100) where +primrec (nonexhaustive) nth :: "'a list => nat => 'a" (infixl \!\ 100) where nth_Cons: "(x # xs) ! n = (case n of 0 \ x | Suc k \ xs ! k)" \ \Warning: simpset does not contain this definition, but separate theorems for \n = 0\ and \n = Suc k\\ @@ -135,10 +135,10 @@ nonterminal lupdbinds and lupdbind syntax - "_lupdbind":: "['a, 'a] => lupdbind" ("(2_ :=/ _)") - "" :: "lupdbind => lupdbinds" ("_") - "_lupdbinds" :: "[lupdbind, lupdbinds] => lupdbinds" ("_,/ _") - "_LUpdate" :: "['a, lupdbinds] => 'a" ("_/[(_)]" [1000,0] 900) + "_lupdbind":: "['a, 'a] => lupdbind" (\(2_ :=/ _)\) + "" :: "lupdbind => lupdbinds" (\_\) + "_lupdbinds" :: "[lupdbind, lupdbinds] => lupdbinds" (\_,/ _\) + "_LUpdate" :: "['a, lupdbinds] => 'a" (\_/[(_)]\ [1000,0] 900) syntax_consts "_lupdbind" "_lupdbinds" "_LUpdate" == list_update @@ -175,7 +175,7 @@ "product_lists [] = [[]]" | "product_lists (xs # xss) = concat (map (\x. map (Cons x) (product_lists xss)) xs)" -primrec upt :: "nat \ nat \ nat list" ("(1[_.. nat \ nat list" (\(1[_..) where upt_0: "[i..<0] = []" | upt_Suc: "[i..<(Suc j)] = (if i \ j then [i.. lc_qual \ lc_quals \ 'a list" ("[_ . __") - "_lc_gen" :: "'a \ 'a list \ lc_qual" ("_ \ _") - "_lc_test" :: "bool \ lc_qual" ("_") + "_listcompr" :: "'a \ lc_qual \ lc_quals \ 'a list" (\[_ . __\) + "_lc_gen" :: "'a \ 'a list \ lc_qual" (\_ \ _\) + "_lc_test" :: "bool \ lc_qual" (\_\) (*"_lc_let" :: "letbinds => lc_qual" ("let _")*) - "_lc_end" :: "lc_quals" ("]") - "_lc_quals" :: "lc_qual \ lc_quals \ lc_quals" (", __") + "_lc_end" :: "lc_quals" (\]\) + "_lc_quals" :: "lc_qual \ lc_quals \ lc_quals" (\, __\) syntax (ASCII) - "_lc_gen" :: "'a \ 'a list \ lc_qual" ("_ <- _") + "_lc_gen" :: "'a \ 'a list \ lc_qual" (\_ <- _\) parse_translation \ let @@ -2811,7 +2811,7 @@ lemma semilattice_map2: "semilattice (map2 (\<^bold>*))" if "semilattice (\<^bold>*)" - for f (infixl "\<^bold>*" 70) + for f (infixl \\<^bold>*\ 70) proof - from that interpret semilattice f . show ?thesis @@ -3432,7 +3432,7 @@ subsubsection \\upto\: interval-list on \<^typ>\int\\ -function upto :: "int \ int \ int list" ("(1[_../_])") where +function upto :: "int \ int \ int list" (\(1[_../_])\) where "upto i j = (if i \ j then i # [i+1..j] else [])" by auto termination @@ -6219,7 +6219,7 @@ where "sorted_key_list_of_set f \ folding_on.F (insort_key f) []" locale folding_insort_key = lo?: linorder "less_eq :: 'a \ 'a \ bool" less - for less_eq (infix "\" 50) and less (infix "\" 50) + + for less_eq (infix \\\ 50) and less (infix \\\ 50) + fixes S fixes f :: "'b \ 'a" assumes inj_on: "inj_on f S"