diff -r 46f59511b7bb -r d97fdabd9e2b src/HOL/Corec_Examples/Paper_Examples.thy --- a/src/HOL/Corec_Examples/Paper_Examples.thy Fri Sep 20 19:07:10 2024 +0200 +++ b/src/HOL/Corec_Examples/Paper_Examples.thy Fri Sep 20 19:51:08 2024 +0200 @@ -14,7 +14,7 @@ section \Examples from the introduction\ -codatatype 'a stream = SCons (shd: 'a) (stl: "'a stream") (infixr "\" 65) +codatatype 'a stream = SCons (shd: 'a) (stl: "'a stream") (infixr \\\ 65) corec "natsFrom" :: "nat \ nat stream" where "natsFrom n = n \ natsFrom (n + 1)" @@ -29,7 +29,7 @@ text \We curry the example functions in this section because infix syntax works only for curried functions.\ -corec (friend) Plus :: "nat stream \ nat stream \ nat stream" (infix "\" 67) where +corec (friend) Plus :: "nat stream \ nat stream \ nat stream" (infix \\\ 67) where "x\<^sub>1 \ x\<^sub>2 = (shd x\<^sub>1 + shd x\<^sub>2) \ (stl x\<^sub>1 \ stl x\<^sub>2)" section \Examples from section 4\ @@ -43,7 +43,7 @@ datatype 'a nelist = NEList (hd:'a) (tl:"'a list") -primrec (transfer) snoc :: "'a list \ 'a \ 'a nelist" (infix "\" 64) where +primrec (transfer) snoc :: "'a list \ 'a \ 'a nelist" (infix \\\ 64) where "[] \ a = NEList a []" |"(b # bs) \ a = NEList b (bs @ [a])" @@ -68,7 +68,7 @@ corec fibB :: "nat stream" where "fibB = (0 \ 1 \ fibB) \ (0 \ fibB)" -corec (friend) times :: "nat stream \ nat stream \ nat stream" (infix "\" 69) +corec (friend) times :: "nat stream \ nat stream \ nat stream" (infix \\\ 69) where "xs \ ys = (shd xs * shd ys) \ xs \ stl ys \ stl xs \ ys" corec (friend) exp :: "nat stream \ nat stream" @@ -106,7 +106,7 @@ corec catalan :: "nat \ nat stream" where "catalan n = (if n > 0 then catalan (n - 1) \ (0 \ catalan (n + 1)) else 1 \ catalan 1)" -corec (friend) heart :: "nat stream \ nat stream \ nat stream" (infix "\" 65) +corec (friend) heart :: "nat stream \ nat stream \ nat stream" (infix \\\ 65) where "xs \ ys = SCons (shd xs * shd ys) ((((xs \ stl ys) \ (stl xs \ ys)) \ ys) \ ys)" corec (friend) g :: "'a stream \ 'a stream"