# HG changeset patch # User blanchet # Date 1459159547 -7200 # Node ID 5b2a7caa855b6c0354235619ce897653d2122b34 # Parent 5ab1746186c77be5ceaa9c9bfe16c2c123084e7a tuned examples diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/LFilter.thy --- a/src/HOL/Corec_Examples/LFilter.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/LFilter.thy Mon Mar 28 12:05:47 2016 +0200 @@ -7,7 +7,7 @@ The filter function on lazy lists. *) -section {* The Filter Function on Lazy Lists *} +section \The Filter Function on Lazy Lists\ theory LFilter imports "~~/src/HOL/Library/BNF_Corec" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Stream_Processor.thy --- a/src/HOL/Corec_Examples/Stream_Processor.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Stream_Processor.thy Mon Mar 28 12:05:47 2016 +0200 @@ -7,7 +7,7 @@ Stream processors---a syntactic representation of continuous functions on streams. *) -section {* Stream Processors---A Syntactic Representation of Continuous Functions on Streams *} +section \Stream Processors---A Syntactic Representation of Continuous Functions on Streams\ theory Stream_Processor imports "~~/src/HOL/Library/BNF_Corec" "~~/src/HOL/Library/Stream" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/GPV_Bare_Bones.thy --- a/src/HOL/Corec_Examples/Tests/GPV_Bare_Bones.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/GPV_Bare_Bones.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ A bare bones version of generative probabilistic values (GPVs). *) -section {* A Bare Bones Version of Generative Probabilistic Values (GPVs) *} +section \A Bare Bones Version of Generative Probabilistic Values (GPVs)\ theory GPV_Bare_Bones imports "~~/src/HOL/Library/BNF_Corec" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Merge_A.thy --- a/src/HOL/Corec_Examples/Tests/Merge_A.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Merge_A.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Tests theory merges. *) -section {* Tests Theory Merges *} +section \Tests Theory Merges\ theory Merge_A imports "~~/src/HOL/Library/BNF_Corec" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Merge_B.thy --- a/src/HOL/Corec_Examples/Tests/Merge_B.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Merge_B.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Tests theory merges. *) -section {* Tests Theory Merges *} +section \Tests Theory Merges\ theory Merge_B imports Merge_A diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Merge_C.thy --- a/src/HOL/Corec_Examples/Tests/Merge_C.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Merge_C.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Tests theory merges. *) -section {* Tests Theory Merges *} +section \Tests Theory Merges\ theory Merge_C imports Merge_A diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Merge_D.thy --- a/src/HOL/Corec_Examples/Tests/Merge_D.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Merge_D.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Tests theory merges. *) -section {* Tests Theory Merges *} +section \Tests Theory Merges\ theory Merge_D imports Merge_B Merge_C diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Merge_Poly.thy --- a/src/HOL/Corec_Examples/Tests/Merge_Poly.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Merge_Poly.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,13 +6,13 @@ Tests polymorphic merges. *) -section {* Tests Polymorphic Merges *} +section \Tests Polymorphic Merges\ theory Merge_Poly imports "~~/src/HOL/Library/BNF_Corec" begin -subsection {* A Monomorphic Example *} +subsection \A Monomorphic Example\ codatatype r = R (rhd: nat) (rtl: r) @@ -46,7 +46,7 @@ "id_rx r = f1 (f2 (f3 (R (rhd r) (id_rx (rtl r)))))" -subsection {* The Polymorphic Version *} +subsection \The Polymorphic Version\ codatatype 'a s = S (shd: 'a) (stl: "'a s") diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Misc_Mono.thy --- a/src/HOL/Corec_Examples/Tests/Misc_Mono.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Misc_Mono.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Miscellaneous monomorphic examples. *) -section {* Miscellaneous Monomorphic Examples *} +section \Miscellaneous Monomorphic Examples\ theory Misc_Mono imports "~~/src/HOL/Library/BNF_Corec" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Misc_Poly.thy --- a/src/HOL/Corec_Examples/Tests/Misc_Poly.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Misc_Poly.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,7 +6,7 @@ Miscellaneous polymorphic examples. *) -section {* Miscellaneous Polymorphic Examples *} +section \Miscellaneous Polymorphic Examples\ theory Misc_Poly imports "~~/src/HOL/Library/BNF_Corec" diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Simple_Nesting.thy --- a/src/HOL/Corec_Examples/Tests/Simple_Nesting.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Simple_Nesting.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,13 +6,13 @@ Tests "corec"'s parsing of map functions. *) -section {* Tests "corec"'s Parsing of Map Functions *} +section \Tests "corec"'s Parsing of Map Functions\ theory Simple_Nesting imports "~~/src/HOL/Library/BNF_Corec" begin -subsection {* Corecursion via Map Functions *} +subsection \Corecursion via Map Functions\ consts g :: 'a @@ -59,7 +59,7 @@ (map Inl (h x)))" -subsection {* Constructors instead of Maps *} +subsection \Constructors instead of Maps\ codatatype 'a y = Y 'a "'a y list" @@ -78,7 +78,7 @@ "gg a = X a (Some (gg a))" -subsection {* Some Friends *} +subsection \Some Friends\ codatatype u = U (lab: nat) (sub: "u list") diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/Small_Concrete.thy --- a/src/HOL/Corec_Examples/Tests/Small_Concrete.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/Small_Concrete.thy Mon Mar 28 12:05:47 2016 +0200 @@ -6,13 +6,13 @@ Small concrete examples. *) -section {* Small Concrete Examples *} +section \Small Concrete Examples\ theory Small_Concrete imports "~~/src/HOL/Library/BNF_Corec" begin -subsection {* Streams of Natural Numbers *} +subsection \Streams of Natural Numbers\ codatatype natstream = S (head: nat) (tail: natstream) @@ -130,7 +130,7 @@ done -subsection {* Lazy Lists of Natural Numbers *} +subsection \Lazy Lists of Natural Numbers\ codatatype llist = LNil | LCons nat llist @@ -150,7 +150,7 @@ "fold_map f a s = (let v = f a (head s) in S v (fold_map f v (tail s)))" -subsection {* Coinductie Natural Numbers *} +subsection \Coinductie Natural Numbers\ codatatype conat = CoZero | CoSuc conat diff -r 5ab1746186c7 -r 5b2a7caa855b src/HOL/Corec_Examples/Tests/TLList_Friends.thy --- a/src/HOL/Corec_Examples/Tests/TLList_Friends.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/HOL/Corec_Examples/Tests/TLList_Friends.thy Mon Mar 28 12:05:47 2016 +0200 @@ -3,10 +3,10 @@ Author: Jasmin Blanchette, Inria, LORIA, MPII Copyright 2015, 2016 -Terminated lists examples +Friendly functions on terminated lists. *) -section {* Small Concrete Examples *} +section \Friendly Functions on Terminated Lists\ theory TLList_Friends imports "~~/src/HOL/Library/BNF_Corec" @@ -43,7 +43,7 @@ corec prd2 :: "(nat, 'b) tllist \ (nat, 'b) tllist \ (nat, 'b) tllist" where "prd2 xs ys = TLCons (tlhd xs * tlhd ys) (pls (prd xs (tltl ys)) (prd2 (tltl xs) ys))" -text {* Outer if: *} +text \Outer if:\ corec takeUntilOdd :: "(int, int) tllist \ (int, int) tllist" where "takeUntilOdd xs = @@ -75,7 +75,7 @@ else TLNil y)" sorry -text {* If inside the constructor: *} +text \If inside the constructor:\ corec prd3 :: "(nat, 'b) tllist \ (nat, 'b) tllist \ (nat, 'b) tllist" where "prd3 xs ys = TLCons (tlhd xs * tlhd ys) @@ -88,7 +88,7 @@ else prd3 (tltl xs) (tltl ys))" sorry -text {* If inside the inner friendly operation: *} +text \If inside the inner friendly operation:\ corec prd4 :: "(nat, 'b) tllist \ (nat, 'b) tllist \ (nat, 'b) tllist" where "prd4 xs ys = TLCons (tlhd xs * tlhd ys) @@ -99,7 +99,7 @@ (pls (if undefined then prd xs (tltl ys) else xs) (prd (tltl xs) ys))" sorry -text {* Lots of if's: *} +text \Lots of if's:\ corec iffy :: "(nat, 'b) tllist \ (nat, 'b) tllist" where "iffy xs =