diff -r 46f59511b7bb -r d97fdabd9e2b src/HOL/ex/Code_Lazy_Demo.thy --- a/src/HOL/ex/Code_Lazy_Demo.thy Fri Sep 20 19:07:10 2024 +0200 +++ b/src/HOL/ex/Code_Lazy_Demo.thy Fri Sep 20 19:51:08 2024 +0200 @@ -13,7 +13,7 @@ text \Lazy evaluation for streams\ codatatype 'a stream = - SCons (shd: 'a) (stl: "'a stream") (infixr "##" 65) + SCons (shd: 'a) (stl: "'a stream") (infixr \##\ 65) primcorec up :: "nat \ nat stream" where "up n = n ## up (n + 1)" @@ -36,14 +36,14 @@ text \Lazy types need not be infinite. We can also have lazy types that are finite.\ datatype 'a llist - = LNil ("\<^bold>\\<^bold>\") - | LCons (lhd: 'a) (ltl: "'a llist") (infixr "###" 65) + = LNil (\\<^bold>\\<^bold>\\) + | LCons (lhd: 'a) (ltl: "'a llist") (infixr \###\ 65) nonterminal llist_args syntax - "" :: "'a \ llist_args" ("_") - "_llist_args" :: "'a \ llist_args \ llist_args" ("_,/ _") - "_llist" :: "llist_args => 'a list" ("\<^bold>\(_)\<^bold>\") + "" :: "'a \ llist_args" (\_\) + "_llist_args" :: "'a \ llist_args \ llist_args" (\_,/ _\) + "_llist" :: "llist_args => 'a list" (\\<^bold>\(_)\<^bold>\\) syntax_consts "_llist_args" "_llist" == LCons translations @@ -81,7 +81,7 @@ A conversion function to lazy lists is enough.\ primrec lappend :: "'a llist \ 'a llist \ 'a llist" - (infixr "@@" 65) where + (infixr \@@\ 65) where "\<^bold>\\<^bold>\ @@ ys = ys" | "(x ### xs) @@ ys = x ### (xs @@ ys)" @@ -113,10 +113,10 @@ section \Branching datatypes\ datatype tree - = L ("\") - | Node tree tree (infix "\" 900) + = L (\\\) + | Node tree tree (infix \\\ 900) -notation (output) Node ("\(//\<^bold>l: _//\<^bold>r: _)") +notation (output) Node (\\(//\<^bold>l: _//\<^bold>r: _)\) code_lazy_type tree