# HG changeset patch # User blanchet # Date 1459159547 -7200 # Node ID b751a43c500159e83fc800e93cfa5c88721db969 # Parent 8745b8079b97fa06478b18b0cc4c08871115469e tuning diff -r 8745b8079b97 -r b751a43c5001 CONTRIBUTORS --- a/CONTRIBUTORS Mon Mar 28 12:05:47 2016 +0200 +++ b/CONTRIBUTORS Mon Mar 28 12:05:47 2016 +0200 @@ -21,8 +21,8 @@ ----------------------------- * Winter 2016: Jasmin Blanchette, Inria & LORIA & MPII, Aymeric Bouzy, - Ecole polytechnique, Andreas Lochbihler, ETH Zurich, and Dmitriy Traytel, - ETH Zurich + Ecole polytechnique, Andreas Lochbihler, ETH Zurich, Andrei Popescu, + Middlesex University, and Dmitriy Traytel, ETH Zurich 'corec' command and friends. * Winter 2016: Manuel Eberl, TUM diff -r 8745b8079b97 -r b751a43c5001 src/Doc/Datatypes/Datatypes.thy --- a/src/Doc/Datatypes/Datatypes.thy Mon Mar 28 12:05:47 2016 +0200 +++ b/src/Doc/Datatypes/Datatypes.thy Mon Mar 28 12:05:47 2016 +0200 @@ -19,8 +19,8 @@ "~~/src/HOL/Library/Simps_Case_Conv" begin -section \ Introduction - \label{sec:introduction} \ +section \Introduction + \label{sec:introduction}\ text \ The 2013 edition of Isabelle introduced a definitional package for freely @@ -147,16 +147,16 @@ \ -section \ Defining Datatypes - \label{sec:defining-datatypes} \ +section \Defining Datatypes + \label{sec:defining-datatypes}\ text \ Datatypes can be specified using the @{command datatype} command. \ -subsection \ Introductory Examples - \label{ssec:datatype-introductory-examples} \ +subsection \Introductory Examples + \label{ssec:datatype-introductory-examples}\ text \ Datatypes are illustrated through concrete examples featuring different flavors @@ -165,8 +165,8 @@ \ -subsubsection \ Nonrecursive Types - \label{sssec:datatype-nonrecursive-types} \ +subsubsection \Nonrecursive Types + \label{sssec:datatype-nonrecursive-types}\ text \ Datatypes are introduced by specifying the desired names and argument types for @@ -217,8 +217,8 @@ \ -subsubsection \ Simple Recursion - \label{sssec:datatype-simple-recursion} \ +subsubsection \Simple Recursion + \label{sssec:datatype-simple-recursion}\ text \ Natural numbers are the simplest example of a recursive type: @@ -235,8 +235,8 @@ datatype (*<*)(in early) (*>*)('a, 'b) tlist = TNil 'b | TCons 'a "('a, 'b) tlist" -subsubsection \ Mutual Recursion - \label{sssec:datatype-mutual-recursion} \ +subsubsection \Mutual Recursion + \label{sssec:datatype-mutual-recursion}\ text \ \emph{Mutually recursive} types are introduced simultaneously and may refer to @@ -261,8 +261,8 @@ Const 'a | Var 'b | Expr "('a, 'b) exp" -subsubsection \ Nested Recursion - \label{sssec:datatype-nested-recursion} \ +subsubsection \Nested Recursion + \label{sssec:datatype-nested-recursion}\ text \ \emph{Nested recursion} occurs when recursive occurrences of a type appear under @@ -336,8 +336,8 @@ \ -subsubsection \ Auxiliary Constants - \label{sssec:datatype-auxiliary-constants} \ +subsubsection \Auxiliary Constants + \label{sssec:datatype-auxiliary-constants}\ text \ The @{command datatype} command introduces various constants in addition to @@ -432,7 +432,7 @@ (*>*) datatype ('a, 'b) prod (infixr "*" 20) = Pair 'a 'b -text \ \blankline \ +text \\blankline\ datatype (set: 'a) list = null: Nil ("[]") @@ -449,18 +449,18 @@ syntax "_list" :: "args \ 'a list" ("[(_)]") -text \ \blankline \ +text \\blankline\ translations "[x, xs]" == "x # [xs]" "[x]" == "x # []" -subsection \ Command Syntax - \label{ssec:datatype-command-syntax} \ - -subsubsection \ \keyw{datatype} - \label{sssec:datatype-new} \ +subsection \Command Syntax + \label{ssec:datatype-command-syntax}\ + +subsubsection \\keyw{datatype} + \label{sssec:datatype-new}\ text \ \begin{matharray}{rcl} @@ -570,8 +570,8 @@ \ -subsubsection \ \keyw{datatype_compat} - \label{sssec:datatype-compat} \ +subsubsection \\keyw{datatype_compat} + \label{sssec:datatype-compat}\ text \ \begin{matharray}{rcl} @@ -591,9 +591,9 @@ datatype_compat even_nat odd_nat -text \ \blankline \ - - ML \ Old_Datatype_Data.get_info @{theory} @{type_name even_nat} \ +text \\blankline\ + + ML \Old_Datatype_Data.get_info @{theory} @{type_name even_nat}\ text \ The syntactic entity \synt{name} denotes an identifier @{cite "isabelle-isar-ref"}. @@ -620,8 +620,8 @@ \ -subsection \ Generated Constants - \label{ssec:datatype-generated-constants} \ +subsection \Generated Constants + \label{ssec:datatype-generated-constants}\ text \ Given a datatype @{text "('a\<^sub>1, \, 'a\<^sub>m) t"} with $m$ live type variables @@ -663,8 +663,8 @@ \ -subsection \ Generated Theorems - \label{ssec:datatype-generated-theorems} \ +subsection \Generated Theorems + \label{ssec:datatype-generated-theorems}\ text \ The characteristic theorems generated by @{command datatype} are grouped in @@ -706,8 +706,8 @@ \ -subsubsection \ Free Constructor Theorems - \label{sssec:free-constructor-theorems} \ +subsubsection \Free Constructor Theorems + \label{sssec:free-constructor-theorems}\ (*<*) consts nonnull :: 'a @@ -850,8 +850,8 @@ \ -subsubsection \ Functorial Theorems - \label{sssec:functorial-theorems} \ +subsubsection \Functorial Theorems + \label{sssec:functorial-theorems}\ text \ The functorial theorems are generated for type constructors with at least @@ -1082,8 +1082,8 @@ \ -subsubsection \ Inductive Theorems - \label{sssec:inductive-theorems} \ +subsubsection \Inductive Theorems + \label{sssec:inductive-theorems}\ text \ The inductive theorems are as follows: @@ -1135,11 +1135,11 @@ \ -subsection \ Proof Method - \label{ssec:datatype-proof-method} \ - -subsubsection \ \textit{countable_datatype} - \label{sssec:datatype-compat} \ +subsection \Proof Method + \label{ssec:datatype-proof-method}\ + +subsubsection \\textit{countable_datatype} + \label{sssec:datatype-compat}\ text \ The theory @{file "~~/src/HOL/Library/Countable.thy"} provides a @@ -1152,8 +1152,8 @@ by countable_datatype -subsection \ Compatibility Issues - \label{ssec:datatype-compatibility-issues} \ +subsection \Compatibility Issues + \label{ssec:datatype-compatibility-issues}\ text \ The command @{command datatype} has been designed to be highly compatible with @@ -1233,8 +1233,8 @@ \ -section \ Defining Primitively Recursive Functions - \label{sec:defining-primitively-recursive-functions} \ +section \Defining Primitively Recursive Functions + \label{sec:defining-primitively-recursive-functions}\ text \ Recursive functions over datatypes can be specified using the @{command primrec} @@ -1245,8 +1245,8 @@ \ -subsection \ Introductory Examples - \label{ssec:primrec-introductory-examples} \ +subsection \Introductory Examples + \label{ssec:primrec-introductory-examples}\ text \ Primitive recursion is illustrated through concrete examples based on the @@ -1255,8 +1255,8 @@ \ -subsubsection \ Nonrecursive Types - \label{sssec:primrec-nonrecursive-types} \ +subsubsection \Nonrecursive Types + \label{sssec:primrec-nonrecursive-types}\ text \ Primitive recursion removes one layer of constructors on the left-hand side in @@ -1267,19 +1267,19 @@ "bool_of_trool Faalse \ False" | "bool_of_trool Truue \ True" -text \ \blankline \ +text \\blankline\ primrec the_list :: "'a option \ 'a list" where "the_list None = []" | "the_list (Some a) = [a]" -text \ \blankline \ +text \\blankline\ primrec the_default :: "'a \ 'a option \ 'a" where "the_default d None = d" | "the_default _ (Some a) = a" -text \ \blankline \ +text \\blankline\ primrec mirrror :: "('a, 'b, 'c) triple \ ('c, 'b, 'a) triple" where "mirrror (Triple a b c) = Triple c b a" @@ -1293,8 +1293,8 @@ \ -subsubsection \ Simple Recursion - \label{sssec:primrec-simple-recursion} \ +subsubsection \Simple Recursion + \label{sssec:primrec-simple-recursion}\ text \ For simple recursive types, recursive calls on a constructor argument are @@ -1305,7 +1305,7 @@ "replicate Zero _ = []" | "replicate (Succ n) x = x # replicate n x" -text \ \blankline \ +text \\blankline\ primrec (nonexhaustive) at :: "'a list \ nat \ 'a" where "at (x # xs) j = @@ -1313,7 +1313,7 @@ Zero \ x | Succ j' \ at xs j')" -text \ \blankline \ +text \\blankline\ primrec (*<*)(in early) (transfer) (*>*)tfold :: "('a \ 'b \ 'b) \ ('a, 'b) tlist \ 'b" where "tfold _ (TNil y) = y" @@ -1344,8 +1344,8 @@ | "at_least_two _ \ False" -subsubsection \ Mutual Recursion - \label{sssec:primrec-mutual-recursion} \ +subsubsection \Mutual Recursion + \label{sssec:primrec-mutual-recursion}\ text \ The syntax for mutually recursive functions over mutually recursive datatypes @@ -1360,7 +1360,7 @@ | "nat_of_even_nat (Even_Succ n) = Succ (nat_of_odd_nat n)" | "nat_of_odd_nat (Odd_Succ n) = Succ (nat_of_even_nat n)" -text \ \blankline \ +text \\blankline\ primrec eval\<^sub>e :: "('a \ int) \ ('b \ int) \ ('a, 'b) exp \ int" and @@ -1390,8 +1390,8 @@ | "odd (Succ n) = even n" -subsubsection \ Nested Recursion - \label{sssec:primrec-nested-recursion} \ +subsubsection \Nested Recursion + \label{sssec:primrec-nested-recursion}\ text \ In a departure from the old datatype package, nested recursion is normally @@ -1442,7 +1442,7 @@ "relabel_ft f (FTLeaf x) = FTLeaf (f x)" | "relabel_ft f (FTNode g) = FTNode (\x. relabel_ft f (g x))" -text \ \blankline \ +text \\blankline\ primrec (nonexhaustive) subtree_ft :: "'a \ 'a ftree \ 'a ftree" where "subtree_ft x (FTNode g) = g x" @@ -1456,19 +1456,19 @@ datatype 'a ftree2 = FTLeaf2 'a | FTNode2 "'a \ 'a \ 'a ftree2" -text \ \blankline \ +text \\blankline\ primrec (*<*)(in early) (*>*)relabel_ft2 :: "('a \ 'a) \ 'a ftree2 \ 'a ftree2" where "relabel_ft2 f (FTLeaf2 x) = FTLeaf2 (f x)" | "relabel_ft2 f (FTNode2 g) = FTNode2 (op \ (op \ (relabel_ft2 f)) g)" -text \ \blankline \ +text \\blankline\ primrec relabel_ft2 :: "('a \ 'a) \ 'a ftree2 \ 'a ftree2" where "relabel_ft2 f (FTLeaf2 x) = FTLeaf2 (f x)" | "relabel_ft2 f (FTNode2 g) = FTNode2 (\x y. relabel_ft2 f (g x y))" -text \ \blankline \ +text \\blankline\ primrec (nonexhaustive) subtree_ft2 :: "'a \ 'a \ 'a ftree2 \ 'a ftree2" where "subtree_ft2 x y (FTNode2 g) = g x y" @@ -1483,8 +1483,8 @@ n \ m \ list_all (increasing_tree (n + 1)) ts" -subsubsection \ Nested-as-Mutual Recursion - \label{sssec:primrec-nested-as-mutual-recursion} \ +subsubsection \Nested-as-Mutual Recursion + \label{sssec:primrec-nested-as-mutual-recursion}\ (*<*) locale n2m @@ -1565,11 +1565,11 @@ (*>*) -subsection \ Command Syntax - \label{ssec:primrec-command-syntax} \ - -subsubsection \ \keyw{primrec} - \label{sssec:primrec-new} \ +subsection \Command Syntax + \label{ssec:primrec-command-syntax}\ + +subsubsection \\keyw{primrec} + \label{sssec:primrec-new}\ text \ \begin{matharray}{rcl} @@ -1622,8 +1622,8 @@ \ -subsection \ Generated Theorems - \label{ssec:primrec-generated-theorems} \ +subsection \Generated Theorems + \label{ssec:primrec-generated-theorems}\ (*<*) context early @@ -1668,8 +1668,8 @@ (*>*) -subsection \ Recursive Default Values for Selectors - \label{ssec:primrec-recursive-default-values-for-selectors} \ +subsection \Recursive Default Values for Selectors + \label{ssec:primrec-recursive-default-values-for-selectors}\ text \ A datatype selector @{text un_D} can have a default value for each constructor @@ -1712,7 +1712,7 @@ (*>*) consts termi\<^sub>0 :: 'a -text \ \blankline \ +text \\blankline\ datatype ('a, 'b) tlist = TNil (termi: 'b) @@ -1721,7 +1721,7 @@ "ttl (TNil y) = TNil y" | "termi (TCons _ xs) = termi\<^sub>0 xs" -text \ \blankline \ +text \\blankline\ overloading termi\<^sub>0 \ "termi\<^sub>0 :: ('a, 'b) tlist \ 'b" @@ -1731,14 +1731,14 @@ | "termi\<^sub>0 (TCons x xs) = termi\<^sub>0 xs" end -text \ \blankline \ +text \\blankline\ lemma termi_TCons[simp]: "termi (TCons x xs) = termi xs" by (cases xs) auto -subsection \ Compatibility Issues - \label{ssec:primrec-compatibility-issues} \ +subsection \Compatibility Issues + \label{ssec:primrec-compatibility-issues}\ text \ The command @{command primrec}'s behavior on new-style datatypes has been @@ -1757,8 +1757,8 @@ \ -section \ Defining Codatatypes - \label{sec:defining-codatatypes} \ +section \Defining Codatatypes + \label{sec:defining-codatatypes}\ text \ Codatatypes can be specified using the @{command codatatype} command. The @@ -1770,11 +1770,11 @@ \ -subsection \ Introductory Examples - \label{ssec:codatatype-introductory-examples} \ - -subsubsection \ Simple Corecursion - \label{sssec:codatatype-simple-corecursion} \ +subsection \Introductory Examples + \label{ssec:codatatype-introductory-examples}\ + +subsubsection \Simple Corecursion + \label{sssec:codatatype-simple-corecursion}\ text \ Non-corecursive codatatypes coincide with the corresponding datatypes, so they @@ -1836,8 +1836,8 @@ \ -subsubsection \ Mutual Corecursion - \label{sssec:codatatype-mutual-corecursion} \ +subsubsection \Mutual Corecursion + \label{sssec:codatatype-mutual-corecursion}\ text \ \noindent @@ -1848,8 +1848,8 @@ and odd_enat = Odd_ESucc even_enat -subsubsection \ Nested Corecursion - \label{sssec:codatatype-nested-corecursion} \ +subsubsection \Nested Corecursion + \label{sssec:codatatype-nested-corecursion}\ text \ \noindent @@ -1858,20 +1858,20 @@ codatatype 'a tree\<^sub>i\<^sub>i = Node\<^sub>i\<^sub>i (lbl\<^sub>i\<^sub>i: 'a) (sub\<^sub>i\<^sub>i: "'a tree\<^sub>i\<^sub>i llist") -text \ \blankline \ +text \\blankline\ codatatype 'a tree\<^sub>i\<^sub>s = Node\<^sub>i\<^sub>s (lbl\<^sub>i\<^sub>s: 'a) (sub\<^sub>i\<^sub>s: "'a tree\<^sub>i\<^sub>s fset") -text \ \blankline \ +text \\blankline\ codatatype 'a sm = SM (accept: bool) (trans: "'a \ 'a sm") -subsection \ Command Syntax - \label{ssec:codatatype-command-syntax} \ - -subsubsection \ \keyw{codatatype} - \label{sssec:codatatype} \ +subsection \Command Syntax + \label{ssec:codatatype-command-syntax}\ + +subsubsection \\keyw{codatatype} + \label{sssec:codatatype}\ text \ \begin{matharray}{rcl} @@ -1892,8 +1892,8 @@ \ -subsection \ Generated Constants - \label{ssec:codatatype-generated-constants} \ +subsection \Generated Constants + \label{ssec:codatatype-generated-constants}\ text \ Given a codatatype @{text "('a\<^sub>1, \, 'a\<^sub>m) t"} @@ -1911,8 +1911,8 @@ \ -subsection \ Generated Theorems - \label{ssec:codatatype-generated-theorems} \ +subsection \Generated Theorems + \label{ssec:codatatype-generated-theorems}\ text \ The characteristic theorems generated by @{command codatatype} are grouped in @@ -1938,8 +1938,8 @@ \ -subsubsection \ Coinductive Theorems - \label{sssec:coinductive-theorems} \ +subsubsection \Coinductive Theorems + \label{sssec:coinductive-theorems}\ text \ The coinductive theorems are listed below for @{typ "'a llist"}: @@ -2030,8 +2030,8 @@ \ -section \ Defining Primitively Corecursive Functions - \label{sec:defining-primitively-corecursive-functions} \ +section \Defining Primitively Corecursive Functions + \label{sec:defining-primitively-corecursive-functions}\ text \ Corecursive functions can be specified using the @{command primcorec} and @@ -2079,8 +2079,8 @@ \ -subsection \ Introductory Examples - \label{ssec:primcorec-introductory-examples} \ +subsection \Introductory Examples + \label{ssec:primcorec-introductory-examples}\ text \ Primitive corecursion is illustrated through concrete examples based on the @@ -2092,8 +2092,8 @@ \ -subsubsection \ Simple Corecursion - \label{sssec:primcorec-simple-corecursion} \ +subsubsection \Simple Corecursion + \label{sssec:primcorec-simple-corecursion}\ text \ Following the code view, corecursive calls are allowed on the right-hand side as @@ -2104,7 +2104,7 @@ primcorec (*<*)(transfer) (*>*)literate :: "('a \ 'a) \ 'a \ 'a llist" where "literate g x = LCons x (literate g (g x))" -text \ \blankline \ +text \\blankline\ primcorec siterate :: "('a \ 'a) \ 'a \ 'a stream" where "siterate g x = SCons x (siterate g (g x))" @@ -2201,8 +2201,8 @@ \ -subsubsection \ Mutual Corecursion - \label{sssec:primcorec-mutual-corecursion} \ +subsubsection \Mutual Corecursion + \label{sssec:primcorec-mutual-corecursion}\ text \ The syntax for mutually corecursive functions over mutually corecursive @@ -2217,8 +2217,8 @@ | "odd_infty = Odd_ESucc even_infty" -subsubsection \ Nested Corecursion - \label{sssec:primcorec-nested-corecursion} \ +subsubsection \Nested Corecursion + \label{sssec:primcorec-nested-corecursion}\ text \ The next pair of examples generalize the @{const literate} and @{const siterate} @@ -2231,7 +2231,7 @@ primcorec iterate\<^sub>i\<^sub>i :: "('a \ 'a llist) \ 'a \ 'a tree\<^sub>i\<^sub>i" where "iterate\<^sub>i\<^sub>i g x = Node\<^sub>i\<^sub>i x (lmap (iterate\<^sub>i\<^sub>i g) (g x))" -text \ \blankline \ +text \\blankline\ primcorec iterate\<^sub>i\<^sub>s :: "('a \ 'a fset) \ 'a \ 'a tree\<^sub>i\<^sub>s" where "iterate\<^sub>i\<^sub>s g x = Node\<^sub>i\<^sub>s x (fimage (iterate\<^sub>i\<^sub>s g) (g x))" @@ -2285,17 +2285,17 @@ primcorec sm_of_dfa :: "('q \ 'a \ 'q) \ 'q set \ 'q \ 'a sm" where "sm_of_dfa \ F q = SM (q \ F) (\a. sm_of_dfa \ F (\ q a))" -text \ \blankline \ +text \\blankline\ primcorec empty_sm :: "'a sm" where "empty_sm = SM False (\_. empty_sm)" -text \ \blankline \ +text \\blankline\ primcorec not_sm :: "'a sm \ 'a sm" where "not_sm M = SM (\ accept M) (\a. not_sm (trans M a))" -text \ \blankline \ +text \\blankline\ primcorec or_sm :: "'a sm \ 'a sm \ 'a sm" where "or_sm M N = @@ -2311,14 +2311,14 @@ codatatype ('a, 'b) sm2 = SM2 (accept2: bool) (trans2: "'a \ 'b \ ('a, 'b) sm2") -text \ \blankline \ +text \\blankline\ primcorec (*<*)(in early) (*>*)sm2_of_dfa :: "('q \ 'a \ 'b \ 'q) \ 'q set \ 'q \ ('a, 'b) sm2" where "sm2_of_dfa \ F q = SM2 (q \ F) (op \ (op \ (sm2_of_dfa \ F)) (\ q))" -text \ \blankline \ +text \\blankline\ primcorec sm2_of_dfa :: "('q \ 'a \ 'b \ 'q) \ 'q set \ 'q \ ('a, 'b) sm2" @@ -2326,8 +2326,8 @@ "sm2_of_dfa \ F q = SM2 (q \ F) (\a b. sm2_of_dfa \ F (\ q a b))" -subsubsection \ Nested-as-Mutual Corecursion - \label{sssec:primcorec-nested-as-mutual-corecursion} \ +subsubsection \Nested-as-Mutual Corecursion + \label{sssec:primcorec-nested-as-mutual-corecursion}\ text \ Just as it is possible to recurse over nested recursive datatypes as if they @@ -2366,8 +2366,8 @@ (*>*) -subsubsection \ Constructor View - \label{ssec:primrec-constructor-view} \ +subsubsection \Constructor View + \label{ssec:primrec-constructor-view}\ (*<*) locale ctr_view @@ -2437,8 +2437,8 @@ \ -subsubsection \ Destructor View - \label{ssec:primrec-destructor-view} \ +subsubsection \Destructor View + \label{ssec:primrec-destructor-view}\ (*<*) locale dtr_view @@ -2457,13 +2457,13 @@ | "lhd (literate _ x) = x" | "ltl (literate g x) = literate g (g x)" -text \ \blankline \ +text \\blankline\ primcorec siterate :: "('a \ 'a) \ 'a \ 'a stream" where "shd (siterate _ x) = x" | "stl (siterate g x) = siterate g (g x)" -text \ \blankline \ +text \\blankline\ primcorec every_snd :: "'a stream \ 'a stream" where "shd (every_snd s) = shd s" @@ -2544,7 +2544,7 @@ | "un_Even_ESucc even_infty = odd_infty" | "un_Odd_ESucc odd_infty = even_infty" -text \ \blankline \ +text \\blankline\ primcorec iterate\<^sub>i\<^sub>i :: "('a \ 'a llist) \ 'a \ 'a tree\<^sub>i\<^sub>i" where "lbl\<^sub>i\<^sub>i (iterate\<^sub>i\<^sub>i g x) = x" @@ -2554,11 +2554,11 @@ (*>*) -subsection \ Command Syntax - \label{ssec:primcorec-command-syntax} \ - -subsubsection \ \keyw{primcorec} and \keyw{primcorecursive} - \label{sssec:primcorecursive-and-primcorec} \ +subsection \Command Syntax + \label{ssec:primcorec-command-syntax}\ + +subsubsection \\keyw{primcorec} and \keyw{primcorecursive} + \label{sssec:primcorecursive-and-primcorec}\ text \ \begin{matharray}{rcl} @@ -2621,8 +2621,8 @@ \ -subsection \ Generated Theorems - \label{ssec:primcorec-generated-theorems} \ +subsection \Generated Theorems + \label{ssec:primcorec-generated-theorems}\ text \ The @{command primcorec} and @{command primcorecursive} commands generate the @@ -2719,8 +2719,8 @@ (* -subsection \ Recursive Default Values for Selectors - \label{ssec:primcorec-recursive-default-values-for-selectors} \ +subsection \Recursive Default Values for Selectors + \label{ssec:primcorec-recursive-default-values-for-selectors}\ text \ partial_function to the rescue @@ -2728,8 +2728,8 @@ *) -section \ Registering Bounded Natural Functors - \label{sec:registering-bounded-natural-functors} \ +section \Registering Bounded Natural Functors + \label{sec:registering-bounded-natural-functors}\ text \ The (co)datatype package can be set up to allow nested recursion through @@ -2739,8 +2739,8 @@ \ -subsection \ Bounded Natural Functors - \label{ssec:bounded-natural-functors} \ +subsection \Bounded Natural Functors + \label{ssec:bounded-natural-functors}\ text \ Bounded natural functors (BNFs) are a semantic criterion for where @@ -2773,8 +2773,8 @@ \ -subsection \ Introductory Examples - \label{ssec:bnf-introductory-examples} \ +subsection \Introductory Examples + \label{ssec:bnf-introductory-examples}\ text \ The example below shows how to register a type as a BNF using the @{command bnf} @@ -2789,16 +2789,16 @@ typedef ('d, 'a) fn = "UNIV :: ('d \ 'a) set" by simp -text \ \blankline \ +text \\blankline\ setup_lifting type_definition_fn -text \ \blankline \ +text \\blankline\ lift_definition map_fn :: "('a \ 'b) \ ('d, 'a) fn \ ('d, 'b) fn" is "op \" . lift_definition set_fn :: "('d, 'a) fn \ 'a set" is range . -text \ \blankline \ +text \\blankline\ lift_definition pred_fn :: "('a \ bool) \ ('d, 'a) fn \ bool" @@ -2810,7 +2810,7 @@ is "rel_fun (op =)" . -text \ \blankline \ +text \\blankline\ bnf "('d, 'a) fn" map: map_fn @@ -2866,7 +2866,7 @@ unfolding fun_eq_iff by transfer simp qed -text \ \blankline \ +text \\blankline\ print_theorems print_bnfs @@ -2925,7 +2925,7 @@ xval :: 'a yval :: 'a -text \ \blankline \ +text \\blankline\ copy_bnf ('a, 'z) point_ext @@ -2970,17 +2970,17 @@ bnf_axiomatization (setA: 'a, setB: 'b, setC: 'c) F [wits: "'a \ ('a, 'b, 'c) F"] -text \ \blankline \ +text \\blankline\ print_theorems print_bnfs -subsection \ Command Syntax - \label{ssec:bnf-command-syntax} \ - -subsubsection \ \keyw{bnf} - \label{sssec:bnf} \ +subsection \Command Syntax + \label{ssec:bnf-command-syntax}\ + +subsubsection \\keyw{bnf} + \label{sssec:bnf}\ text \ \begin{matharray}{rcl} @@ -3012,8 +3012,8 @@ %%% TODO: elaborate on proof obligations \ -subsubsection \ \keyw{lift_bnf} - \label{sssec:lift-bnf} \ +subsubsection \\keyw{lift_bnf} + \label{sssec:lift-bnf}\ text \ \begin{matharray}{rcl} @@ -3048,8 +3048,8 @@ specifying the @{text no_warn_wits} option. \ -subsubsection \ \keyw{copy_bnf} - \label{sssec:copy-bnf} \ +subsubsection \\keyw{copy_bnf} + \label{sssec:copy-bnf}\ text \ \begin{matharray}{rcl} @@ -3069,8 +3069,8 @@ nonemptiness witnesses. \ -subsubsection \ \keyw{bnf_axiomatization} - \label{sssec:bnf-axiomatization} \ +subsubsection \\keyw{bnf_axiomatization} + \label{sssec:bnf-axiomatization}\ text \ \begin{matharray}{rcl} @@ -3114,8 +3114,8 @@ \ -subsubsection \ \keyw{print_bnfs} - \label{sssec:print-bnfs} \ +subsubsection \\keyw{print_bnfs} + \label{sssec:print-bnfs}\ text \ \begin{matharray}{rcl} @@ -3128,8 +3128,8 @@ \ -section \ Deriving Destructors and Theorems for Free Constructors - \label{sec:deriving-destructors-and-theorems-for-free-constructors} \ +section \Deriving Destructors and Theorems for Free Constructors + \label{sec:deriving-destructors-and-theorems-for-free-constructors}\ text \ The derivation of convenience theorems for types equipped with free constructors, @@ -3146,16 +3146,16 @@ (* -subsection \ Introductory Example - \label{ssec:ctors-introductory-example} \ +subsection \Introductory Example + \label{ssec:ctors-introductory-example}\ *) -subsection \ Command Syntax - \label{ssec:ctors-command-syntax} \ - -subsubsection \ \keyw{free_constructors} - \label{sssec:free-constructors} \ +subsection \Command Syntax + \label{ssec:ctors-command-syntax}\ + +subsubsection \\keyw{free_constructors} + \label{sssec:free-constructors}\ text \ \begin{matharray}{rcl} @@ -3195,8 +3195,8 @@ \ -subsubsection \ \keyw{simps_of_case} - \label{sssec:simps-of-case} \ +subsubsection \\keyw{simps_of_case} + \label{sssec:simps-of-case}\ text \ \begin{matharray}{rcl} @@ -3234,8 +3234,8 @@ \ -subsubsection \ \keyw{case_of_simps} - \label{sssec:case-of-simps} \ +subsubsection \\keyw{case_of_simps} + \label{sssec:case-of-simps}\ text \ \begin{matharray}{rcl} @@ -3275,8 +3275,8 @@ (* -section \ Using the Standard ML Interface - \label{sec:using-the-standard-ml-interface} \ +section \Using the Standard ML Interface + \label{sec:using-the-standard-ml-interface}\ text \ The package's programmatic interface. @@ -3284,8 +3284,8 @@ *) -section \ Selecting Plugins - \label{sec:selecting-plugins} \ +section \Selecting Plugins + \label{sec:selecting-plugins}\ text \ Plugins extend the (co)datatype package to interoperate with other Isabelle @@ -3305,8 +3305,8 @@ @{cite "sternagel-thiemann-2015"}. \ -subsection \ Code Generator - \label{ssec:code-generator} \ +subsection \Code Generator + \label{ssec:code-generator}\ text \ The \hthm{code} plugin registers freely generated types, including @@ -3342,8 +3342,8 @@ \ -subsection \ Size - \label{ssec:size} \ +subsection \Size + \label{ssec:size}\ text \ For each datatype @{text t}, the \hthm{size} plugin generates a generic size @@ -3392,8 +3392,8 @@ \ -subsection \ Transfer - \label{ssec:transfer} \ +subsection \Transfer + \label{ssec:transfer}\ text \ For each (co)datatype with live type arguments and each manually registered BNF, @@ -3451,8 +3451,8 @@ \ -subsection \ Lifting - \label{ssec:lifting} \ +subsection \Lifting + \label{ssec:lifting}\ text \ For each (co)datatype and each manually registered BNF with at least one live @@ -3477,8 +3477,8 @@ \ -subsection \ Quickcheck - \label{ssec:quickcheck} \ +subsection \Quickcheck + \label{ssec:quickcheck}\ text \ The integration of datatypes with Quickcheck is accomplished by the @@ -3496,8 +3496,8 @@ \ -subsection \ Program Extraction - \label{ssec:program-extraction} \ +subsection \Program Extraction + \label{ssec:program-extraction}\ text \ The \hthm{extraction} plugin provides realizers for induction and case analysis, @@ -3507,13 +3507,12 @@ \ -section \ Known Bugs and Limitations - \label{sec:known-bugs-and-limitations} \ +section \Known Bugs and Limitations + \label{sec:known-bugs-and-limitations}\ text \ -This section lists the known bugs and limitations in the (co)datatype package at -the time of this writing. Many of them are expected to be addressed in future -releases. +This section lists the known bugs and limitations of the (co)datatype package at +the time of this writing. \begin{enumerate} \setlength{\itemsep}{0pt}