| author | krauss | 
| Sun, 21 Aug 2011 22:13:04 +0200 | |
| changeset 44367 | 74c08021ab2e | 
| parent 44273 | 336752fb25df | 
| child 45192 | 008710fff1cc | 
| permissions | -rw-r--r-- | 
| 26840 | 1 | % | 
| 2 | \begin{isabellebody}%
 | |
| 40406 | 3 | \def\isabellecontext{HOL{\isaliteral{5F}{\isacharunderscore}}Specific}%
 | 
| 26840 | 4 | % | 
| 5 | \isadelimtheory | |
| 6 | % | |
| 7 | \endisadelimtheory | |
| 8 | % | |
| 9 | \isatagtheory | |
| 10 | \isacommand{theory}\isamarkupfalse%
 | |
| 40406 | 11 | \ HOL{\isaliteral{5F}{\isacharunderscore}}Specific\isanewline
 | 
| 44055 | 12 | \isakeyword{imports}\ Base\ Main\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}HOL{\isaliteral{2F}{\isacharslash}}Library{\isaliteral{2F}{\isacharslash}}Old{\isaliteral{5F}{\isacharunderscore}}Recdef{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 26849 | 13 | \isakeyword{begin}%
 | 
| 14 | \endisatagtheory | |
| 15 | {\isafoldtheory}%
 | |
| 16 | % | |
| 17 | \isadelimtheory | |
| 18 | % | |
| 19 | \endisadelimtheory | |
| 20 | % | |
| 26852 | 21 | \isamarkupchapter{Isabelle/HOL \label{ch:hol}%
 | 
| 26849 | 22 | } | 
| 23 | \isamarkuptrue% | |
| 24 | % | |
| 42914 | 25 | \isamarkupsection{Higher-Order Logic%
 | 
| 26 | } | |
| 27 | \isamarkuptrue% | |
| 28 | % | |
| 29 | \begin{isamarkuptext}%
 | |
| 30 | Isabelle/HOL is based on Higher-Order Logic, a polymorphic | |
| 31 | version of Church's Simple Theory of Types. HOL can be best | |
| 32 | understood as a simply-typed version of classical set theory. The | |
| 33 | logic was first implemented in Gordon's HOL system | |
| 34 |   \cite{mgordon-hol}.  It extends Church's original logic
 | |
| 35 |   \cite{church40} by explicit type variables (naive polymorphism) and
 | |
| 36 | a sound axiomatization scheme for new types based on subsets of | |
| 37 | existing types. | |
| 38 | ||
| 39 |   Andrews's book \cite{andrews86} is a full description of the
 | |
| 40 | original Church-style higher-order logic, with proofs of correctness | |
| 41 | and completeness wrt.\ certain set-theoretic interpretations. The | |
| 42 | particular extensions of Gordon-style HOL are explained semantically | |
| 43 |   in two chapters of the 1993 HOL book \cite{pitts93}.
 | |
| 44 | ||
| 45 | Experience with HOL over decades has demonstrated that higher-order | |
| 46 | logic is widely applicable in many areas of mathematics and computer | |
| 47 | science. In a sense, Higher-Order Logic is simpler than First-Order | |
| 48 | Logic, because there are fewer restrictions and special cases. Note | |
| 49 |   that HOL is \emph{weaker} than FOL with axioms for ZF set theory,
 | |
| 50 | which is traditionally considered the standard foundation of regular | |
| 51 | mathematics, but for most applications this does not matter. If you | |
| 52 | prefer ML to Lisp, you will probably prefer HOL to ZF. | |
| 53 | ||
| 54 |   \medskip The syntax of HOL follows \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}{\isaliteral{22}{\isachardoublequote}}}-calculus and
 | |
| 55 | functional programming. Function application is curried. To apply | |
| 56 |   the function \isa{f} of type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{3}}{\isaliteral{22}{\isachardoublequote}}} to the
 | |
| 57 |   arguments \isa{a} and \isa{b} in HOL, you simply write \isa{{\isaliteral{22}{\isachardoublequote}}f\ a\ b{\isaliteral{22}{\isachardoublequote}}} (as in ML or Haskell).  There is no ``apply'' operator; the
 | |
| 58 |   existing application of the Pure \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}{\isaliteral{22}{\isachardoublequote}}}-calculus is re-used.
 | |
| 59 |   Note that in HOL \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{28}{\isacharparenleft}}a{\isaliteral{2C}{\isacharcomma}}\ b{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} means ``\isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{22}{\isachardoublequote}}} applied to
 | |
| 60 |   the pair \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}a{\isaliteral{2C}{\isacharcomma}}\ b{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} (which is notation for \isa{{\isaliteral{22}{\isachardoublequote}}Pair\ a\ b{\isaliteral{22}{\isachardoublequote}}}).  The latter typically introduces extra formal efforts that can
 | |
| 61 | be avoided by currying functions by default. Explicit tuples are as | |
| 62 | infrequent in HOL formalizations as in good ML or Haskell programs. | |
| 63 | ||
| 64 | \medskip Isabelle/HOL has a distinct feel, compared to other | |
| 65 | object-logics like Isabelle/ZF. It identifies object-level types | |
| 66 | with meta-level types, taking advantage of the default | |
| 67 | type-inference mechanism of Isabelle/Pure. HOL fully identifies | |
| 68 | object-level functions with meta-level functions, with native | |
| 69 | abstraction and application. | |
| 70 | ||
| 71 | These identifications allow Isabelle to support HOL particularly | |
| 72 | nicely, but they also mean that HOL requires some sophistication | |
| 73 | from the user. In particular, an understanding of Hindley-Milner | |
| 74 | type-inference with type-classes, which are both used extensively in | |
| 75 | the standard libraries and applications. Beginners can set | |
| 76 |   \hyperlink{attribute.show-types}{\mbox{\isa{show{\isaliteral{5F}{\isacharunderscore}}types}}} or even \hyperlink{attribute.show-sorts}{\mbox{\isa{show{\isaliteral{5F}{\isacharunderscore}}sorts}}} to get more
 | |
| 77 | explicit information about the result of type-inference.% | |
| 78 | \end{isamarkuptext}%
 | |
| 79 | \isamarkuptrue% | |
| 80 | % | |
| 42908 | 81 | \isamarkupsection{Inductive and coinductive definitions \label{sec:hol-inductive}%
 | 
| 26849 | 82 | } | 
| 83 | \isamarkuptrue% | |
| 84 | % | |
| 85 | \begin{isamarkuptext}%
 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 86 | An \emph{inductive definition} specifies the least predicate
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 87 |   or set \isa{R} closed under given rules: applying a rule to
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 88 |   elements of \isa{R} yields a result within \isa{R}.  For
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 89 | example, a structural operational semantics is an inductive | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 90 | definition of an evaluation relation. | 
| 42908 | 91 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 92 |   Dually, a \emph{coinductive definition} specifies the greatest
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 93 |   predicate or set \isa{R} that is consistent with given rules:
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 94 |   every element of \isa{R} can be seen as arising by applying a rule
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 95 |   to elements of \isa{R}.  An important example is using
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 96 | bisimulation relations to formalise equivalence of processes and | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 97 | infinite data structures. | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 98 | |
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 99 | Both inductive and coinductive definitions are based on the | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 100 | Knaster-Tarski fixed-point theorem for complete lattices. The | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 101 | collection of introduction rules given by the user determines a | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 102 | functor on subsets of set-theoretic relations. The required | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 103 | monotonicity of the recursion scheme is proven as a prerequisite to | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 104 | the fixed-point definition and the resulting consequences. This | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 105 | works by pushing inclusion through logical connectives and any other | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 106 | operator that might be wrapped around recursive occurrences of the | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 107 | defined relation: there must be a monotonicity theorem of the form | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 108 |   \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C6C653E}{\isasymle}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C4D3E}{\isasymM}}\ A\ {\isaliteral{5C3C6C653E}{\isasymle}}\ {\isaliteral{5C3C4D3E}{\isasymM}}\ B{\isaliteral{22}{\isachardoublequote}}}, for each premise \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4D3E}{\isasymM}}\ R\ t{\isaliteral{22}{\isachardoublequote}}} in an
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 109 | introduction rule. The default rule declarations of Isabelle/HOL | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 110 | already take care of most common situations. | 
| 42908 | 111 | |
| 42907 
dfd4ef8e73f6
updated and re-unified HOL typedef, with some live examples;
 wenzelm parents: 
42705diff
changeset | 112 |   \begin{matharray}{rcl}
 | 
| 42908 | 113 |     \indexdef{HOL}{command}{inductive}\hypertarget{command.HOL.inductive}{\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 114 |     \indexdef{HOL}{command}{inductive\_set}\hypertarget{command.HOL.inductive-set}{\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}set}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 115 |     \indexdef{HOL}{command}{coinductive}\hypertarget{command.HOL.coinductive}{\hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 116 |     \indexdef{HOL}{command}{coinductive\_set}\hypertarget{command.HOL.coinductive-set}{\hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isaliteral{5F}{\isacharunderscore}}set}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 117 |     \indexdef{HOL}{attribute}{mono}\hypertarget{attribute.HOL.mono}{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}} & : & \isa{attribute} \\
 | |
| 26849 | 118 |   \end{matharray}
 | 
| 119 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 120 |   \begin{railoutput}
 | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 121 | \rail@begin{10}{}
 | 
| 42908 | 122 | \rail@bar | 
| 123 | \rail@term{\hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}}}[]
 | |
| 124 | \rail@nextbar{1}
 | |
| 125 | \rail@term{\hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}set}}}}}[]
 | |
| 126 | \rail@nextbar{2}
 | |
| 127 | \rail@term{\hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}}}[]
 | |
| 128 | \rail@nextbar{3}
 | |
| 129 | \rail@term{\hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isaliteral{5F}{\isacharunderscore}}set}}}}}[]
 | |
| 130 | \rail@endbar | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 131 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 132 | \rail@nextbar{1}
 | 
| 42908 | 133 | \rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 134 | \rail@endbar | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 135 | \rail@cr{5}
 | 
| 42908 | 136 | \rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 137 | \rail@bar | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 138 | \rail@nextbar{6}
 | 
| 42908 | 139 | \rail@term{\isa{\isakeyword{for}}}[]
 | 
| 140 | \rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 141 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 142 | \rail@bar | 
| 42908 | 143 | \rail@nextbar{6}
 | 
| 144 | \rail@term{\isa{\isakeyword{where}}}[]
 | |
| 145 | \rail@nont{\isa{clauses}}[]
 | |
| 146 | \rail@endbar | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 147 | \rail@cr{8}
 | 
| 42908 | 148 | \rail@bar | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 149 | \rail@nextbar{9}
 | 
| 42908 | 150 | \rail@term{\isa{\isakeyword{monos}}}[]
 | 
| 151 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 152 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 153 | \rail@end | 
| 42908 | 154 | \rail@begin{3}{\isa{clauses}}
 | 
| 155 | \rail@plus | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 156 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 157 | \rail@nextbar{1}
 | 
| 42908 | 158 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 159 | \rail@endbar | |
| 160 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | |
| 161 | \rail@nextplus{2}
 | |
| 162 | \rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
 | |
| 163 | \rail@endplus | |
| 164 | \rail@end | |
| 165 | \rail@begin{3}{}
 | |
| 166 | \rail@term{\hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}}}[]
 | |
| 167 | \rail@bar | |
| 168 | \rail@nextbar{1}
 | |
| 169 | \rail@term{\isa{add}}[]
 | |
| 170 | \rail@nextbar{2}
 | |
| 171 | \rail@term{\isa{del}}[]
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 172 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 173 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 174 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 175 | |
| 26849 | 176 | |
| 28788 | 177 |   \begin{description}
 | 
| 42123 | 178 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 179 |   \item \hyperlink{command.HOL.inductive}{\mbox{\isa{\isacommand{inductive}}}} and \hyperlink{command.HOL.coinductive}{\mbox{\isa{\isacommand{coinductive}}}} define (co)inductive predicates from the introduction
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 180 | rules. | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 181 | |
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 182 |   The propositions given as \isa{{\isaliteral{22}{\isachardoublequote}}clauses{\isaliteral{22}{\isachardoublequote}}} in the \hyperlink{keyword.where}{\mbox{\isa{\isakeyword{where}}}} part are either rules of the usual \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{2F}{\isacharslash}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} format
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 183 |   (with arbitrary nesting), or equalities using \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C65717569763E}{\isasymequiv}}{\isaliteral{22}{\isachardoublequote}}}.  The
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 184 | latter specifies extra-logical abbreviations in the sense of | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 185 |   \indexref{}{command}{abbreviation}\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}.  Introducing abstract syntax
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 186 | simultaneously with the actual introduction rules is occasionally | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 187 | useful for complex specifications. | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 188 | |
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 189 |   The optional \hyperlink{keyword.for}{\mbox{\isa{\isakeyword{for}}}} part contains a list of parameters of
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 190 | the (co)inductive predicates that remain fixed throughout the | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 191 | definition, in contrast to arguments of the relation that may vary | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 192 |   in each occurrence within the given \isa{{\isaliteral{22}{\isachardoublequote}}clauses{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 193 | |
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 194 |   The optional \hyperlink{keyword.monos}{\mbox{\isa{\isakeyword{monos}}}} declaration contains additional
 | 
| 42908 | 195 |   \emph{monotonicity theorems}, which are required for each operator
 | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 196 | applied to a recursive set in the introduction rules. | 
| 26849 | 197 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 198 |   \item \hyperlink{command.HOL.inductive-set}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}set}}}} and \hyperlink{command.HOL.coinductive-set}{\mbox{\isa{\isacommand{coinductive{\isaliteral{5F}{\isacharunderscore}}set}}}} are wrappers for to the previous commands for
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 199 | native HOL predicates. This allows to define (co)inductive sets, | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 200 | where multiple arguments are simulated via tuples. | 
| 26849 | 201 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 202 |   \item \hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}} declares monotonicity rules in the
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 203 | context. These rule are involved in the automated monotonicity | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 204 | proof of the above inductive and coinductive definitions. | 
| 26849 | 205 | |
| 28788 | 206 |   \end{description}%
 | 
| 26849 | 207 | \end{isamarkuptext}%
 | 
| 208 | \isamarkuptrue% | |
| 209 | % | |
| 42908 | 210 | \isamarkupsubsection{Derived rules%
 | 
| 26849 | 211 | } | 
| 212 | \isamarkuptrue% | |
| 213 | % | |
| 214 | \begin{isamarkuptext}%
 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 215 | A (co)inductive definition of \isa{R} provides the following
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 216 | main theorems: | 
| 26849 | 217 | |
| 42908 | 218 |   \begin{description}
 | 
| 26849 | 219 | |
| 42908 | 220 |   \item \isa{R{\isaliteral{2E}{\isachardot}}intros} is the list of introduction rules as proven
 | 
| 221 | theorems, for the recursive predicates (or sets). The rules are | |
| 222 | also available individually, using the names given them in the | |
| 223 | theory file; | |
| 26849 | 224 | |
| 42908 | 225 |   \item \isa{R{\isaliteral{2E}{\isachardot}}cases} is the case analysis (or elimination) rule;
 | 
| 226 | ||
| 227 |   \item \isa{R{\isaliteral{2E}{\isachardot}}induct} or \isa{R{\isaliteral{2E}{\isachardot}}coinduct} is the (co)induction
 | |
| 44273 
336752fb25df
adding documentation about simps equation in the inductive package
 bulwahn parents: 
44055diff
changeset | 228 | rule; | 
| 
336752fb25df
adding documentation about simps equation in the inductive package
 bulwahn parents: 
44055diff
changeset | 229 | |
| 
336752fb25df
adding documentation about simps equation in the inductive package
 bulwahn parents: 
44055diff
changeset | 230 |   \item \isa{R{\isaliteral{2E}{\isachardot}}simps} is the equation unrolling the fixpoint of the
 | 
| 
336752fb25df
adding documentation about simps equation in the inductive package
 bulwahn parents: 
44055diff
changeset | 231 | predicate one step. | 
| 
336752fb25df
adding documentation about simps equation in the inductive package
 bulwahn parents: 
44055diff
changeset | 232 | |
| 42908 | 233 |   \end{description}
 | 
| 26849 | 234 | |
| 42908 | 235 |   When several predicates \isa{{\isaliteral{22}{\isachardoublequote}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ R\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} are
 | 
| 236 | defined simultaneously, the list of introduction rules is called | |
| 237 |   \isa{{\isaliteral{22}{\isachardoublequote}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{5F}{\isacharunderscore}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{2E}{\isachardot}}intros{\isaliteral{22}{\isachardoublequote}}}, the case analysis rules are
 | |
| 238 |   called \isa{{\isaliteral{22}{\isachardoublequote}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2E}{\isachardot}}cases{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ R\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{2E}{\isachardot}}cases{\isaliteral{22}{\isachardoublequote}}}, and the list
 | |
| 239 |   of mutual induction rules is called \isa{{\isaliteral{22}{\isachardoublequote}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{5F}{\isacharunderscore}}R\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{2E}{\isachardot}}inducts{\isaliteral{22}{\isachardoublequote}}}.%
 | |
| 26849 | 240 | \end{isamarkuptext}%
 | 
| 241 | \isamarkuptrue% | |
| 242 | % | |
| 42908 | 243 | \isamarkupsubsection{Monotonicity theorems%
 | 
| 26849 | 244 | } | 
| 245 | \isamarkuptrue% | |
| 246 | % | |
| 247 | \begin{isamarkuptext}%
 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 248 | The context maintains a default set of theorems that are used | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 249 | in monotonicity proofs. New rules can be declared via the | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 250 |   \hyperlink{attribute.HOL.mono}{\mbox{\isa{mono}}} attribute.  See the main Isabelle/HOL
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 251 | sources for some examples. The general format of such monotonicity | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 252 | theorems is as follows: | 
| 26849 | 253 | |
| 42908 | 254 |   \begin{itemize}
 | 
| 26849 | 255 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 256 |   \item Theorems of the form \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C6C653E}{\isasymle}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C4D3E}{\isasymM}}\ A\ {\isaliteral{5C3C6C653E}{\isasymle}}\ {\isaliteral{5C3C4D3E}{\isasymM}}\ B{\isaliteral{22}{\isachardoublequote}}}, for proving
 | 
| 42908 | 257 | monotonicity of inductive definitions whose introduction rules have | 
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 258 |   premises involving terms such as \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4D3E}{\isasymM}}\ R\ t{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 26849 | 259 | |
| 42908 | 260 | \item Monotonicity theorems for logical operators, which are of the | 
| 261 |   general form \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}.  For example, in
 | |
| 262 |   the case of the operator \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6F723E}{\isasymor}}{\isaliteral{22}{\isachardoublequote}}}, the corresponding theorem is
 | |
| 263 | \[ | |
| 264 |   \infer{\isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}}}
 | |
| 265 | \] | |
| 41396 | 266 | |
| 42908 | 267 | \item De Morgan style equations for reasoning about the ``polarity'' | 
| 268 | of expressions, e.g. | |
| 269 | \[ | |
| 270 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ P{\isaliteral{22}{\isachardoublequote}}} \qquad\qquad
 | |
| 271 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C616E643E}{\isasymand}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q{\isaliteral{22}{\isachardoublequote}}}
 | |
| 272 | \] | |
| 41396 | 273 | |
| 42908 | 274 | \item Equations for reducing complex operators to more primitive | 
| 275 | ones whose monotonicity can easily be proved, e.g. | |
| 276 | \[ | |
| 277 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}} \qquad\qquad
 | |
| 278 |   \isa{{\isaliteral{22}{\isachardoublequote}}Ball\ A\ P\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ x\ {\isaliteral{5C3C696E3E}{\isasymin}}\ A\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P\ x{\isaliteral{22}{\isachardoublequote}}}
 | |
| 279 | \] | |
| 41396 | 280 | |
| 42913 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 281 |   \end{itemize}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 282 | \end{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 283 | \isamarkuptrue% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 284 | % | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 285 | \isamarkupsubsubsection{Examples%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 286 | } | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 287 | \isamarkuptrue% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 288 | % | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 289 | \begin{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 290 | The finite powerset operator can be defined inductively like this:% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 291 | \end{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 292 | \isamarkuptrue% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 293 | \isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}set}\isamarkupfalse%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 294 | \ Fin\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ set\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ set\ set{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{for}\ A\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ set{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 295 | \isakeyword{where}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 296 | \ \ empty{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{7D}{\isacharbraceright}}\ {\isaliteral{5C3C696E3E}{\isasymin}}\ Fin\ A{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 297 | {\isaliteral{7C}{\isacharbar}}\ insert{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}a\ {\isaliteral{5C3C696E3E}{\isasymin}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C696E3E}{\isasymin}}\ Fin\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ insert\ a\ B\ {\isaliteral{5C3C696E3E}{\isasymin}}\ Fin\ A{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 298 | \begin{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 299 | The accessible part of a relation is defined as follows:% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 300 | \end{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 301 | \isamarkuptrue% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 302 | \isacommand{inductive}\isamarkupfalse%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 303 | \ acc\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 304 | \ \ \isakeyword{for}\ r\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{28}{\isacharparenleft}}\isakeyword{infix}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C707265633E}{\isasymprec}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isadigit{5}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 305 | \isakeyword{where}\ acc{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C416E643E}{\isasymAnd}}y{\isaliteral{2E}{\isachardot}}\ y\ {\isaliteral{5C3C707265633E}{\isasymprec}}\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ acc\ r\ y{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ acc\ r\ x{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 306 | \begin{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 307 | Common logical connectives can be easily characterized as | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 308 | non-recursive inductive definitions with parameters, but without | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 309 | arguments.% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 310 | \end{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 311 | \isamarkuptrue% | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 312 | \isacommand{inductive}\isamarkupfalse%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 313 | \ AND\ \isakeyword{for}\ A\ B\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ bool\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 314 | \isakeyword{where}\ {\isaliteral{22}{\isachardoublequoteopen}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ AND\ A\ B{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 315 | \isanewline | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 316 | \isacommand{inductive}\isamarkupfalse%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 317 | \ OR\ \isakeyword{for}\ A\ B\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ bool\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 318 | \isakeyword{where}\ {\isaliteral{22}{\isachardoublequoteopen}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ OR\ A\ B{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 319 | \ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}B\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ OR\ A\ B{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 320 | \isanewline | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 321 | \isacommand{inductive}\isamarkupfalse%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 322 | \ EXISTS\ \isakeyword{for}\ B\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 323 | \isakeyword{where}\ {\isaliteral{22}{\isachardoublequoteopen}}B\ a\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ EXISTS\ B{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 324 | \begin{isamarkuptext}%
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 325 | Here the \isa{{\isaliteral{22}{\isachardoublequote}}cases{\isaliteral{22}{\isachardoublequote}}} or \isa{{\isaliteral{22}{\isachardoublequote}}induct{\isaliteral{22}{\isachardoublequote}}} rules produced by
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 326 |   the \hyperlink{command.inductive}{\mbox{\isa{\isacommand{inductive}}}} package coincide with the expected
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 327 | elimination rules for Natural Deduction. Already in the original | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 328 |   article by Gerhard Gentzen \cite{Gentzen:1935} there is a hint that
 | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 329 | each connective can be characterized by its introductions, and the | 
| 
68bc69bdce88
updated and re-unified (co)inductive definitions in HOL;
 wenzelm parents: 
42912diff
changeset | 330 | elimination can be constructed systematically.% | 
| 41396 | 331 | \end{isamarkuptext}%
 | 
| 332 | \isamarkuptrue% | |
| 333 | % | |
| 26849 | 334 | \isamarkupsection{Recursive functions \label{sec:recursion}%
 | 
| 335 | } | |
| 336 | \isamarkuptrue% | |
| 337 | % | |
| 338 | \begin{isamarkuptext}%
 | |
| 339 | \begin{matharray}{rcl}
 | |
| 40406 | 340 |     \indexdef{HOL}{command}{primrec}\hypertarget{command.HOL.primrec}{\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 341 |     \indexdef{HOL}{command}{fun}\hypertarget{command.HOL.fun}{\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 342 |     \indexdef{HOL}{command}{function}\hypertarget{command.HOL.function}{\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 343 |     \indexdef{HOL}{command}{termination}\hypertarget{command.HOL.termination}{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 26849 | 344 |   \end{matharray}
 | 
| 345 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 346 |   \begin{railoutput}
 | 
| 42662 | 347 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 348 | \rail@term{\hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 349 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 350 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 351 | \rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 352 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 353 | \rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 354 | \rail@term{\isa{\isakeyword{where}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 355 | \rail@nont{\isa{equations}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 356 | \rail@end | 
| 42662 | 357 | \rail@begin{4}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 358 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 359 | \rail@term{\hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 360 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 361 | \rail@term{\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 362 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 363 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 364 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 365 | \rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 366 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 367 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 368 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 369 | \rail@nont{\isa{functionopts}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 370 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 371 | \rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 372 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 373 | \rail@term{\isa{\isakeyword{where}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 374 | \rail@nont{\isa{equations}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 375 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 376 | \rail@begin{3}{\isa{equations}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 377 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 378 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 379 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 380 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 381 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 382 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 383 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 384 | \rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 385 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 386 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 387 | \rail@begin{3}{\isa{functionopts}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 388 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 389 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 390 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 391 | \rail@term{\isa{sequential}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 392 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 393 | \rail@term{\isa{domintros}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 394 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 395 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 396 | \rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 397 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 398 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 399 | \rail@end | 
| 42662 | 400 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 401 | \rail@term{\hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 402 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 403 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 404 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 405 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 406 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 407 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 408 | |
| 26849 | 409 | |
| 28788 | 410 |   \begin{description}
 | 
| 26849 | 411 | |
| 28788 | 412 |   \item \hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}} defines primitive recursive
 | 
| 42912 | 413 |   functions over datatypes (see also \indexref{HOL}{command}{datatype}\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} and
 | 
| 414 |   \indexref{HOL}{command}{rep\_datatype}\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}}).  The given \isa{equations}
 | |
| 415 | specify reduction rules that are produced by instantiating the | |
| 416 | generic combinator for primitive recursion that is available for | |
| 417 | each datatype. | |
| 418 | ||
| 419 | Each equation needs to be of the form: | |
| 420 | ||
| 421 |   \begin{isabelle}%
 | |
| 422 | {\isaliteral{22}{\isachardoublequote}}f\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{28}{\isacharparenleft}}C\ y\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ y\isaliteral{5C3C5E7375623E}{}\isactrlsub k{\isaliteral{29}{\isacharparenright}}\ z\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ z\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3D}{\isacharequal}}\ rhs{\isaliteral{22}{\isachardoublequote}}%
 | |
| 423 | \end{isabelle}
 | |
| 424 | ||
| 425 |   such that \isa{C} is a datatype constructor, \isa{rhs} contains
 | |
| 426 | only the free variables on the left-hand side (or from the context), | |
| 427 |   and all recursive occurrences of \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{22}{\isachardoublequote}}} in \isa{{\isaliteral{22}{\isachardoublequote}}rhs{\isaliteral{22}{\isachardoublequote}}} are of
 | |
| 428 |   the form \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ y\isaliteral{5C3C5E7375623E}{}\isactrlsub i\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} for some \isa{i}.  At most one
 | |
| 429 | reduction rule for each constructor can be given. The order does | |
| 430 | not matter. For missing constructors, the function is defined to | |
| 431 | return a default value, but this equation is made difficult to | |
| 432 | access for users. | |
| 433 | ||
| 434 |   The reduction rules are declared as \hyperlink{attribute.simp}{\mbox{\isa{simp}}} by default,
 | |
| 435 |   which enables standard proof methods like \hyperlink{method.simp}{\mbox{\isa{simp}}} and
 | |
| 436 |   \hyperlink{method.auto}{\mbox{\isa{auto}}} to normalize expressions of \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{22}{\isachardoublequote}}} applied to
 | |
| 437 | datatype constructions, by simulating symbolic computation via | |
| 438 | rewriting. | |
| 26849 | 439 | |
| 28788 | 440 |   \item \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} defines functions by general
 | 
| 26849 | 441 | wellfounded recursion. A detailed description with examples can be | 
| 442 |   found in \cite{isabelle-function}. The function is specified by a
 | |
| 443 | set of (possibly conditional) recursive equations with arbitrary | |
| 444 | pattern matching. The command generates proof obligations for the | |
| 445 | completeness and the compatibility of patterns. | |
| 446 | ||
| 447 | The defined function is considered partial, and the resulting | |
| 40406 | 448 |   simplification rules (named \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{2E}{\isachardot}}psimps{\isaliteral{22}{\isachardoublequote}}}) and induction rule
 | 
| 449 |   (named \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{2E}{\isachardot}}pinduct{\isaliteral{22}{\isachardoublequote}}}) are guarded by a generated domain
 | |
| 450 |   predicate \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{5F}{\isacharunderscore}}dom{\isaliteral{22}{\isachardoublequote}}}. The \hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}
 | |
| 26849 | 451 | command can then be used to establish that the function is total. | 
| 452 | ||
| 40406 | 453 |   \item \hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}} is a shorthand notation for ``\hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}sequential{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, followed by automated
 | 
| 28788 | 454 | proof attempts regarding pattern matching and termination. See | 
| 455 |   \cite{isabelle-function} for further details.
 | |
| 26849 | 456 | |
| 28788 | 457 |   \item \hyperlink{command.HOL.termination}{\mbox{\isa{\isacommand{termination}}}}~\isa{f} commences a
 | 
| 26849 | 458 |   termination proof for the previously defined function \isa{f}.  If
 | 
| 459 | this is omitted, the command refers to the most recent function | |
| 460 | definition. After the proof is closed, the recursive equations and | |
| 461 | the induction principle is established. | |
| 462 | ||
| 28788 | 463 |   \end{description}
 | 
| 26849 | 464 | |
| 27452 | 465 |   Recursive definitions introduced by the \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}}
 | 
| 42912 | 466 |   command accommodate reasoning by induction (cf.\ \hyperlink{method.induct}{\mbox{\isa{induct}}}):
 | 
| 467 |   rule \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{2E}{\isachardot}}induct{\isaliteral{22}{\isachardoublequote}}} refers to a specific induction rule, with
 | |
| 468 | parameters named according to the user-specified equations. Cases | |
| 469 |   are numbered starting from 1.  For \hyperlink{command.HOL.primrec}{\mbox{\isa{\isacommand{primrec}}}}, the
 | |
| 470 | induction principle coincides with structural recursion on the | |
| 471 | datatype where the recursion is carried out. | |
| 26849 | 472 | |
| 473 | The equations provided by these packages may be referred later as | |
| 40406 | 474 |   theorem list \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{2E}{\isachardot}}simps{\isaliteral{22}{\isachardoublequote}}}, where \isa{f} is the (collective)
 | 
| 26849 | 475 | name of the functions defined. Individual equations may be named | 
| 476 | explicitly as well. | |
| 477 | ||
| 26902 | 478 |   The \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} command accepts the following
 | 
| 26849 | 479 | options. | 
| 480 | ||
| 28788 | 481 |   \begin{description}
 | 
| 26849 | 482 | |
| 28788 | 483 |   \item \isa{sequential} enables a preprocessor which disambiguates
 | 
| 484 | overlapping patterns by making them mutually disjoint. Earlier | |
| 485 | equations take precedence over later ones. This allows to give the | |
| 486 | specification in a format very similar to functional programming. | |
| 487 | Note that the resulting simplification and induction rules | |
| 488 | correspond to the transformed specification, not the one given | |
| 26849 | 489 | originally. This usually means that each equation given by the user | 
| 36139 | 490 | may result in several theorems. Also note that this automatic | 
| 26849 | 491 | transformation only works for ML-style datatype patterns. | 
| 492 | ||
| 28788 | 493 |   \item \isa{domintros} enables the automated generation of
 | 
| 26849 | 494 | introduction rules for the domain predicate. While mostly not | 
| 495 | needed, they can be helpful in some proofs about partial functions. | |
| 496 | ||
| 28788 | 497 |   \end{description}%
 | 
| 26849 | 498 | \end{isamarkuptext}%
 | 
| 499 | \isamarkuptrue% | |
| 500 | % | |
| 42912 | 501 | \isamarkupsubsubsection{Example: evaluation of expressions%
 | 
| 502 | } | |
| 503 | \isamarkuptrue% | |
| 504 | % | |
| 505 | \begin{isamarkuptext}%
 | |
| 506 | Subsequently, we define mutual datatypes for arithmetic and | |
| 507 |   boolean expressions, and use \hyperlink{command.primrec}{\mbox{\isa{\isacommand{primrec}}}} for evaluation
 | |
| 508 | functions that follow the same recursive structure.% | |
| 509 | \end{isamarkuptext}%
 | |
| 510 | \isamarkuptrue% | |
| 511 | \isacommand{datatype}\isamarkupfalse%
 | |
| 512 | \ {\isaliteral{27}{\isacharprime}}a\ aexp\ {\isaliteral{3D}{\isacharequal}}\isanewline
 | |
| 513 | \ \ \ \ IF\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 514 | \ \ {\isaliteral{7C}{\isacharbar}}\ Sum\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 515 | \ \ {\isaliteral{7C}{\isacharbar}}\ Diff\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 516 | \ \ {\isaliteral{7C}{\isacharbar}}\ Var\ {\isaliteral{27}{\isacharprime}}a\isanewline
 | |
| 517 | \ \ {\isaliteral{7C}{\isacharbar}}\ Num\ nat\isanewline
 | |
| 518 | \isakeyword{and}\ {\isaliteral{27}{\isacharprime}}a\ bexp\ {\isaliteral{3D}{\isacharequal}}\isanewline
 | |
| 519 | \ \ \ \ Less\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 520 | \ \ {\isaliteral{7C}{\isacharbar}}\ And\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 521 | \ \ {\isaliteral{7C}{\isacharbar}}\ Neg\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 522 | \begin{isamarkuptext}%
 | |
| 523 | \medskip Evaluation of arithmetic and boolean expressions% | |
| 524 | \end{isamarkuptext}%
 | |
| 525 | \isamarkuptrue% | |
| 526 | \isacommand{primrec}\isamarkupfalse%
 | |
| 527 | \ evala\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ aexp\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 528 | \ \ \isakeyword{and}\ evalb\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ bexp\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 529 | \isakeyword{where}\isanewline
 | |
| 530 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}if\ evalb\ env\ b\ then\ evala\ env\ a{\isadigit{1}}\ else\ evala\ env\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 531 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}Sum\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evala\ env\ a{\isadigit{1}}\ {\isaliteral{2B}{\isacharplus}}\ evala\ env\ a{\isadigit{2}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 532 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}Diff\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evala\ env\ a{\isadigit{1}}\ {\isaliteral{2D}{\isacharminus}}\ evala\ env\ a{\isadigit{2}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 533 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}Var\ v{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ env\ v{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 534 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}Num\ n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ n{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 535 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evalb\ env\ {\isaliteral{28}{\isacharparenleft}}Less\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}evala\ env\ a{\isadigit{1}}\ {\isaliteral{3C}{\isacharless}}\ evala\ env\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 536 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evalb\ env\ {\isaliteral{28}{\isacharparenleft}}And\ b{\isadigit{1}}\ b{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}evalb\ env\ b{\isadigit{1}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ evalb\ env\ b{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 537 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}evalb\ env\ {\isaliteral{28}{\isacharparenleft}}Neg\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ evalb\ env\ b{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 538 | \begin{isamarkuptext}%
 | |
| 539 | Since the value of an expression depends on the value of its | |
| 540 |   variables, the functions \isa{evala} and \isa{evalb} take an
 | |
| 541 |   additional parameter, an \emph{environment} that maps variables to
 | |
| 542 | their values. | |
| 543 | ||
| 544 | \medskip Substitution on expressions can be defined similarly. The | |
| 545 |   mapping \isa{f} of type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequote}}} given as a
 | |
| 546 |   parameter is lifted canonically on the types \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequote}}} and
 | |
| 547 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequote}}}, respectively.%
 | |
| 548 | \end{isamarkuptext}%
 | |
| 549 | \isamarkuptrue% | |
| 550 | \isacommand{primrec}\isamarkupfalse%
 | |
| 551 | \ substa\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ aexp{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ aexp\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ aexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 552 | \ \ \isakeyword{and}\ substb\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ aexp{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ bexp\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ bexp{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 553 | \isakeyword{where}\isanewline
 | |
| 554 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}substa\ f\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ IF\ {\isaliteral{28}{\isacharparenleft}}substb\ f\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 555 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substa\ f\ {\isaliteral{28}{\isacharparenleft}}Sum\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Sum\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 556 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substa\ f\ {\isaliteral{28}{\isacharparenleft}}Diff\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Diff\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 557 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substa\ f\ {\isaliteral{28}{\isacharparenleft}}Var\ v{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ f\ v{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 558 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substa\ f\ {\isaliteral{28}{\isacharparenleft}}Num\ n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Num\ n{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 559 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substb\ f\ {\isaliteral{28}{\isacharparenleft}}Less\ a{\isadigit{1}}\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Less\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substa\ f\ a{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 560 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substb\ f\ {\isaliteral{28}{\isacharparenleft}}And\ b{\isadigit{1}}\ b{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ And\ {\isaliteral{28}{\isacharparenleft}}substb\ f\ b{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}substb\ f\ b{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 561 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}substb\ f\ {\isaliteral{28}{\isacharparenleft}}Neg\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Neg\ {\isaliteral{28}{\isacharparenleft}}substb\ f\ b{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 562 | \begin{isamarkuptext}%
 | |
| 563 | In textbooks about semantics one often finds substitution | |
| 564 | theorems, which express the relationship between substitution and | |
| 565 |   evaluation.  For \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ aexp{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ bexp{\isaliteral{22}{\isachardoublequote}}}, we can prove
 | |
| 566 | such a theorem by mutual induction, followed by simplification.% | |
| 567 | \end{isamarkuptext}%
 | |
| 568 | \isamarkuptrue% | |
| 569 | \isacommand{lemma}\isamarkupfalse%
 | |
| 570 | \ subst{\isaliteral{5F}{\isacharunderscore}}one{\isaliteral{3A}{\isacharcolon}}\isanewline
 | |
| 571 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}substa\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isaliteral{28}{\isacharparenleft}}v\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{27}{\isacharprime}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ a{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evala\ {\isaliteral{28}{\isacharparenleft}}env\ {\isaliteral{28}{\isacharparenleft}}v\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ evala\ env\ a{\isaliteral{27}{\isacharprime}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ a{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 572 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}evalb\ env\ {\isaliteral{28}{\isacharparenleft}}substb\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isaliteral{28}{\isacharparenleft}}v\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{27}{\isacharprime}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evalb\ {\isaliteral{28}{\isacharparenleft}}env\ {\isaliteral{28}{\isacharparenleft}}v\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ evala\ env\ a{\isaliteral{27}{\isacharprime}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 573 | % | |
| 574 | \isadelimproof | |
| 575 | \ \ % | |
| 576 | \endisadelimproof | |
| 577 | % | |
| 578 | \isatagproof | |
| 579 | \isacommand{by}\isamarkupfalse%
 | |
| 580 | \ {\isaliteral{28}{\isacharparenleft}}induct\ a\ \isakeyword{and}\ b{\isaliteral{29}{\isacharparenright}}\ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | |
| 581 | \endisatagproof | |
| 582 | {\isafoldproof}%
 | |
| 583 | % | |
| 584 | \isadelimproof | |
| 585 | \isanewline | |
| 586 | % | |
| 587 | \endisadelimproof | |
| 588 | \isanewline | |
| 589 | \isacommand{lemma}\isamarkupfalse%
 | |
| 590 | \ subst{\isaliteral{5F}{\isacharunderscore}}all{\isaliteral{3A}{\isacharcolon}}\isanewline
 | |
| 591 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}evala\ env\ {\isaliteral{28}{\isacharparenleft}}substa\ s\ a{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evala\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ evala\ env\ {\isaliteral{28}{\isacharparenleft}}s\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ a{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 592 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}evalb\ env\ {\isaliteral{28}{\isacharparenleft}}substb\ s\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ evalb\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ evala\ env\ {\isaliteral{28}{\isacharparenleft}}s\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 593 | % | |
| 594 | \isadelimproof | |
| 595 | \ \ % | |
| 596 | \endisadelimproof | |
| 597 | % | |
| 598 | \isatagproof | |
| 599 | \isacommand{by}\isamarkupfalse%
 | |
| 600 | \ {\isaliteral{28}{\isacharparenleft}}induct\ a\ \isakeyword{and}\ b{\isaliteral{29}{\isacharparenright}}\ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | |
| 601 | \endisatagproof | |
| 602 | {\isafoldproof}%
 | |
| 603 | % | |
| 604 | \isadelimproof | |
| 605 | % | |
| 606 | \endisadelimproof | |
| 607 | % | |
| 608 | \isamarkupsubsubsection{Example: a substitution function for terms%
 | |
| 609 | } | |
| 610 | \isamarkuptrue% | |
| 611 | % | |
| 612 | \begin{isamarkuptext}%
 | |
| 613 | Functions on datatypes with nested recursion are also defined | |
| 614 | by mutual primitive recursion.% | |
| 615 | \end{isamarkuptext}%
 | |
| 616 | \isamarkuptrue% | |
| 617 | \isacommand{datatype}\isamarkupfalse%
 | |
| 618 | \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{22}{\isachardoublequoteopen}}term{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{3D}{\isacharequal}}\ Var\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{7C}{\isacharbar}}\ App\ {\isaliteral{27}{\isacharprime}}b\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term\ list{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 619 | \begin{isamarkuptext}%
 | |
| 620 | A substitution function on type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term{\isaliteral{22}{\isachardoublequote}}} can be
 | |
| 621 |   defined as follows, by working simultaneously on \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term\ list{\isaliteral{22}{\isachardoublequote}}}:%
 | |
| 622 | \end{isamarkuptext}%
 | |
| 623 | \isamarkuptrue% | |
| 624 | \isacommand{primrec}\isamarkupfalse%
 | |
| 625 | \ subst{\isaliteral{5F}{\isacharunderscore}}term\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{and}\isanewline
 | |
| 626 | \ \ subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term\ list\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term\ list{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 627 | \isakeyword{where}\isanewline
 | |
| 628 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term\ f\ {\isaliteral{28}{\isacharparenleft}}Var\ a{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ f\ a{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 629 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term\ f\ {\isaliteral{28}{\isacharparenleft}}App\ b\ ts{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ App\ b\ {\isaliteral{28}{\isacharparenleft}}subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f\ ts{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 630 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 631 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f\ {\isaliteral{28}{\isacharparenleft}}t\ {\isaliteral{23}{\isacharhash}}\ ts{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ subst{\isaliteral{5F}{\isacharunderscore}}term\ f\ t\ {\isaliteral{23}{\isacharhash}}\ subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f\ ts{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 632 | \begin{isamarkuptext}%
 | |
| 633 | The recursion scheme follows the structure of the unfolded | |
| 634 |   definition of type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ term{\isaliteral{22}{\isachardoublequote}}}.  To prove properties of this
 | |
| 635 | substitution function, mutual induction is needed:% | |
| 636 | \end{isamarkuptext}%
 | |
| 637 | \isamarkuptrue% | |
| 638 | \isacommand{lemma}\isamarkupfalse%
 | |
| 639 | \ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term\ {\isaliteral{28}{\isacharparenleft}}subst{\isaliteral{5F}{\isacharunderscore}}term\ f{\isadigit{1}}\ {\isaliteral{5C3C636972633E}{\isasymcirc}}\ f{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{3D}{\isacharequal}}\ subst{\isaliteral{5F}{\isacharunderscore}}term\ f{\isadigit{1}}\ {\isaliteral{28}{\isacharparenleft}}subst{\isaliteral{5F}{\isacharunderscore}}term\ f{\isadigit{2}}\ t{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{and}\isanewline
 | |
| 640 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ {\isaliteral{28}{\isacharparenleft}}subst{\isaliteral{5F}{\isacharunderscore}}term\ f{\isadigit{1}}\ {\isaliteral{5C3C636972633E}{\isasymcirc}}\ f{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ ts\ {\isaliteral{3D}{\isacharequal}}\ subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f{\isadigit{1}}\ {\isaliteral{28}{\isacharparenleft}}subst{\isaliteral{5F}{\isacharunderscore}}term{\isaliteral{5F}{\isacharunderscore}}list\ f{\isadigit{2}}\ ts{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 641 | % | |
| 642 | \isadelimproof | |
| 643 | \ \ % | |
| 644 | \endisadelimproof | |
| 645 | % | |
| 646 | \isatagproof | |
| 647 | \isacommand{by}\isamarkupfalse%
 | |
| 648 | \ {\isaliteral{28}{\isacharparenleft}}induct\ t\ \isakeyword{and}\ ts{\isaliteral{29}{\isacharparenright}}\ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | |
| 649 | \endisatagproof | |
| 650 | {\isafoldproof}%
 | |
| 651 | % | |
| 652 | \isadelimproof | |
| 653 | % | |
| 654 | \endisadelimproof | |
| 655 | % | |
| 656 | \isamarkupsubsubsection{Example: a map function for infinitely branching trees%
 | |
| 657 | } | |
| 658 | \isamarkuptrue% | |
| 659 | % | |
| 660 | \begin{isamarkuptext}%
 | |
| 661 | Defining functions on infinitely branching datatypes by | |
| 662 | primitive recursion is just as easy.% | |
| 663 | \end{isamarkuptext}%
 | |
| 664 | \isamarkuptrue% | |
| 665 | \isacommand{datatype}\isamarkupfalse%
 | |
| 666 | \ {\isaliteral{27}{\isacharprime}}a\ tree\ {\isaliteral{3D}{\isacharequal}}\ Atom\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{7C}{\isacharbar}}\ Branch\ {\isaliteral{22}{\isachardoublequoteopen}}nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ tree{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 667 | \isanewline | |
| 668 | \isacommand{primrec}\isamarkupfalse%
 | |
| 669 | \ map{\isaliteral{5F}{\isacharunderscore}}tree\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}a\ tree\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ tree{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 670 | \isakeyword{where}\isanewline
 | |
| 671 | \ \ {\isaliteral{22}{\isachardoublequoteopen}}map{\isaliteral{5F}{\isacharunderscore}}tree\ f\ {\isaliteral{28}{\isacharparenleft}}Atom\ a{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Atom\ {\isaliteral{28}{\isacharparenleft}}f\ a{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 672 | {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}map{\isaliteral{5F}{\isacharunderscore}}tree\ f\ {\isaliteral{28}{\isacharparenleft}}Branch\ ts{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ Branch\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ map{\isaliteral{5F}{\isacharunderscore}}tree\ f\ {\isaliteral{28}{\isacharparenleft}}ts\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 673 | \begin{isamarkuptext}%
 | |
| 674 | Note that all occurrences of functions such as \isa{ts}
 | |
| 675 |   above must be applied to an argument.  In particular, \isa{{\isaliteral{22}{\isachardoublequote}}map{\isaliteral{5F}{\isacharunderscore}}tree\ f\ {\isaliteral{5C3C636972633E}{\isasymcirc}}\ ts{\isaliteral{22}{\isachardoublequote}}} is not allowed here.%
 | |
| 676 | \end{isamarkuptext}%
 | |
| 677 | \isamarkuptrue% | |
| 678 | % | |
| 679 | \begin{isamarkuptext}%
 | |
| 680 | Here is a simple composition lemma for \isa{map{\isaliteral{5F}{\isacharunderscore}}tree}:%
 | |
| 681 | \end{isamarkuptext}%
 | |
| 682 | \isamarkuptrue% | |
| 683 | \isacommand{lemma}\isamarkupfalse%
 | |
| 684 | \ {\isaliteral{22}{\isachardoublequoteopen}}map{\isaliteral{5F}{\isacharunderscore}}tree\ g\ {\isaliteral{28}{\isacharparenleft}}map{\isaliteral{5F}{\isacharunderscore}}tree\ f\ t{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ map{\isaliteral{5F}{\isacharunderscore}}tree\ {\isaliteral{28}{\isacharparenleft}}g\ {\isaliteral{5C3C636972633E}{\isasymcirc}}\ f{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 685 | % | |
| 686 | \isadelimproof | |
| 687 | \ \ % | |
| 688 | \endisadelimproof | |
| 689 | % | |
| 690 | \isatagproof | |
| 691 | \isacommand{by}\isamarkupfalse%
 | |
| 692 | \ {\isaliteral{28}{\isacharparenleft}}induct\ t{\isaliteral{29}{\isacharparenright}}\ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | |
| 693 | \endisatagproof | |
| 694 | {\isafoldproof}%
 | |
| 695 | % | |
| 696 | \isadelimproof | |
| 697 | % | |
| 698 | \endisadelimproof | |
| 699 | % | |
| 26849 | 700 | \isamarkupsubsection{Proof methods related to recursive definitions%
 | 
| 701 | } | |
| 702 | \isamarkuptrue% | |
| 703 | % | |
| 704 | \begin{isamarkuptext}%
 | |
| 705 | \begin{matharray}{rcl}
 | |
| 40406 | 706 |     \indexdef{HOL}{method}{pat\_completeness}\hypertarget{method.HOL.pat-completeness}{\hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isaliteral{5F}{\isacharunderscore}}completeness}}}} & : & \isa{method} \\
 | 
| 28788 | 707 |     \indexdef{HOL}{method}{relation}\hypertarget{method.HOL.relation}{\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}} & : & \isa{method} \\
 | 
| 40406 | 708 |     \indexdef{HOL}{method}{lexicographic\_order}\hypertarget{method.HOL.lexicographic-order}{\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isaliteral{5F}{\isacharunderscore}}order}}}} & : & \isa{method} \\
 | 
| 709 |     \indexdef{HOL}{method}{size\_change}\hypertarget{method.HOL.size-change}{\hyperlink{method.HOL.size-change}{\mbox{\isa{size{\isaliteral{5F}{\isacharunderscore}}change}}}} & : & \isa{method} \\
 | |
| 26849 | 710 |   \end{matharray}
 | 
| 711 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 712 |   \begin{railoutput}
 | 
| 42662 | 713 | \rail@begin{1}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 714 | \rail@term{\hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 715 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 716 | \rail@end | 
| 42662 | 717 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 718 | \rail@term{\hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isaliteral{5F}{\isacharunderscore}}order}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 719 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 720 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 721 | \rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 722 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 723 | \rail@end | 
| 42662 | 724 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 725 | \rail@term{\hyperlink{method.HOL.size-change}{\mbox{\isa{size{\isaliteral{5F}{\isacharunderscore}}change}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 726 | \rail@nont{\isa{orders}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 727 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 728 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 729 | \rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 730 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 731 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 732 | \rail@begin{4}{\isa{orders}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 733 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 734 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 735 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 736 | \rail@term{\isa{max}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 737 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 738 | \rail@term{\isa{min}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 739 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 740 | \rail@term{\isa{ms}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 741 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 742 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 743 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 744 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 745 | |
| 26849 | 746 | |
| 28788 | 747 |   \begin{description}
 | 
| 26849 | 748 | |
| 40406 | 749 |   \item \hyperlink{method.HOL.pat-completeness}{\mbox{\isa{pat{\isaliteral{5F}{\isacharunderscore}}completeness}}} is a specialized method to
 | 
| 26849 | 750 | solve goals regarding the completeness of pattern matching, as | 
| 26902 | 751 |   required by the \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} package (cf.\
 | 
| 26849 | 752 |   \cite{isabelle-function}).
 | 
| 753 | ||
| 28788 | 754 |   \item \hyperlink{method.HOL.relation}{\mbox{\isa{relation}}}~\isa{R} introduces a termination
 | 
| 26849 | 755 |   proof using the relation \isa{R}.  The resulting proof state will
 | 
| 756 |   contain goals expressing that \isa{R} is wellfounded, and that the
 | |
| 757 |   arguments of recursive calls decrease with respect to \isa{R}.
 | |
| 758 | Usually, this method is used as the initial proof step of manual | |
| 759 | termination proofs. | |
| 760 | ||
| 40406 | 761 |   \item \hyperlink{method.HOL.lexicographic-order}{\mbox{\isa{lexicographic{\isaliteral{5F}{\isacharunderscore}}order}}} attempts a fully
 | 
| 26849 | 762 | automated termination proof by searching for a lexicographic | 
| 763 | combination of size measures on the arguments of the function. The | |
| 26902 | 764 |   method accepts the same arguments as the \hyperlink{method.auto}{\mbox{\isa{auto}}} method,
 | 
| 42930 | 765 |   which it uses internally to prove local descents.  The \hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}} modifiers are accepted (as for \hyperlink{method.auto}{\mbox{\isa{auto}}}).
 | 
| 26849 | 766 | |
| 767 | In case of failure, extensive information is printed, which can help | |
| 768 |   to analyse the situation (cf.\ \cite{isabelle-function}).
 | |
| 769 | ||
| 40406 | 770 |   \item \hyperlink{method.HOL.size-change}{\mbox{\isa{size{\isaliteral{5F}{\isacharunderscore}}change}}} also works on termination goals,
 | 
| 33858 | 771 | using a variation of the size-change principle, together with a | 
| 772 |   graph decomposition technique (see \cite{krauss_phd} for details).
 | |
| 773 |   Three kinds of orders are used internally: \isa{max}, \isa{min},
 | |
| 774 |   and \isa{ms} (multiset), which is only available when the theory
 | |
| 775 |   \isa{Multiset} is loaded. When no order kinds are given, they are
 | |
| 776 | tried in order. The search for a termination proof uses SAT solving | |
| 777 | internally. | |
| 778 | ||
| 42930 | 779 |   For local descent proofs, the \hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}} modifiers are
 | 
| 780 |   accepted (as for \hyperlink{method.auto}{\mbox{\isa{auto}}}).
 | |
| 33858 | 781 | |
| 28788 | 782 |   \end{description}%
 | 
| 26849 | 783 | \end{isamarkuptext}%
 | 
| 784 | \isamarkuptrue% | |
| 785 | % | |
| 40171 | 786 | \isamarkupsubsection{Functions with explicit partiality%
 | 
| 787 | } | |
| 788 | \isamarkuptrue% | |
| 789 | % | |
| 790 | \begin{isamarkuptext}%
 | |
| 791 | \begin{matharray}{rcl}
 | |
| 40406 | 792 |     \indexdef{HOL}{command}{partial\_function}\hypertarget{command.HOL.partial-function}{\hyperlink{command.HOL.partial-function}{\mbox{\isa{\isacommand{partial{\isaliteral{5F}{\isacharunderscore}}function}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 793 |     \indexdef{HOL}{attribute}{partial\_function\_mono}\hypertarget{attribute.HOL.partial-function-mono}{\hyperlink{attribute.HOL.partial-function-mono}{\mbox{\isa{partial{\isaliteral{5F}{\isacharunderscore}}function{\isaliteral{5F}{\isacharunderscore}}mono}}}} & : & \isa{attribute} \\
 | |
| 40171 | 794 |   \end{matharray}
 | 
| 795 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 796 |   \begin{railoutput}
 | 
| 42662 | 797 | \rail@begin{5}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 798 | \rail@term{\hyperlink{command.HOL.partial-function}{\mbox{\isa{\isacommand{partial{\isaliteral{5F}{\isacharunderscore}}function}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 799 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 800 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 801 | \rail@nont{\hyperlink{syntax.target}{\mbox{\isa{target}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 802 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 803 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 42617 | 804 | \rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 805 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 806 | \rail@nont{\hyperlink{syntax.fixes}{\mbox{\isa{fixes}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 807 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 808 | \rail@term{\isa{\isakeyword{where}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 809 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 810 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 811 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 812 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 813 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 814 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 815 | \end{railoutput}
 | 
| 42617 | 816 | |
| 40171 | 817 | |
| 818 |   \begin{description}
 | |
| 819 | ||
| 42617 | 820 |   \item \hyperlink{command.HOL.partial-function}{\mbox{\isa{\isacommand{partial{\isaliteral{5F}{\isacharunderscore}}function}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}mode{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} defines
 | 
| 821 | recursive functions based on fixpoints in complete partial | |
| 822 | orders. No termination proof is required from the user or | |
| 823 | constructed internally. Instead, the possibility of non-termination | |
| 824 | is modelled explicitly in the result type, which contains an | |
| 825 | explicit bottom element. | |
| 40171 | 826 | |
| 827 | Pattern matching and mutual recursion are currently not supported. | |
| 828 | Thus, the specification consists of a single function described by a | |
| 829 | single recursive equation. | |
| 830 | ||
| 831 | There are no fixed syntactic restrictions on the body of the | |
| 832 | function, but the induced functional must be provably monotonic | |
| 833 | wrt.\ the underlying order. The monotonicitity proof is performed | |
| 834 | internally, and the definition is rejected when it fails. The proof | |
| 835 | can be influenced by declaring hints using the | |
| 40406 | 836 |   \hyperlink{attribute.HOL.partial-function-mono}{\mbox{\isa{partial{\isaliteral{5F}{\isacharunderscore}}function{\isaliteral{5F}{\isacharunderscore}}mono}}} attribute.
 | 
| 40171 | 837 | |
| 838 |   The mandatory \isa{mode} argument specifies the mode of operation
 | |
| 839 | of the command, which directly corresponds to a complete partial | |
| 840 | order on the result type. By default, the following modes are | |
| 42123 | 841 | defined: | 
| 40171 | 842 | |
| 843 |   \begin{description}
 | |
| 844 |   \item \isa{option} defines functions that map into the \isa{option} type. Here, the value \isa{None} is used to model a
 | |
| 845 |   non-terminating computation. Monotonicity requires that if \isa{None} is returned by a recursive call, then the overall result
 | |
| 846 |   must also be \isa{None}. This is best achieved through the use of
 | |
| 40406 | 847 |   the monadic operator \isa{{\isaliteral{22}{\isachardoublequote}}Option{\isaliteral{2E}{\isachardot}}bind{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 42123 | 848 | |
| 40171 | 849 |   \item \isa{tailrec} defines functions with an arbitrary result
 | 
| 40406 | 850 |   type and uses the slightly degenerated partial order where \isa{{\isaliteral{22}{\isachardoublequote}}undefined{\isaliteral{22}{\isachardoublequote}}} is the bottom element.  Now, monotonicity requires that
 | 
| 40171 | 851 |   if \isa{undefined} is returned by a recursive call, then the
 | 
| 852 |   overall result must also be \isa{undefined}. In practice, this is
 | |
| 853 | only satisfied when each recursive call is a tail call, whose result | |
| 854 | is directly returned. Thus, this mode of operation allows the | |
| 855 | definition of arbitrary tail-recursive functions. | |
| 856 |   \end{description}
 | |
| 857 | ||
| 858 | Experienced users may define new modes by instantiating the locale | |
| 40406 | 859 |   \isa{{\isaliteral{22}{\isachardoublequote}}partial{\isaliteral{5F}{\isacharunderscore}}function{\isaliteral{5F}{\isacharunderscore}}definitions{\isaliteral{22}{\isachardoublequote}}} appropriately.
 | 
| 40171 | 860 | |
| 40406 | 861 |   \item \hyperlink{attribute.HOL.partial-function-mono}{\mbox{\isa{partial{\isaliteral{5F}{\isacharunderscore}}function{\isaliteral{5F}{\isacharunderscore}}mono}}} declares rules for
 | 
| 40171 | 862 | use in the internal monononicity proofs of partial function | 
| 863 | definitions. | |
| 864 | ||
| 865 |   \end{description}%
 | |
| 866 | \end{isamarkuptext}%
 | |
| 867 | \isamarkuptrue% | |
| 868 | % | |
| 26849 | 869 | \isamarkupsubsection{Old-style recursive function definitions (TFL)%
 | 
| 870 | } | |
| 871 | \isamarkuptrue% | |
| 872 | % | |
| 873 | \begin{isamarkuptext}%
 | |
| 40406 | 874 | The old TFL commands \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} and \hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isaliteral{5F}{\isacharunderscore}}tc}}}} for defining recursive are mostly obsolete; \hyperlink{command.HOL.function}{\mbox{\isa{\isacommand{function}}}} or \hyperlink{command.HOL.fun}{\mbox{\isa{\isacommand{fun}}}} should be used instead.
 | 
| 26849 | 875 | |
| 876 |   \begin{matharray}{rcl}
 | |
| 40406 | 877 |     \indexdef{HOL}{command}{recdef}\hypertarget{command.HOL.recdef}{\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 878 |     \indexdef{HOL}{command}{recdef\_tc}\hypertarget{command.HOL.recdef-tc}{\hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isaliteral{5F}{\isacharunderscore}}tc}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 26849 | 879 |   \end{matharray}
 | 
| 880 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 881 |   \begin{railoutput}
 | 
| 42662 | 882 | \rail@begin{5}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 883 | \rail@term{\hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 884 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 885 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 886 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 887 | \rail@term{\isa{\isakeyword{permissive}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 888 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 889 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 890 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 891 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 892 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 893 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 894 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 895 | \rail@nextplus{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 896 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 897 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 898 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 899 | \rail@nont{\isa{hints}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 900 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 901 | \rail@end | 
| 42662 | 902 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 903 | \rail@nont{\isa{recdeftc}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 904 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 905 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 906 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 907 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 908 | \rail@nont{\isa{tc}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 909 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 910 | \rail@begin{2}{\isa{hints}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 911 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 912 | \rail@term{\isa{\isakeyword{hints}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 913 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 914 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 915 | \rail@cnont{\isa{recdefmod}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 916 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 917 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 918 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 919 | \rail@begin{4}{\isa{recdefmod}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 920 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 921 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 922 | \rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 923 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 924 | \rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 925 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 926 | \rail@term{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 927 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 928 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 929 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 930 | \rail@term{\isa{add}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 931 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 932 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 933 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 934 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 935 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 936 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 937 | \rail@nont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 938 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 939 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 940 | \rail@begin{2}{\isa{tc}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 941 | \rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 942 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 943 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 944 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 945 | \rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 946 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 947 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 948 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 949 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 950 | |
| 26849 | 951 | |
| 28788 | 952 |   \begin{description}
 | 
| 42123 | 953 | |
| 28788 | 954 |   \item \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} defines general well-founded
 | 
| 26849 | 955 | recursive functions (using the TFL package), see also | 
| 40406 | 956 |   \cite{isabelle-HOL}.  The ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}permissive{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' option tells
 | 
| 26849 | 957 | TFL to recover from failed proof attempts, returning unfinished | 
| 40406 | 958 |   results.  The \isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}, \isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}, and \isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf} hints refer to auxiliary rules to be used in the internal
 | 
| 26902 | 959 |   automated proof process of TFL.  Additional \hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}
 | 
| 42930 | 960 | declarations may be given to tune the context of the Simplifier | 
| 961 |   (cf.\ \secref{sec:simplifier}) and Classical reasoner (cf.\
 | |
| 962 |   \secref{sec:classical}).
 | |
| 42123 | 963 | |
| 40406 | 964 |   \item \hyperlink{command.HOL.recdef-tc}{\mbox{\isa{\isacommand{recdef{\isaliteral{5F}{\isacharunderscore}}tc}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{28}{\isacharparenleft}}i{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} recommences the
 | 
| 26849 | 965 |   proof for leftover termination condition number \isa{i} (default
 | 
| 26902 | 966 |   1) as generated by a \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} definition of
 | 
| 26849 | 967 |   constant \isa{c}.
 | 
| 42123 | 968 | |
| 26902 | 969 |   Note that in most cases, \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} is able to finish
 | 
| 26849 | 970 | its internal proofs without manual intervention. | 
| 971 | ||
| 28788 | 972 |   \end{description}
 | 
| 26849 | 973 | |
| 26902 | 974 |   \medskip Hints for \hyperlink{command.HOL.recdef}{\mbox{\isa{\isacommand{recdef}}}} may be also declared
 | 
| 26849 | 975 | globally, using the following attributes. | 
| 976 | ||
| 977 |   \begin{matharray}{rcl}
 | |
| 40406 | 978 |     \indexdef{HOL}{attribute}{recdef\_simp}\hypertarget{attribute.HOL.recdef-simp}{\hyperlink{attribute.HOL.recdef-simp}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}}}} & : & \isa{attribute} \\
 | 
| 979 |     \indexdef{HOL}{attribute}{recdef\_cong}\hypertarget{attribute.HOL.recdef-cong}{\hyperlink{attribute.HOL.recdef-cong}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}}}} & : & \isa{attribute} \\
 | |
| 980 |     \indexdef{HOL}{attribute}{recdef\_wf}\hypertarget{attribute.HOL.recdef-wf}{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}}} & : & \isa{attribute} \\
 | |
| 26849 | 981 |   \end{matharray}
 | 
| 982 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 983 |   \begin{railoutput}
 | 
| 42662 | 984 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 985 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 986 | \rail@term{\hyperlink{attribute.HOL.recdef-simp}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}simp}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 987 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 988 | \rail@term{\hyperlink{attribute.HOL.recdef-cong}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}cong}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 989 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 990 | \rail@term{\hyperlink{attribute.HOL.recdef-wf}{\mbox{\isa{recdef{\isaliteral{5F}{\isacharunderscore}}wf}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 991 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 992 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 993 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 994 | \rail@term{\isa{add}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 995 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 996 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 997 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 998 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 999 | \end{railoutput}%
 | 
| 26849 | 1000 | \end{isamarkuptext}%
 | 
| 1001 | \isamarkuptrue% | |
| 1002 | % | |
| 42908 | 1003 | \isamarkupsection{Datatypes \label{sec:hol-datatype}%
 | 
| 26849 | 1004 | } | 
| 1005 | \isamarkuptrue% | |
| 1006 | % | |
| 1007 | \begin{isamarkuptext}%
 | |
| 42908 | 1008 | \begin{matharray}{rcl}
 | 
| 1009 |     \indexdef{HOL}{command}{datatype}\hypertarget{command.HOL.datatype}{\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1010 |     \indexdef{HOL}{command}{rep\_datatype}\hypertarget{command.HOL.rep-datatype}{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 26849 | 1011 |   \end{matharray}
 | 
| 1012 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1013 |   \begin{railoutput}
 | 
| 42908 | 1014 | \rail@begin{2}{}
 | 
| 1015 | \rail@term{\hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}}}[]
 | |
| 1016 | \rail@plus | |
| 1017 | \rail@nont{\isa{spec}}[]
 | |
| 1018 | \rail@nextplus{1}
 | |
| 1019 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | |
| 1020 | \rail@endplus | |
| 1021 | \rail@end | |
| 1022 | \rail@begin{3}{}
 | |
| 1023 | \rail@term{\hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}}}[]
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1024 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1025 | \rail@nextbar{1}
 | 
| 42908 | 1026 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 1027 | \rail@plus | |
| 1028 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1029 | \rail@nextplus{2}
 | |
| 1030 | \rail@endplus | |
| 1031 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1032 | \rail@endbar | 
| 42908 | 1033 | \rail@plus | 
| 1034 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | |
| 1035 | \rail@nextplus{1}
 | |
| 1036 | \rail@endplus | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1037 | \rail@end | 
| 42908 | 1038 | \rail@begin{2}{\isa{spec}}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1039 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1040 | \rail@nextbar{1}
 | 
| 42908 | 1041 | \rail@nont{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1042 | \rail@endbar | 
| 42908 | 1043 | \rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
 | 
| 1044 | \rail@bar | |
| 1045 | \rail@nextbar{1}
 | |
| 1046 | \rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
 | |
| 1047 | \rail@endbar | |
| 1048 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | |
| 1049 | \rail@plus | |
| 1050 | \rail@nont{\isa{cons}}[]
 | |
| 1051 | \rail@nextplus{1}
 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1052 | \rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1053 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1054 | \rail@end | 
| 42908 | 1055 | \rail@begin{2}{\isa{cons}}
 | 
| 1056 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1057 | \rail@plus | |
| 1058 | \rail@nextplus{1}
 | |
| 1059 | \rail@cnont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
 | |
| 1060 | \rail@endplus | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1061 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1062 | \rail@nextbar{1}
 | 
| 42908 | 1063 | \rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1064 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1065 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1066 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1067 | |
| 26849 | 1068 | |
| 28788 | 1069 |   \begin{description}
 | 
| 26849 | 1070 | |
| 42908 | 1071 |   \item \hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} defines inductive datatypes in
 | 
| 1072 | HOL. | |
| 1073 | ||
| 1074 |   \item \hyperlink{command.HOL.rep-datatype}{\mbox{\isa{\isacommand{rep{\isaliteral{5F}{\isacharunderscore}}datatype}}}} represents existing types as
 | |
| 42909 | 1075 | datatypes. | 
| 1076 | ||
| 1077 |   For foundational reasons, some basic types such as \isa{nat}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{2B}{\isacharplus}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{22}{\isachardoublequote}}}, \isa{bool} and \isa{unit} are
 | |
| 1078 |   introduced by more primitive means using \indexref{}{command}{typedef}\hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}}.  To
 | |
| 1079 |   recover the rich infrastructure of \hyperlink{command.datatype}{\mbox{\isa{\isacommand{datatype}}}} (e.g.\ rules
 | |
| 1080 |   for \hyperlink{method.cases}{\mbox{\isa{cases}}} and \hyperlink{method.induct}{\mbox{\isa{induct}}} and the primitive recursion
 | |
| 1081 | combinators), such types may be represented as actual datatypes | |
| 1082 | later. This is done by specifying the constructors of the desired | |
| 1083 | type, and giving a proof of the induction rule, distinctness and | |
| 1084 | injectivity of constructors. | |
| 1085 | ||
| 1086 | For example, see \verb|~~/src/HOL/Sum_Type.thy| for the | |
| 1087 | representation of the primitive sum type as fully-featured datatype. | |
| 42908 | 1088 | |
| 1089 |   \end{description}
 | |
| 1090 | ||
| 42909 | 1091 |   The generated rules for \hyperlink{method.induct}{\mbox{\isa{induct}}} and \hyperlink{method.cases}{\mbox{\isa{cases}}} provide
 | 
| 1092 | case names according to the given constructors, while parameters are | |
| 1093 |   named after the types (see also \secref{sec:cases-induct}).
 | |
| 42908 | 1094 | |
| 1095 |   See \cite{isabelle-HOL} for more details on datatypes, but beware of
 | |
| 1096 | the old-style theory syntax being used there! Apart from proper | |
| 1097 | proof methods for case-analysis and induction, there are also | |
| 1098 |   emulations of ML tactics \hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}} and \hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}} available, see \secref{sec:hol-induct-tac}; these admit
 | |
| 1099 | to refer directly to the internal structure of subgoals (including | |
| 1100 | internally bound parameters).% | |
| 1101 | \end{isamarkuptext}%
 | |
| 1102 | \isamarkuptrue% | |
| 1103 | % | |
| 42910 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1104 | \isamarkupsubsubsection{Examples%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1105 | } | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1106 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1107 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1108 | \begin{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1109 | We define a type of finite sequences, with slightly different | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1110 |   names than the existing \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{27}{\isacharprime}}a\ list{\isaliteral{22}{\isachardoublequote}}} that is already in \hyperlink{theory.Main}{\mbox{\isa{Main}}}:%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1111 | \end{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1112 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1113 | \isacommand{datatype}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1114 | \ {\isaliteral{27}{\isacharprime}}a\ seq\ {\isaliteral{3D}{\isacharequal}}\ Empty\ {\isaliteral{7C}{\isacharbar}}\ Seq\ {\isaliteral{27}{\isacharprime}}a\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ seq{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1115 | \begin{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1116 | We can now prove some simple lemma by structural induction:% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1117 | \end{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1118 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1119 | \isacommand{lemma}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1120 | \ {\isaliteral{22}{\isachardoublequoteopen}}Seq\ x\ xs\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ xs{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1121 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1122 | \isadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1123 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1124 | \endisadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1125 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1126 | \isatagproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1127 | \isacommand{proof}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1128 | \ {\isaliteral{28}{\isacharparenleft}}induct\ xs\ arbitrary{\isaliteral{3A}{\isacharcolon}}\ x{\isaliteral{29}{\isacharparenright}}\isanewline
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1129 | \ \ \isacommand{case}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1130 | \ Empty% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1131 | \begin{isamarkuptxt}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1132 | This case can be proved using the simplifier: the freeness | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1133 |     properties of the datatype are already declared as \hyperlink{attribute.simp}{\mbox{\isa{simp}}} rules.%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1134 | \end{isamarkuptxt}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1135 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1136 | \ \ \isacommand{show}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1137 | \ {\isaliteral{22}{\isachardoublequoteopen}}Seq\ x\ Empty\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ Empty{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1138 | \ \ \ \ \isacommand{by}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1139 | \ simp\isanewline | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1140 | \isacommand{next}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1141 | \isanewline | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1142 | \ \ \isacommand{case}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1143 | \ {\isaliteral{28}{\isacharparenleft}}Seq\ y\ ys{\isaliteral{29}{\isacharparenright}}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1144 | \begin{isamarkuptxt}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1145 | The step case is proved similarly.% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1146 | \end{isamarkuptxt}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1147 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1148 | \ \ \isacommand{show}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1149 | \ {\isaliteral{22}{\isachardoublequoteopen}}Seq\ x\ {\isaliteral{28}{\isacharparenleft}}Seq\ y\ ys{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ Seq\ y\ ys{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1150 | \ \ \ \ \isacommand{using}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1151 | \ {\isaliteral{60}{\isacharbackquoteopen}}Seq\ y\ ys\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ ys{\isaliteral{60}{\isacharbackquoteclose}}\ \isacommand{by}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1152 | \ simp\isanewline | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1153 | \isacommand{qed}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1154 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1155 | \endisatagproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1156 | {\isafoldproof}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1157 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1158 | \isadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1159 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1160 | \endisadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1161 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1162 | \begin{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1163 | Here is a more succinct version of the same proof:% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1164 | \end{isamarkuptext}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1165 | \isamarkuptrue% | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1166 | \isacommand{lemma}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1167 | \ {\isaliteral{22}{\isachardoublequoteopen}}Seq\ x\ xs\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ xs{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1168 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1169 | \isadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1170 | \ \ % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1171 | \endisadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1172 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1173 | \isatagproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1174 | \isacommand{by}\isamarkupfalse%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1175 | \ {\isaliteral{28}{\isacharparenleft}}induct\ xs\ arbitrary{\isaliteral{3A}{\isacharcolon}}\ x{\isaliteral{29}{\isacharparenright}}\ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1176 | \endisatagproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1177 | {\isafoldproof}%
 | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1178 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1179 | \isadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1180 | % | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1181 | \endisadelimproof | 
| 
6834af822a8b
updated and simplified HOL datatype examples (NB: special treatment of distinctness has been discontinued in the vicinity of 542b34b178ec);
 wenzelm parents: 
42909diff
changeset | 1182 | % | 
| 42908 | 1183 | \isamarkupsection{Records \label{sec:hol-record}%
 | 
| 1184 | } | |
| 1185 | \isamarkuptrue% | |
| 1186 | % | |
| 1187 | \begin{isamarkuptext}%
 | |
| 1188 | In principle, records merely generalize the concept of tuples, where | |
| 1189 | components may be addressed by labels instead of just position. The | |
| 1190 | logical infrastructure of records in Isabelle/HOL is slightly more | |
| 1191 | advanced, though, supporting truly extensible record schemes. This | |
| 1192 | admits operations that are polymorphic with respect to record | |
| 1193 | extension, yielding ``object-oriented'' effects like (single) | |
| 1194 |   inheritance.  See also \cite{NaraschewskiW-TPHOLs98} for more
 | |
| 1195 | details on object-oriented verification and record subtyping in HOL.% | |
| 1196 | \end{isamarkuptext}%
 | |
| 1197 | \isamarkuptrue% | |
| 1198 | % | |
| 1199 | \isamarkupsubsection{Basic concepts%
 | |
| 1200 | } | |
| 1201 | \isamarkuptrue% | |
| 1202 | % | |
| 1203 | \begin{isamarkuptext}%
 | |
| 1204 | Isabelle/HOL supports both \emph{fixed} and \emph{schematic} records
 | |
| 1205 | at the level of terms and types. The notation is as follows: | |
| 1206 | ||
| 1207 |   \begin{center}
 | |
| 1208 |   \begin{tabular}{l|l|l}
 | |
| 1209 | & record terms & record types \\ \hline | |
| 1210 |     fixed & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ A{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ B{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1211 |     schematic & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3D}{\isacharequal}}\ m{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} &
 | |
| 1212 |       \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ A{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ B{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ M{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1213 |   \end{tabular}
 | |
| 1214 |   \end{center}
 | |
| 1215 | ||
| 1216 |   \noindent The ASCII representation of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{7C}{\isacharbar}}\ x\ {\isaliteral{3D}{\isacharequal}}\ a\ {\isaliteral{7C}{\isacharbar}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1217 | ||
| 1218 |   A fixed record \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} has field \isa{x} of value
 | |
| 1219 |   \isa{a} and field \isa{y} of value \isa{b}.  The corresponding
 | |
| 1220 |   type is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ A{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ B{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}, assuming that \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ A{\isaliteral{22}{\isachardoublequote}}}
 | |
| 1221 |   and \isa{{\isaliteral{22}{\isachardoublequote}}b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ B{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1222 | ||
| 1223 |   A record scheme like \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3D}{\isacharequal}}\ m{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} contains fields
 | |
| 1224 |   \isa{x} and \isa{y} as before, but also possibly further fields
 | |
| 1225 |   as indicated by the ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}'' notation (which is actually part
 | |
| 1226 |   of the syntax).  The improper field ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}'' of a record
 | |
| 1227 |   scheme is called the \emph{more part}.  Logically it is just a free
 | |
| 1228 | variable, which is occasionally referred to as ``row variable'' in | |
| 1229 | the literature. The more part of a record scheme may be | |
| 1230 | instantiated by zero or more further components. For example, the | |
| 1231 |   previous scheme may get instantiated to \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ z\ {\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3D}{\isacharequal}}\ m{\isaliteral{27}{\isacharprime}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}, where \isa{m{\isaliteral{27}{\isacharprime}}} refers to a different more part.
 | |
| 1232 | Fixed records are special instances of record schemes, where | |
| 1233 |   ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}'' is properly terminated by the \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ unit{\isaliteral{22}{\isachardoublequote}}}
 | |
| 1234 |   element.  In fact, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} is just an abbreviation
 | |
| 1235 |   for \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 26849 | 1236 | |
| 42908 | 1237 | \medskip Two key observations make extensible records in a simply | 
| 1238 | typed language like HOL work out: | |
| 1239 | ||
| 1240 |   \begin{enumerate}
 | |
| 1241 | ||
| 1242 | \item the more part is internalized, as a free term or type | |
| 1243 | variable, | |
| 1244 | ||
| 1245 | \item field names are externalized, they cannot be accessed within | |
| 1246 | the logic as first-class values. | |
| 1247 | ||
| 1248 |   \end{enumerate}
 | |
| 1249 | ||
| 1250 | \medskip In Isabelle/HOL record types have to be defined explicitly, | |
| 1251 | fixing their field names and types, and their (optional) parent | |
| 1252 | record. Afterwards, records may be formed using above syntax, while | |
| 1253 | obeying the canonical order of fields as given by their declaration. | |
| 1254 | The record package provides several standard operations like | |
| 1255 | selectors and updates. The common setup for various generic proof | |
| 1256 | tools enable succinct reasoning patterns. See also the Isabelle/HOL | |
| 1257 |   tutorial \cite{isabelle-hol-book} for further instructions on using
 | |
| 1258 | records in practice.% | |
| 1259 | \end{isamarkuptext}%
 | |
| 1260 | \isamarkuptrue% | |
| 1261 | % | |
| 1262 | \isamarkupsubsection{Record specifications%
 | |
| 1263 | } | |
| 1264 | \isamarkuptrue% | |
| 1265 | % | |
| 1266 | \begin{isamarkuptext}%
 | |
| 1267 | \begin{matharray}{rcl}
 | |
| 1268 |     \indexdef{HOL}{command}{record}\hypertarget{command.HOL.record}{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1269 |   \end{matharray}
 | |
| 26849 | 1270 | |
| 42908 | 1271 |   \begin{railoutput}
 | 
| 1272 | \rail@begin{4}{}
 | |
| 1273 | \rail@term{\hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}}[]
 | |
| 1274 | \rail@nont{\hyperlink{syntax.typespec-sorts}{\mbox{\isa{typespec{\isaliteral{5F}{\isacharunderscore}}sorts}}}}[]
 | |
| 1275 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | |
| 1276 | \rail@cr{2}
 | |
| 1277 | \rail@bar | |
| 1278 | \rail@nextbar{3}
 | |
| 1279 | \rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
 | |
| 1280 | \rail@term{\isa{{\isaliteral{2B}{\isacharplus}}}}[]
 | |
| 1281 | \rail@endbar | |
| 1282 | \rail@plus | |
| 1283 | \rail@nont{\hyperlink{syntax.constdecl}{\mbox{\isa{constdecl}}}}[]
 | |
| 1284 | \rail@nextplus{3}
 | |
| 1285 | \rail@endplus | |
| 1286 | \rail@end | |
| 1287 | \end{railoutput}
 | |
| 1288 | ||
| 1289 | ||
| 1290 |   \begin{description}
 | |
| 1291 | ||
| 1292 |   \item \hyperlink{command.HOL.record}{\mbox{\isa{\isacommand{record}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{2B}{\isacharplus}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} defines extensible record type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}},
 | |
| 1293 |   derived from the optional parent record \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} by adding new
 | |
| 1294 |   field components \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} etc.
 | |
| 1295 | ||
| 1296 |   The type variables of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} need to be
 | |
| 1297 |   covered by the (distinct) parameters \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{22}{\isachardoublequote}}}.  Type constructor \isa{t} has to be new, while \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} needs to specify an instance of an existing record type.  At
 | |
| 1298 |   least one new field \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} has to be specified.
 | |
| 1299 | Basically, field names need to belong to a unique record. This is | |
| 1300 | not a real restriction in practice, since fields are qualified by | |
| 1301 | the record name internally. | |
| 1302 | ||
| 1303 |   The parent record specification \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} is optional; if omitted
 | |
| 1304 |   \isa{t} becomes a root record.  The hierarchy of all records
 | |
| 1305 | declared within a theory context forms a forest structure, i.e.\ a | |
| 1306 | set of trees starting with a root record each. There is no way to | |
| 1307 | merge multiple parent records! | |
| 1308 | ||
| 1309 |   For convenience, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} is made a
 | |
| 1310 |   type abbreviation for the fixed record type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}, likewise is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{5F}{\isacharunderscore}}scheme{\isaliteral{22}{\isachardoublequote}}} made an abbreviation for
 | |
| 1311 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 26849 | 1312 | |
| 28788 | 1313 |   \end{description}%
 | 
| 26849 | 1314 | \end{isamarkuptext}%
 | 
| 1315 | \isamarkuptrue% | |
| 1316 | % | |
| 42908 | 1317 | \isamarkupsubsection{Record operations%
 | 
| 1318 | } | |
| 1319 | \isamarkuptrue% | |
| 1320 | % | |
| 1321 | \begin{isamarkuptext}%
 | |
| 1322 | Any record definition of the form presented above produces certain | |
| 1323 | standard operations. Selectors and updates are provided for any | |
| 1324 |   field, including the improper one ``\isa{more}''.  There are also
 | |
| 1325 | cumulative record constructor functions. To simplify the | |
| 1326 |   presentation below, we assume for now that \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} is a root record with fields \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1327 | ||
| 1328 |   \medskip \textbf{Selectors} and \textbf{updates} are available for
 | |
| 1329 |   any field (including ``\isa{more}''):
 | |
| 1330 | ||
| 1331 |   \begin{matharray}{lll}
 | |
| 1332 |     \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1333 |     \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{5F}{\isacharunderscore}}update{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1334 |   \end{matharray}
 | |
| 1335 | ||
| 1336 |   There is special syntax for application of updates: \isa{{\isaliteral{22}{\isachardoublequote}}r{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} abbreviates term \isa{{\isaliteral{22}{\isachardoublequote}}x{\isaliteral{5F}{\isacharunderscore}}update\ a\ r{\isaliteral{22}{\isachardoublequote}}}.  Further notation for
 | |
| 1337 |   repeated updates is also available: \isa{{\isaliteral{22}{\isachardoublequote}}r{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}z\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} may be written \isa{{\isaliteral{22}{\isachardoublequote}}r{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ z\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}.  Note that
 | |
| 1338 | because of postfix notation the order of fields shown here is | |
| 1339 | reverse than in the actual term. Since repeated updates are just | |
| 1340 |   function applications, fields may be freely permuted in \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ a{\isaliteral{2C}{\isacharcomma}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{2C}{\isacharcomma}}\ z\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3D}{\isacharequal}}\ c{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}}, as far as logical equality is concerned.
 | |
| 1341 | Thus commutativity of independent updates can be proven within the | |
| 1342 | logic for any two fields, but not as a general theorem. | |
| 1343 | ||
| 1344 |   \medskip The \textbf{make} operation provides a cumulative record
 | |
| 1345 | constructor function: | |
| 1346 | ||
| 1347 |   \begin{matharray}{lll}
 | |
| 1348 |     \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}make{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1349 |   \end{matharray}
 | |
| 1350 | ||
| 1351 | \medskip We now reconsider the case of non-root records, which are | |
| 1352 | derived of some parent. In general, the latter may depend on | |
| 1353 |   another parent as well, resulting in a list of \emph{ancestor
 | |
| 1354 | records}. Appending the lists of fields of all ancestors results in | |
| 1355 | a certain field prefix. The record package automatically takes care | |
| 1356 | of this by lifting operations over this context of ancestor fields. | |
| 1357 |   Assuming that \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} has ancestor
 | |
| 1358 |   fields \isa{{\isaliteral{22}{\isachardoublequote}}b\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C72686F3E}{\isasymrho}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub k\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C72686F3E}{\isasymrho}}\isaliteral{5C3C5E7375623E}{}\isactrlsub k{\isaliteral{22}{\isachardoublequote}}},
 | |
| 1359 | the above record operations will get the following types: | |
| 1360 | ||
| 1361 | \medskip | |
| 1362 |   \begin{tabular}{lll}
 | |
| 1363 |     \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1364 |     \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{5F}{\isacharunderscore}}update{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1365 |     \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}make{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C72686F3E}{\isasymrho}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C72686F3E}{\isasymrho}}\isaliteral{5C3C5E7375623E}{}\isactrlsub k\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1366 |   \end{tabular}
 | |
| 1367 | \medskip | |
| 1368 | ||
| 1369 | \noindent Some further operations address the extension aspect of a | |
| 1370 |   derived record scheme specifically: \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}fields{\isaliteral{22}{\isachardoublequote}}} produces a
 | |
| 1371 | record fragment consisting of exactly the new fields introduced here | |
| 1372 |   (the result may serve as a more part elsewhere); \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}extend{\isaliteral{22}{\isachardoublequote}}}
 | |
| 1373 |   takes a fixed record and adds a given more part; \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}truncate{\isaliteral{22}{\isachardoublequote}}} restricts a record scheme to a fixed record.
 | |
| 1374 | ||
| 1375 | \medskip | |
| 1376 |   \begin{tabular}{lll}
 | |
| 1377 |     \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}fields{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1378 |     \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}extend{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1379 |     \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}truncate{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7A6574613E}{\isasymzeta}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C6C706172723E}{\isasymlparr}}\isaliteral{5C3C5E7665633E}{}\isactrlvec b\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C72686F3E}{\isasymrho}}{\isaliteral{2C}{\isacharcomma}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{5C3C72706172723E}{\isasymrparr}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1380 |   \end{tabular}
 | |
| 1381 | \medskip | |
| 1382 | ||
| 1383 |   \noindent Note that \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}make{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}fields{\isaliteral{22}{\isachardoublequote}}} coincide
 | |
| 1384 | for root records.% | |
| 1385 | \end{isamarkuptext}%
 | |
| 1386 | \isamarkuptrue% | |
| 1387 | % | |
| 1388 | \isamarkupsubsection{Derived rules and proof tools%
 | |
| 26849 | 1389 | } | 
| 1390 | \isamarkuptrue% | |
| 1391 | % | |
| 1392 | \begin{isamarkuptext}%
 | |
| 42908 | 1393 | The record package proves several results internally, declaring | 
| 1394 | these facts to appropriate proof tools. This enables users to | |
| 1395 | reason about record structures quite conveniently. Assume that | |
| 1396 |   \isa{t} is a record type as specified above.
 | |
| 1397 | ||
| 1398 |   \begin{enumerate}
 | |
| 1399 | ||
| 1400 | \item Standard conversions for selectors or updates applied to | |
| 1401 | record constructor terms are made part of the default Simplifier | |
| 1402 | context; thus proofs by reduction of basic operations merely require | |
| 1403 |   the \hyperlink{method.simp}{\mbox{\isa{simp}}} method without further arguments.  These rules
 | |
| 1404 |   are available as \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}simps{\isaliteral{22}{\isachardoublequote}}}, too.
 | |
| 1405 | ||
| 1406 | \item Selectors applied to updated records are automatically reduced | |
| 1407 | by an internal simplification procedure, which is also part of the | |
| 1408 | standard Simplifier setup. | |
| 1409 | ||
| 1410 |   \item Inject equations of a form analogous to \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}x{\isaliteral{2C}{\isacharcomma}}\ y{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}x{\isaliteral{27}{\isacharprime}}{\isaliteral{2C}{\isacharcomma}}\ y{\isaliteral{27}{\isacharprime}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ x\ {\isaliteral{3D}{\isacharequal}}\ x{\isaliteral{27}{\isacharprime}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ y\ {\isaliteral{3D}{\isacharequal}}\ y{\isaliteral{27}{\isacharprime}}{\isaliteral{22}{\isachardoublequote}}} are declared to the Simplifier and Classical
 | |
| 1411 |   Reasoner as \hyperlink{attribute.iff}{\mbox{\isa{iff}}} rules.  These rules are available as
 | |
| 1412 |   \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}iffs{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1413 | ||
| 1414 |   \item The introduction rule for record equality analogous to \isa{{\isaliteral{22}{\isachardoublequote}}x\ r\ {\isaliteral{3D}{\isacharequal}}\ x\ r{\isaliteral{27}{\isacharprime}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ y\ r\ {\isaliteral{3D}{\isacharequal}}\ y\ r{\isaliteral{27}{\isacharprime}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ r\ {\isaliteral{3D}{\isacharequal}}\ r{\isaliteral{27}{\isacharprime}}{\isaliteral{22}{\isachardoublequote}}} is declared to the Simplifier,
 | |
| 1415 |   and as the basic rule context as ``\hyperlink{attribute.intro}{\mbox{\isa{intro}}}\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}''.
 | |
| 1416 |   The rule is called \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}equality{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1417 | ||
| 1418 | \item Representations of arbitrary record expressions as canonical | |
| 1419 |   constructor terms are provided both in \hyperlink{method.cases}{\mbox{\isa{cases}}} and \hyperlink{method.induct}{\mbox{\isa{induct}}} format (cf.\ the generic proof methods of the same name,
 | |
| 1420 |   \secref{sec:cases-induct}).  Several variations are available, for
 | |
| 1421 | fixed records, record schemes, more parts etc. | |
| 1422 | ||
| 1423 | The generic proof methods are sufficiently smart to pick the most | |
| 1424 | sensible rule according to the type of the indicated record | |
| 1425 |   expression: users just need to apply something like ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}cases\ r{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' to a certain proof problem.
 | |
| 1426 | ||
| 1427 |   \item The derived record operations \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}make{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}fields{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}extend{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}truncate{\isaliteral{22}{\isachardoublequote}}} are \emph{not}
 | |
| 1428 | treated automatically, but usually need to be expanded by hand, | |
| 1429 |   using the collective fact \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{2E}{\isachardot}}defs{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1430 | ||
| 1431 |   \end{enumerate}%
 | |
| 1432 | \end{isamarkuptext}%
 | |
| 1433 | \isamarkuptrue% | |
| 1434 | % | |
| 42911 | 1435 | \isamarkupsubsubsection{Examples%
 | 
| 1436 | } | |
| 1437 | \isamarkuptrue% | |
| 1438 | % | |
| 1439 | \begin{isamarkuptext}%
 | |
| 1440 | See \verb|~~/src/HOL/ex/Records.thy|, for example.% | |
| 1441 | \end{isamarkuptext}%
 | |
| 1442 | \isamarkuptrue% | |
| 1443 | % | |
| 42908 | 1444 | \isamarkupsection{Adhoc tuples%
 | 
| 1445 | } | |
| 1446 | \isamarkuptrue% | |
| 1447 | % | |
| 1448 | \begin{isamarkuptext}%
 | |
| 1449 | \begin{matharray}{rcl}
 | |
| 1450 |     \indexdef{HOL}{attribute}{split\_format}\hypertarget{attribute.HOL.split-format}{\hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
 | |
| 1451 |   \end{matharray}
 | |
| 1452 | ||
| 1453 |   \begin{railoutput}
 | |
| 1454 | \rail@begin{2}{}
 | |
| 1455 | \rail@term{\hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}}[]
 | |
| 1456 | \rail@bar | |
| 1457 | \rail@nextbar{1}
 | |
| 1458 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | |
| 1459 | \rail@term{\isa{complete}}[]
 | |
| 1460 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | |
| 1461 | \rail@endbar | |
| 1462 | \rail@end | |
| 1463 | \end{railoutput}
 | |
| 1464 | ||
| 26849 | 1465 | |
| 1466 |   \begin{description}
 | |
| 1467 | ||
| 42908 | 1468 |   \item \hyperlink{attribute.HOL.split-format}{\mbox{\isa{split{\isaliteral{5F}{\isacharunderscore}}format}}}\ \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}complete{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} causes
 | 
| 1469 | arguments in function applications to be represented canonically | |
| 1470 | according to their tuple type structure. | |
| 26849 | 1471 | |
| 42908 | 1472 | Note that this operation tends to invent funny names for new local | 
| 1473 | parameters introduced. | |
| 26849 | 1474 | |
| 42908 | 1475 |   \end{description}%
 | 
| 26849 | 1476 | \end{isamarkuptext}%
 | 
| 1477 | \isamarkuptrue% | |
| 1478 | % | |
| 42908 | 1479 | \isamarkupsection{Typedef axiomatization \label{sec:hol-typedef}%
 | 
| 26849 | 1480 | } | 
| 1481 | \isamarkuptrue% | |
| 1482 | % | |
| 1483 | \begin{isamarkuptext}%
 | |
| 42908 | 1484 | A Gordon/HOL-style type definition is a certain axiom scheme | 
| 1485 | that identifies a new type with a subset of an existing type. More | |
| 1486 | precisely, the new type is defined by exhibiting an existing type | |
| 1487 |   \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}, a set \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\ set{\isaliteral{22}{\isachardoublequote}}}, and a theorem that proves
 | |
| 1488 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ x\ {\isaliteral{5C3C696E3E}{\isasymin}}\ A{\isaliteral{22}{\isachardoublequote}}}.  Thus \isa{A} is a non-empty subset of \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}}, and the new type denotes this subset.  New functions are
 | |
| 1489 | postulated that establish an isomorphism between the new type and | |
| 1490 |   the subset.  In general, the type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} may involve type
 | |
| 1491 |   variables \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} which means that the type definition
 | |
| 1492 |   produces a type constructor \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} depending on
 | |
| 1493 | those type arguments. | |
| 1494 | ||
| 1495 | The axiomatization can be considered a ``definition'' in the sense | |
| 1496 | of the particular set-theoretic interpretation of HOL | |
| 1497 |   \cite{pitts93}, where the universe of types is required to be
 | |
| 1498 | downwards-closed wrt.\ arbitrary non-empty subsets. Thus genuinely | |
| 1499 |   new types introduced by \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} stay within the range
 | |
| 1500 |   of HOL models by construction.  Note that \indexref{}{command}{type\_synonym}\hyperlink{command.type-synonym}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}synonym}}}} from Isabelle/Pure merely introduces syntactic
 | |
| 1501 | abbreviations, without any logical significance. | |
| 1502 | ||
| 1503 |   \begin{matharray}{rcl}
 | |
| 1504 |     \indexdef{HOL}{command}{typedef}\hypertarget{command.HOL.typedef}{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1505 |   \end{matharray}
 | |
| 1506 | ||
| 1507 |   \begin{railoutput}
 | |
| 1508 | \rail@begin{2}{}
 | |
| 1509 | \rail@term{\hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}}[]
 | |
| 1510 | \rail@bar | |
| 1511 | \rail@nextbar{1}
 | |
| 1512 | \rail@nont{\isa{alt{\isaliteral{5F}{\isacharunderscore}}name}}[]
 | |
| 1513 | \rail@endbar | |
| 1514 | \rail@nont{\isa{abs{\isaliteral{5F}{\isacharunderscore}}type}}[]
 | |
| 1515 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | |
| 1516 | \rail@nont{\isa{rep{\isaliteral{5F}{\isacharunderscore}}set}}[]
 | |
| 1517 | \rail@end | |
| 1518 | \rail@begin{3}{\isa{alt{\isaliteral{5F}{\isacharunderscore}}name}}
 | |
| 1519 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | |
| 1520 | \rail@bar | |
| 1521 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1522 | \rail@nextbar{1}
 | |
| 1523 | \rail@term{\isa{\isakeyword{open}}}[]
 | |
| 1524 | \rail@nextbar{2}
 | |
| 1525 | \rail@term{\isa{\isakeyword{open}}}[]
 | |
| 1526 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1527 | \rail@endbar | |
| 1528 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | |
| 1529 | \rail@end | |
| 1530 | \rail@begin{2}{\isa{abs{\isaliteral{5F}{\isacharunderscore}}type}}
 | |
| 1531 | \rail@nont{\hyperlink{syntax.typespec-sorts}{\mbox{\isa{typespec{\isaliteral{5F}{\isacharunderscore}}sorts}}}}[]
 | |
| 1532 | \rail@bar | |
| 1533 | \rail@nextbar{1}
 | |
| 1534 | \rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
 | |
| 1535 | \rail@endbar | |
| 1536 | \rail@end | |
| 1537 | \rail@begin{2}{\isa{rep{\isaliteral{5F}{\isacharunderscore}}set}}
 | |
| 1538 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | |
| 1539 | \rail@bar | |
| 1540 | \rail@nextbar{1}
 | |
| 1541 | \rail@term{\isa{\isakeyword{morphisms}}}[]
 | |
| 1542 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1543 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1544 | \rail@endbar | |
| 1545 | \rail@end | |
| 1546 | \end{railoutput}
 | |
| 1547 | ||
| 1548 | ||
| 1549 |   \begin{description}
 | |
| 26849 | 1550 | |
| 42908 | 1551 |   \item \hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{3D}{\isacharequal}}\ A{\isaliteral{22}{\isachardoublequote}}}
 | 
| 1552 | axiomatizes a type definition in the background theory of the | |
| 1553 | current context, depending on a non-emptiness result of the set | |
| 1554 |   \isa{A} that needs to be proven here.  The set \isa{A} may
 | |
| 1555 |   contain type variables \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} as specified on the LHS,
 | |
| 1556 | but no term variables. | |
| 1557 | ||
| 1558 | Even though a local theory specification, the newly introduced type | |
| 1559 | constructor cannot depend on parameters or assumptions of the | |
| 1560 | context: this is structurally impossible in HOL. In contrast, the | |
| 1561 | non-emptiness proof may use local assumptions in unusual situations, | |
| 1562 | which could result in different interpretations in target contexts: | |
| 1563 |   the meaning of the bijection between the representing set \isa{A}
 | |
| 1564 |   and the new type \isa{t} may then change in different application
 | |
| 1565 | contexts. | |
| 1566 | ||
| 1567 |   By default, \hyperlink{command.HOL.typedef}{\mbox{\isa{\isacommand{typedef}}}} defines both a type
 | |
| 1568 |   constructor \isa{t} for the new type, and a term constant \isa{t} for the representing set within the old type.  Use the ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}open{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' option to suppress a separate constant definition
 | |
| 1569 |   altogether.  The injection from type to set is called \isa{Rep{\isaliteral{5F}{\isacharunderscore}}t},
 | |
| 1570 |   its inverse \isa{Abs{\isaliteral{5F}{\isacharunderscore}}t}, unless explicit \hyperlink{keyword.HOL.morphisms}{\mbox{\isa{\isakeyword{morphisms}}}} specification provides alternative names.
 | |
| 1571 | ||
| 1572 |   The core axiomatization uses the locale predicate \isa{type{\isaliteral{5F}{\isacharunderscore}}definition} as defined in Isabelle/HOL.  Various basic
 | |
| 1573 | consequences of that are instantiated accordingly, re-using the | |
| 1574 | locale facts with names derived from the new type constructor. Thus | |
| 1575 |   the generic \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep} is turned into the specific
 | |
| 1576 |   \isa{{\isaliteral{22}{\isachardoublequote}}Rep{\isaliteral{5F}{\isacharunderscore}}t{\isaliteral{22}{\isachardoublequote}}}, for example.
 | |
| 26849 | 1577 | |
| 42908 | 1578 |   Theorems \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep}, \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep{\isaliteral{5F}{\isacharunderscore}}inverse}, and \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Abs{\isaliteral{5F}{\isacharunderscore}}inverse}
 | 
| 1579 | provide the most basic characterization as a corresponding | |
| 1580 | injection/surjection pair (in both directions). The derived rules | |
| 1581 |   \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep{\isaliteral{5F}{\isacharunderscore}}inject} and \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Abs{\isaliteral{5F}{\isacharunderscore}}inject} provide a more convenient version of
 | |
| 1582 | injectivity, suitable for automated proof tools (e.g.\ in | |
| 1583 |   declarations involving \hyperlink{attribute.simp}{\mbox{\isa{simp}}} or \hyperlink{attribute.iff}{\mbox{\isa{iff}}}).
 | |
| 1584 |   Furthermore, the rules \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep{\isaliteral{5F}{\isacharunderscore}}cases}~/ \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Rep{\isaliteral{5F}{\isacharunderscore}}induct}, and \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Abs{\isaliteral{5F}{\isacharunderscore}}cases}~/
 | |
| 1585 |   \isa{type{\isaliteral{5F}{\isacharunderscore}}definition{\isaliteral{2E}{\isachardot}}Abs{\isaliteral{5F}{\isacharunderscore}}induct} provide alternative views on
 | |
| 1586 | surjectivity. These rules are already declared as set or type rules | |
| 1587 |   for the generic \hyperlink{method.cases}{\mbox{\isa{cases}}} and \hyperlink{method.induct}{\mbox{\isa{induct}}} methods,
 | |
| 1588 | respectively. | |
| 1589 | ||
| 1590 | An alternative name for the set definition (and other derived | |
| 1591 | entities) may be specified in parentheses; the default is to use | |
| 1592 |   \isa{t} directly.
 | |
| 1593 | ||
| 1594 |   \end{description}
 | |
| 1595 | ||
| 1596 |   \begin{warn}
 | |
| 1597 |   If you introduce a new type axiomatically, i.e.\ via \indexref{}{command}{typedecl}\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}} and \indexref{}{command}{axiomatization}\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}, the minimum requirement
 | |
| 1598 | is that it has a non-empty model, to avoid immediate collapse of the | |
| 1599 | HOL logic. Moreover, one needs to demonstrate that the | |
| 1600 | interpretation of such free-form axiomatizations can coexist with | |
| 1601 |   that of the regular \indexdef{}{command}{typedef}\hypertarget{command.typedef}{\hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}}} scheme, and any extension
 | |
| 1602 | that other people might have introduced elsewhere (e.g.\ in HOLCF | |
| 1603 |   \cite{MuellerNvOS99}).
 | |
| 1604 |   \end{warn}%
 | |
| 1605 | \end{isamarkuptext}%
 | |
| 1606 | \isamarkuptrue% | |
| 1607 | % | |
| 1608 | \isamarkupsubsubsection{Examples%
 | |
| 1609 | } | |
| 1610 | \isamarkuptrue% | |
| 1611 | % | |
| 1612 | \begin{isamarkuptext}%
 | |
| 1613 | Type definitions permit the introduction of abstract data | |
| 1614 | types in a safe way, namely by providing models based on already | |
| 1615 |   existing types.  Given some abstract axiomatic description \isa{P}
 | |
| 1616 | of a type, this involves two steps: | |
| 1617 | ||
| 1618 |   \begin{enumerate}
 | |
| 26849 | 1619 | |
| 42908 | 1620 |   \item Find an appropriate type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} and subset \isa{A} which
 | 
| 1621 |   has the desired properties \isa{P}, and make a type definition
 | |
| 1622 | based on this representation. | |
| 1623 | ||
| 1624 |   \item Prove that \isa{P} holds for \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} by lifting \isa{P}
 | |
| 1625 | from the representation. | |
| 1626 | ||
| 1627 |   \end{enumerate}
 | |
| 1628 | ||
| 1629 | You can later forget about the representation and work solely in | |
| 1630 |   terms of the abstract properties \isa{P}.
 | |
| 26849 | 1631 | |
| 42908 | 1632 | \medskip The following trivial example pulls a three-element type | 
| 1633 | into existence within the formal logical environment of HOL.% | |
| 1634 | \end{isamarkuptext}%
 | |
| 1635 | \isamarkuptrue% | |
| 1636 | \isacommand{typedef}\isamarkupfalse%
 | |
| 1637 | \ three\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{28}{\isacharparenleft}}True{\isaliteral{2C}{\isacharcomma}}\ True{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{28}{\isacharparenleft}}True{\isaliteral{2C}{\isacharcomma}}\ False{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{28}{\isacharparenleft}}False{\isaliteral{2C}{\isacharcomma}}\ True{\isaliteral{29}{\isacharparenright}}{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1638 | % | |
| 1639 | \isadelimproof | |
| 1640 | \ \ % | |
| 1641 | \endisadelimproof | |
| 1642 | % | |
| 1643 | \isatagproof | |
| 1644 | \isacommand{by}\isamarkupfalse%
 | |
| 1645 | \ blast% | |
| 1646 | \endisatagproof | |
| 1647 | {\isafoldproof}%
 | |
| 1648 | % | |
| 1649 | \isadelimproof | |
| 1650 | \isanewline | |
| 1651 | % | |
| 1652 | \endisadelimproof | |
| 1653 | \isanewline | |
| 1654 | \isacommand{definition}\isamarkupfalse%
 | |
| 1655 | \ {\isaliteral{22}{\isachardoublequoteopen}}One\ {\isaliteral{3D}{\isacharequal}}\ Abs{\isaliteral{5F}{\isacharunderscore}}three\ {\isaliteral{28}{\isacharparenleft}}True{\isaliteral{2C}{\isacharcomma}}\ True{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1656 | \isacommand{definition}\isamarkupfalse%
 | |
| 1657 | \ {\isaliteral{22}{\isachardoublequoteopen}}Two\ {\isaliteral{3D}{\isacharequal}}\ Abs{\isaliteral{5F}{\isacharunderscore}}three\ {\isaliteral{28}{\isacharparenleft}}True{\isaliteral{2C}{\isacharcomma}}\ False{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1658 | \isacommand{definition}\isamarkupfalse%
 | |
| 1659 | \ {\isaliteral{22}{\isachardoublequoteopen}}Three\ {\isaliteral{3D}{\isacharequal}}\ Abs{\isaliteral{5F}{\isacharunderscore}}three\ {\isaliteral{28}{\isacharparenleft}}False{\isaliteral{2C}{\isacharcomma}}\ True{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1660 | \isanewline | |
| 1661 | \isacommand{lemma}\isamarkupfalse%
 | |
| 1662 | \ three{\isaliteral{5F}{\isacharunderscore}}distinct{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}One\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ Two{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}One\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ Three{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}Two\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ Three{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1663 | % | |
| 1664 | \isadelimproof | |
| 1665 | \ \ % | |
| 1666 | \endisadelimproof | |
| 1667 | % | |
| 1668 | \isatagproof | |
| 1669 | \isacommand{by}\isamarkupfalse%
 | |
| 1670 | \ {\isaliteral{28}{\isacharparenleft}}simp{\isaliteral{5F}{\isacharunderscore}}all\ add{\isaliteral{3A}{\isacharcolon}}\ One{\isaliteral{5F}{\isacharunderscore}}def\ Two{\isaliteral{5F}{\isacharunderscore}}def\ Three{\isaliteral{5F}{\isacharunderscore}}def\ Abs{\isaliteral{5F}{\isacharunderscore}}three{\isaliteral{5F}{\isacharunderscore}}inject\ three{\isaliteral{5F}{\isacharunderscore}}def{\isaliteral{29}{\isacharparenright}}%
 | |
| 1671 | \endisatagproof | |
| 1672 | {\isafoldproof}%
 | |
| 1673 | % | |
| 1674 | \isadelimproof | |
| 1675 | \isanewline | |
| 1676 | % | |
| 1677 | \endisadelimproof | |
| 1678 | \isanewline | |
| 1679 | \isacommand{lemma}\isamarkupfalse%
 | |
| 1680 | \ three{\isaliteral{5F}{\isacharunderscore}}cases{\isaliteral{3A}{\isacharcolon}}\isanewline
 | |
| 1681 | \ \ \isakeyword{fixes}\ x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ three\ \isakeyword{obtains}\ {\isaliteral{22}{\isachardoublequoteopen}}x\ {\isaliteral{3D}{\isacharequal}}\ One{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}x\ {\isaliteral{3D}{\isacharequal}}\ Two{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}x\ {\isaliteral{3D}{\isacharequal}}\ Three{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 1682 | % | |
| 1683 | \isadelimproof | |
| 1684 | \ \ % | |
| 1685 | \endisadelimproof | |
| 1686 | % | |
| 1687 | \isatagproof | |
| 1688 | \isacommand{by}\isamarkupfalse%
 | |
| 1689 | \ {\isaliteral{28}{\isacharparenleft}}cases\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}auto\ simp{\isaliteral{3A}{\isacharcolon}}\ One{\isaliteral{5F}{\isacharunderscore}}def\ Two{\isaliteral{5F}{\isacharunderscore}}def\ Three{\isaliteral{5F}{\isacharunderscore}}def\ Abs{\isaliteral{5F}{\isacharunderscore}}three{\isaliteral{5F}{\isacharunderscore}}inject\ three{\isaliteral{5F}{\isacharunderscore}}def{\isaliteral{29}{\isacharparenright}}%
 | |
| 1690 | \endisatagproof | |
| 1691 | {\isafoldproof}%
 | |
| 1692 | % | |
| 1693 | \isadelimproof | |
| 1694 | % | |
| 1695 | \endisadelimproof | |
| 1696 | % | |
| 1697 | \begin{isamarkuptext}%
 | |
| 1698 | Note that such trivial constructions are better done with | |
| 1699 |   derived specification mechanisms such as \hyperlink{command.datatype}{\mbox{\isa{\isacommand{datatype}}}}:%
 | |
| 1700 | \end{isamarkuptext}%
 | |
| 1701 | \isamarkuptrue% | |
| 1702 | \isacommand{datatype}\isamarkupfalse%
 | |
| 1703 | \ three{\isaliteral{27}{\isacharprime}}\ {\isaliteral{3D}{\isacharequal}}\ One{\isaliteral{27}{\isacharprime}}\ {\isaliteral{7C}{\isacharbar}}\ Two{\isaliteral{27}{\isacharprime}}\ {\isaliteral{7C}{\isacharbar}}\ Three{\isaliteral{27}{\isacharprime}}%
 | |
| 1704 | \begin{isamarkuptext}%
 | |
| 1705 | This avoids re-doing basic definitions and proofs from the | |
| 1706 |   primitive \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} above.%
 | |
| 1707 | \end{isamarkuptext}%
 | |
| 1708 | \isamarkuptrue% | |
| 1709 | % | |
| 1710 | \isamarkupsection{Functorial structure of types%
 | |
| 1711 | } | |
| 1712 | \isamarkuptrue% | |
| 1713 | % | |
| 1714 | \begin{isamarkuptext}%
 | |
| 1715 | \begin{matharray}{rcl}
 | |
| 1716 |     \indexdef{HOL}{command}{enriched\_type}\hypertarget{command.HOL.enriched-type}{\hyperlink{command.HOL.enriched-type}{\mbox{\isa{\isacommand{enriched{\isaliteral{5F}{\isacharunderscore}}type}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}
 | |
| 1717 |   \end{matharray}
 | |
| 26849 | 1718 | |
| 42908 | 1719 |   \begin{railoutput}
 | 
| 1720 | \rail@begin{2}{}
 | |
| 1721 | \rail@term{\hyperlink{command.HOL.enriched-type}{\mbox{\isa{\isacommand{enriched{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
 | |
| 1722 | \rail@bar | |
| 1723 | \rail@nextbar{1}
 | |
| 1724 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | |
| 1725 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | |
| 1726 | \rail@endbar | |
| 1727 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | |
| 1728 | \rail@end | |
| 1729 | \end{railoutput}
 | |
| 1730 | ||
| 1731 | ||
| 1732 |   \begin{description}
 | |
| 26849 | 1733 | |
| 42908 | 1734 |   \item \hyperlink{command.HOL.enriched-type}{\mbox{\isa{\isacommand{enriched{\isaliteral{5F}{\isacharunderscore}}type}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}prefix{\isaliteral{3A}{\isacharcolon}}\ m{\isaliteral{22}{\isachardoublequote}}} allows to
 | 
| 1735 | prove and register properties about the functorial structure of type | |
| 1736 | constructors. These properties then can be used by other packages | |
| 1737 | to deal with those type constructors in certain type constructions. | |
| 1738 | Characteristic theorems are noted in the current local theory. By | |
| 1739 | default, they are prefixed with the base name of the type | |
| 1740 | constructor, an explicit prefix can be given alternatively. | |
| 1741 | ||
| 1742 |   The given term \isa{{\isaliteral{22}{\isachardoublequote}}m{\isaliteral{22}{\isachardoublequote}}} is considered as \emph{mapper} for the
 | |
| 1743 | corresponding type constructor and must conform to the following | |
| 1744 | type pattern: | |
| 26849 | 1745 | |
| 42908 | 1746 |   \begin{matharray}{lll}
 | 
| 1747 |     \isa{{\isaliteral{22}{\isachardoublequote}}m{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} &
 | |
| 1748 |       \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub k\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1749 |   \end{matharray}
 | |
| 1750 | ||
| 1751 |   \noindent where \isa{t} is the type constructor, \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7665633E}{}\isactrlvec {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{22}{\isachardoublequote}}} are distinct
 | |
| 1752 |   type variables free in the local theory and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}},
 | |
| 1753 |   \ldots, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub k{\isaliteral{22}{\isachardoublequote}}} is a subsequence of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}, \ldots,
 | |
| 1754 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1755 | ||
| 1756 |   \end{description}%
 | |
| 26849 | 1757 | \end{isamarkuptext}%
 | 
| 1758 | \isamarkuptrue% | |
| 1759 | % | |
| 43993 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1760 | \isamarkupsection{Quotient types%
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1761 | } | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1762 | \isamarkuptrue% | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1763 | % | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1764 | \begin{isamarkuptext}%
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1765 | The quotient package defines a new quotient type given a raw type | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1766 | and a partial equivalence relation. | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1767 | It also includes automation for transporting definitions and theorems. | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1768 | It can automatically produce definitions and theorems on the quotient type, | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1769 | given the corresponding constants and facts on the raw type. | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1770 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1771 |   \begin{matharray}{rcl}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1772 |     \indexdef{HOL}{command}{quotient\_type}\hypertarget{command.HOL.quotient-type}{\hyperlink{command.HOL.quotient-type}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}type}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}\\
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1773 |     \indexdef{HOL}{command}{quotient\_definition}\hypertarget{command.HOL.quotient-definition}{\hyperlink{command.HOL.quotient-definition}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}definition}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}\\
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1774 |     \indexdef{HOL}{command}{print\_quotmaps}\hypertarget{command.HOL.print-quotmaps}{\hyperlink{command.HOL.print-quotmaps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotmaps}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}}\\
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1775 |     \indexdef{HOL}{command}{print\_quotients}\hypertarget{command.HOL.print-quotients}{\hyperlink{command.HOL.print-quotients}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotients}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}}\\
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1776 |     \indexdef{HOL}{command}{print\_quotconsts}\hypertarget{command.HOL.print-quotconsts}{\hyperlink{command.HOL.print-quotconsts}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotconsts}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}}\\
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1777 |   \end{matharray}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1778 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1779 |   \begin{railoutput}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1780 | \rail@begin{2}{}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1781 | \rail@term{\hyperlink{command.HOL.quotient-type}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1782 | \rail@plus | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1783 | \rail@nont{\isa{spec}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1784 | \rail@nextplus{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1785 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1786 | \rail@endplus | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1787 | \rail@end | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1788 | \rail@begin{5}{\isa{spec}}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1789 | \rail@nont{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1790 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1791 | \rail@nextbar{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1792 | \rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1793 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1794 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1795 | \rail@cr{3}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1796 | \rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1797 | \rail@term{\isa{{\isaliteral{2F}{\isacharslash}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1798 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1799 | \rail@nextbar{4}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1800 | \rail@term{\isa{partial}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1801 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1802 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1803 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1804 | \rail@end | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1805 | \end{railoutput}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1806 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1807 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1808 |   \begin{railoutput}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1809 | \rail@begin{4}{}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1810 | \rail@term{\hyperlink{command.HOL.quotient-definition}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}definition}}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1811 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1812 | \rail@nextbar{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1813 | \rail@nont{\isa{constdecl}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1814 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1815 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1816 | \rail@nextbar{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1817 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1818 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1819 | \rail@cr{3}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1820 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1821 | \rail@term{\isa{is}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1822 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1823 | \rail@end | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1824 | \rail@begin{2}{\isa{constdecl}}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1825 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1826 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1827 | \rail@nextbar{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1828 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1829 | \rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1830 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1831 | \rail@bar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1832 | \rail@nextbar{1}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1833 | \rail@nont{\hyperlink{syntax.mixfix}{\mbox{\isa{mixfix}}}}[]
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1834 | \rail@endbar | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1835 | \rail@end | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1836 | \end{railoutput}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1837 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1838 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1839 |   \begin{description}
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1840 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1841 |   \item \hyperlink{command.HOL.quotient-type}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}type}}}} defines quotient types.
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1842 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1843 |   \item \hyperlink{command.HOL.quotient-definition}{\mbox{\isa{\isacommand{quotient{\isaliteral{5F}{\isacharunderscore}}definition}}}} defines a constant on the quotient type.
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1844 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1845 |   \item \hyperlink{command.HOL.print-quotmaps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotmaps}}}} prints quotient map functions.
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1846 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1847 |   \item \hyperlink{command.HOL.print-quotients}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotients}}}} prints quotients.
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1848 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1849 |   \item \hyperlink{command.HOL.print-quotconsts}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}quotconsts}}}} prints quotient constants.
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1850 | |
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1851 |   \end{description}%
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1852 | \end{isamarkuptext}%
 | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1853 | \isamarkuptrue% | 
| 
b141d7a3d4e3
rudimentary documentation of the quotient package in the isar reference manual
 bulwahn parents: 
43914diff
changeset | 1854 | % | 
| 43994 | 1855 | \isamarkupsection{Coercive subtyping%
 | 
| 1856 | } | |
| 1857 | \isamarkuptrue% | |
| 1858 | % | |
| 1859 | \begin{isamarkuptext}%
 | |
| 1860 | \begin{matharray}{rcl}
 | |
| 1861 |     \indexdef{HOL}{attribute}{coercion}\hypertarget{attribute.HOL.coercion}{\hyperlink{attribute.HOL.coercion}{\mbox{\isa{coercion}}}} & : & \isa{attribute} \\
 | |
| 1862 |     \indexdef{HOL}{attribute}{coercion\_enabled}\hypertarget{attribute.HOL.coercion-enabled}{\hyperlink{attribute.HOL.coercion-enabled}{\mbox{\isa{coercion{\isaliteral{5F}{\isacharunderscore}}enabled}}}} & : & \isa{attribute} \\
 | |
| 1863 |     \indexdef{HOL}{attribute}{coercion\_map}\hypertarget{attribute.HOL.coercion-map}{\hyperlink{attribute.HOL.coercion-map}{\mbox{\isa{coercion{\isaliteral{5F}{\isacharunderscore}}map}}}} & : & \isa{attribute} \\
 | |
| 1864 |   \end{matharray}
 | |
| 1865 | ||
| 1866 |   \begin{railoutput}
 | |
| 1867 | \rail@begin{2}{}
 | |
| 1868 | \rail@term{\hyperlink{attribute.HOL.coercion}{\mbox{\isa{coercion}}}}[]
 | |
| 1869 | \rail@bar | |
| 1870 | \rail@nextbar{1}
 | |
| 1871 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | |
| 1872 | \rail@endbar | |
| 1873 | \rail@end | |
| 1874 | \end{railoutput}
 | |
| 1875 | ||
| 1876 |   \begin{railoutput}
 | |
| 1877 | \rail@begin{2}{}
 | |
| 1878 | \rail@term{\hyperlink{attribute.HOL.coercion-map}{\mbox{\isa{coercion{\isaliteral{5F}{\isacharunderscore}}map}}}}[]
 | |
| 1879 | \rail@bar | |
| 1880 | \rail@nextbar{1}
 | |
| 1881 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | |
| 1882 | \rail@endbar | |
| 1883 | \rail@end | |
| 1884 | \end{railoutput}
 | |
| 1885 | ||
| 1886 | ||
| 1887 | Coercive subtyping allows the user to omit explicit type conversions, | |
| 1888 |   also called \emph{coercions}.  Type inference will add them as
 | |
| 1889 | necessary when parsing a term. See | |
| 1890 |   \cite{traytel-berghofer-nipkow-2011} for details.
 | |
| 1891 | ||
| 1892 |   \begin{description}
 | |
| 1893 | ||
| 1894 |   \item \hyperlink{attribute.HOL.coercion}{\mbox{\isa{coercion}}}~\isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{22}{\isachardoublequote}}} registers a new
 | |
| 1895 |   coercion function \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} where \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7369676D613E}{\isasymsigma}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} are nullary type constructors. Coercions are
 | |
| 1896 | composed by the inference algorithm if needed. Note that the type | |
| 1897 | inference algorithm is complete only if the registered coercions form | |
| 1898 | a lattice. | |
| 1899 | ||
| 1900 | ||
| 1901 |   \item \hyperlink{attribute.HOL.coercion-map}{\mbox{\isa{coercion{\isaliteral{5F}{\isacharunderscore}}map}}}~\isa{{\isaliteral{22}{\isachardoublequote}}map{\isaliteral{22}{\isachardoublequote}}} registers a new
 | |
| 1902 | map function to lift coercions through type constructors. The function | |
| 1903 |   \isa{{\isaliteral{22}{\isachardoublequote}}map{\isaliteral{22}{\isachardoublequote}}} must conform to the following type pattern
 | |
| 1904 | ||
| 1905 |   \begin{matharray}{lll}
 | |
| 1906 |     \isa{{\isaliteral{22}{\isachardoublequote}}map{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} &
 | |
| 1907 |       \isa{{\isaliteral{22}{\isachardoublequote}}f\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ f\isaliteral{5C3C5E697375623E}{}\isactrlisub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 1908 |   \end{matharray}
 | |
| 1909 | ||
| 1910 |   where \isa{{\isaliteral{22}{\isachardoublequote}}t{\isaliteral{22}{\isachardoublequote}}} is a type constructor and \isa{{\isaliteral{22}{\isachardoublequote}}f\isaliteral{5C3C5E697375623E}{}\isactrlisub i{\isaliteral{22}{\isachardoublequote}}} is of
 | |
| 1911 |   type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i{\isaliteral{22}{\isachardoublequote}}} or
 | |
| 1912 |   \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E697375623E}{}\isactrlisub i{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 1913 | Registering a map function overwrites any existing map function for | |
| 1914 | this particular type constructor. | |
| 1915 | ||
| 1916 | ||
| 1917 |   \item \hyperlink{attribute.HOL.coercion-enabled}{\mbox{\isa{coercion{\isaliteral{5F}{\isacharunderscore}}enabled}}} enables the coercion
 | |
| 1918 | inference algorithm. | |
| 1919 | ||
| 1920 |   \end{description}%
 | |
| 1921 | \end{isamarkuptext}%
 | |
| 1922 | \isamarkuptrue% | |
| 1923 | % | |
| 26849 | 1924 | \isamarkupsection{Arithmetic proof support%
 | 
| 1925 | } | |
| 1926 | \isamarkuptrue% | |
| 1927 | % | |
| 1928 | \begin{isamarkuptext}%
 | |
| 1929 | \begin{matharray}{rcl}
 | |
| 28788 | 1930 |     \indexdef{HOL}{method}{arith}\hypertarget{method.HOL.arith}{\hyperlink{method.HOL.arith}{\mbox{\isa{arith}}}} & : & \isa{method} \\
 | 
| 30863 | 1931 |     \indexdef{HOL}{attribute}{arith}\hypertarget{attribute.HOL.arith}{\hyperlink{attribute.HOL.arith}{\mbox{\isa{arith}}}} & : & \isa{attribute} \\
 | 
| 40406 | 1932 |     \indexdef{HOL}{attribute}{arith\_split}\hypertarget{attribute.HOL.arith-split}{\hyperlink{attribute.HOL.arith-split}{\mbox{\isa{arith{\isaliteral{5F}{\isacharunderscore}}split}}}} & : & \isa{attribute} \\
 | 
| 26849 | 1933 |   \end{matharray}
 | 
| 1934 | ||
| 26902 | 1935 |   The \hyperlink{method.HOL.arith}{\mbox{\isa{arith}}} method decides linear arithmetic problems
 | 
| 26849 | 1936 |   (on types \isa{nat}, \isa{int}, \isa{real}).  Any current
 | 
| 1937 | facts are inserted into the goal before running the procedure. | |
| 1938 | ||
| 30863 | 1939 |   The \hyperlink{attribute.HOL.arith}{\mbox{\isa{arith}}} attribute declares facts that are
 | 
| 1940 | always supplied to the arithmetic provers implicitly. | |
| 26849 | 1941 | |
| 40406 | 1942 |   The \hyperlink{attribute.HOL.arith-split}{\mbox{\isa{arith{\isaliteral{5F}{\isacharunderscore}}split}}} attribute declares case split
 | 
| 30865 | 1943 |   rules to be expanded before \hyperlink{method.HOL.arith}{\mbox{\isa{arith}}} is invoked.
 | 
| 30863 | 1944 | |
| 1945 | Note that a simpler (but faster) arithmetic prover is | |
| 1946 | already invoked by the Simplifier.% | |
| 26849 | 1947 | \end{isamarkuptext}%
 | 
| 1948 | \isamarkuptrue% | |
| 1949 | % | |
| 30172 | 1950 | \isamarkupsection{Intuitionistic proof search%
 | 
| 1951 | } | |
| 1952 | \isamarkuptrue% | |
| 1953 | % | |
| 1954 | \begin{isamarkuptext}%
 | |
| 1955 | \begin{matharray}{rcl}
 | |
| 1956 |     \indexdef{HOL}{method}{iprover}\hypertarget{method.HOL.iprover}{\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}} & : & \isa{method} \\
 | |
| 1957 |   \end{matharray}
 | |
| 1958 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1959 |   \begin{railoutput}
 | 
| 42662 | 1960 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1961 | \rail@term{\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1962 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1963 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1964 | \rail@cnont{\hyperlink{syntax.rulemod}{\mbox{\isa{rulemod}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1965 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1966 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1967 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 1968 | |
| 30172 | 1969 | |
| 1970 |   The \hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}} method performs intuitionistic proof
 | |
| 1971 | search, depending on specifically declared rules from the context, | |
| 1972 | or given as explicit arguments. Chained facts are inserted into the | |
| 35613 | 1973 | goal before commencing proof search. | 
| 1974 | ||
| 30172 | 1975 |   Rules need to be classified as \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}},
 | 
| 1976 |   \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, or \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}; here the
 | |
| 40406 | 1977 |   ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{21}{\isacharbang}}{\isaliteral{22}{\isachardoublequote}}}'' indicator refers to ``safe'' rules, which may be
 | 
| 30172 | 1978 | applied aggressively (without considering back-tracking later). | 
| 40406 | 1979 |   Rules declared with ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}'' are ignored in proof search (the
 | 
| 42626 | 1980 |   single-step \hyperlink{method.Pure.rule}{\mbox{\isa{rule}}} method still observes these).  An
 | 
| 30172 | 1981 | explicit weight annotation may be given as well; otherwise the | 
| 1982 | number of rule premises will be taken into account here.% | |
| 1983 | \end{isamarkuptext}%
 | |
| 1984 | \isamarkuptrue% | |
| 1985 | % | |
| 43578 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1986 | \isamarkupsection{Model Elimination and Resolution%
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1987 | } | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1988 | \isamarkuptrue% | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1989 | % | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1990 | \begin{isamarkuptext}%
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1991 | \begin{matharray}{rcl}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1992 |     \indexdef{HOL}{method}{meson}\hypertarget{method.HOL.meson}{\hyperlink{method.HOL.meson}{\mbox{\isa{meson}}}} & : & \isa{method} \\
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1993 |     \indexdef{HOL}{method}{metis}\hypertarget{method.HOL.metis}{\hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}} & : & \isa{method} \\
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1994 |   \end{matharray}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1995 | |
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1996 |   \begin{railoutput}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1997 | \rail@begin{2}{}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1998 | \rail@term{\hyperlink{method.HOL.meson}{\mbox{\isa{meson}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 1999 | \rail@bar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2000 | \rail@nextbar{1}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2001 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2002 | \rail@endbar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2003 | \rail@end | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2004 | \rail@begin{5}{}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2005 | \rail@term{\hyperlink{method.HOL.metis}{\mbox{\isa{metis}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2006 | \rail@bar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2007 | \rail@nextbar{1}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2008 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2009 | \rail@bar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2010 | \rail@term{\isa{partial{\isaliteral{5F}{\isacharunderscore}}types}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2011 | \rail@nextbar{2}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2012 | \rail@term{\isa{full{\isaliteral{5F}{\isacharunderscore}}types}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2013 | \rail@nextbar{3}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2014 | \rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}types}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2015 | \rail@nextbar{4}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2016 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2017 | \rail@endbar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2018 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2019 | \rail@endbar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2020 | \rail@bar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2021 | \rail@nextbar{1}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2022 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2023 | \rail@endbar | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2024 | \rail@end | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2025 | \end{railoutput}
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2026 | |
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2027 | |
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2028 |   The \hyperlink{method.HOL.meson}{\mbox{\isa{meson}}} method implements Loveland's model elimination
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2029 |   procedure \cite{loveland-78}. See \verb|~~/src/HOL/ex/Meson_Test.thy| for
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2030 | examples. | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2031 | |
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2032 |   The \hyperlink{method.HOL.metis}{\mbox{\isa{metis}}} method combines ordered resolution and ordered
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2033 | paramodulation to find first-order (or mildly higher-order) proofs. The first | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2034 | optional argument specifies a type encoding; see the Sledgehammer manual | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2035 |   \cite{isabelle-sledgehammer} for details. The \verb|~~/src/HOL/Metis_Examples| directory contains several small theories
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2036 | developed to a large extent using Metis.% | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2037 | \end{isamarkuptext}%
 | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2038 | \isamarkuptrue% | 
| 
36ba44fe0781
document "meson" and "metis" in HOL specific section of the Isar ref manual
 blanchet parents: 
43270diff
changeset | 2039 | % | 
| 30172 | 2040 | \isamarkupsection{Coherent Logic%
 | 
| 2041 | } | |
| 2042 | \isamarkuptrue% | |
| 2043 | % | |
| 2044 | \begin{isamarkuptext}%
 | |
| 2045 | \begin{matharray}{rcl}
 | |
| 2046 |     \indexdef{HOL}{method}{coherent}\hypertarget{method.HOL.coherent}{\hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}}} & : & \isa{method} \\
 | |
| 2047 |   \end{matharray}
 | |
| 2048 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2049 |   \begin{railoutput}
 | 
| 42662 | 2050 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2051 | \rail@term{\hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2052 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2053 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2054 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2055 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2056 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2057 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2058 | |
| 30172 | 2059 | |
| 2060 |   The \hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}} method solves problems of
 | |
| 2061 |   \emph{Coherent Logic} \cite{Bezem-Coquand:2005}, which covers
 | |
| 2062 | applications in confluence theory, lattice theory and projective | |
| 40802 | 2063 | geometry. See \verb|~~/src/HOL/ex/Coherent.thy| for some | 
| 30172 | 2064 | examples.% | 
| 2065 | \end{isamarkuptext}%
 | |
| 2066 | \isamarkuptrue% | |
| 2067 | % | |
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2068 | \isamarkupsection{Proving propositions%
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2069 | } | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2070 | \isamarkuptrue% | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2071 | % | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2072 | \begin{isamarkuptext}%
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2073 | In addition to the standard proof methods, a number of diagnosis | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2074 | tools search for proofs and provide an Isar proof snippet on success. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2075 | These tools are available via the following commands. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2076 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2077 |   \begin{matharray}{rcl}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2078 |     \indexdef{HOL}{command}{solve\_direct}\hypertarget{command.HOL.solve-direct}{\hyperlink{command.HOL.solve-direct}{\mbox{\isa{\isacommand{solve{\isaliteral{5F}{\isacharunderscore}}direct}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2079 |     \indexdef{HOL}{command}{try}\hypertarget{command.HOL.try}{\hyperlink{command.HOL.try}{\mbox{\isa{\isacommand{try}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 43040 | 2080 |     \indexdef{HOL}{command}{try\_methods}\hypertarget{command.HOL.try-methods}{\hyperlink{command.HOL.try-methods}{\mbox{\isa{\isacommand{try{\isaliteral{5F}{\isacharunderscore}}methods}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2081 |     \indexdef{HOL}{command}{sledgehammer}\hypertarget{command.HOL.sledgehammer}{\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2082 |     \indexdef{HOL}{command}{sledgehammer\_params}\hypertarget{command.HOL.sledgehammer-params}{\hyperlink{command.HOL.sledgehammer-params}{\mbox{\isa{\isacommand{sledgehammer{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2083 |   \end{matharray}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2084 | |
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2085 |   \begin{railoutput}
 | 
| 43040 | 2086 | \rail@begin{1}{}
 | 
| 2087 | \rail@term{\hyperlink{command.HOL.try}{\mbox{\isa{\isacommand{try}}}}}[]
 | |
| 2088 | \rail@end | |
| 42662 | 2089 | \rail@begin{6}{}
 | 
| 43040 | 2090 | \rail@term{\hyperlink{command.HOL.try-methods}{\mbox{\isa{\isacommand{try{\isaliteral{5F}{\isacharunderscore}}methods}}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2091 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2092 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2093 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2094 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2095 | \rail@term{\isa{simp}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2096 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2097 | \rail@term{\isa{intro}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2098 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2099 | \rail@term{\isa{elim}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2100 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2101 | \rail@term{\isa{dest}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2102 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2103 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2104 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2105 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2106 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2107 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2108 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2109 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2110 | \rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2111 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2112 | \rail@end | 
| 42662 | 2113 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2114 | \rail@term{\hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2115 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2116 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2117 | \rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2118 | \rail@nont{\isa{args}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2119 | \rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2120 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2121 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2122 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2123 | \rail@nont{\isa{facts}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2124 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2125 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2126 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2127 | \rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2128 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2129 | \rail@end | 
| 42662 | 2130 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2131 | \rail@term{\hyperlink{command.HOL.sledgehammer-params}{\mbox{\isa{\isacommand{sledgehammer{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2132 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2133 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2134 | \rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2135 | \rail@nont{\isa{args}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2136 | \rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2137 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2138 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2139 | \rail@begin{2}{\isa{args}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2140 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2141 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2142 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2143 | \rail@nont{\isa{value}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2144 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2145 | \rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2146 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2147 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2148 | \rail@begin{5}{\isa{facts}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2149 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2150 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2151 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2152 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2153 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2154 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2155 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2156 | \rail@term{\isa{add}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2157 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2158 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2159 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2160 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2161 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2162 | \rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2163 | \rail@nextplus{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2164 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2165 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2166 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2167 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2168 | \end{railoutput}
 | 
| 43040 | 2169 | % FIXME check args "value" | 
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2170 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2171 |   \begin{description}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2172 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2173 |   \item \hyperlink{command.HOL.solve-direct}{\mbox{\isa{\isacommand{solve{\isaliteral{5F}{\isacharunderscore}}direct}}}} checks whether the current subgoals can
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2174 | be solved directly by an existing theorem. Duplicate lemmas can be detected | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2175 | in this way. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2176 | |
| 43040 | 2177 |   \item \hyperlink{command.HOL.try-methods}{\mbox{\isa{\isacommand{try{\isaliteral{5F}{\isacharunderscore}}methods}}}} attempts to prove a subgoal using a combination
 | 
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2178 |     of standard proof methods (\isa{auto}, \isa{simp}, \isa{blast}, etc.).
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2179 |     Additional facts supplied via \isa{{\isaliteral{22}{\isachardoublequote}}simp{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}intro{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}},
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2180 |     \isa{{\isaliteral{22}{\isachardoublequote}}elim{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}}, and \isa{{\isaliteral{22}{\isachardoublequote}}dest{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}} are passed to the appropriate proof
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2181 | methods. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2182 | |
| 43914 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2183 |   \item \hyperlink{command.HOL.try}{\mbox{\isa{\isacommand{try}}}} attempts to prove or disprove a subgoal
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2184 |     using a combination of provers and disprovers (\isa{{\isaliteral{22}{\isachardoublequote}}solve{\isaliteral{5F}{\isacharunderscore}}direct{\isaliteral{22}{\isachardoublequote}}},
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2185 |     \isa{{\isaliteral{22}{\isachardoublequote}}quickcheck{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}try{\isaliteral{5F}{\isacharunderscore}}methods{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}sledgehammer{\isaliteral{22}{\isachardoublequote}}},
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2186 |     \isa{{\isaliteral{22}{\isachardoublequote}}nitpick{\isaliteral{22}{\isachardoublequote}}}).
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2187 | |
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2188 |   \item \hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}} attempts to prove a subgoal using external
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2189 | automatic provers (resolution provers and SMT solvers). See the Sledgehammer | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2190 |     manual \cite{isabelle-sledgehammer} for details.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2191 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2192 |   \item \hyperlink{command.HOL.sledgehammer-params}{\mbox{\isa{\isacommand{sledgehammer{\isaliteral{5F}{\isacharunderscore}}params}}}} changes
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2193 |     \hyperlink{command.HOL.sledgehammer}{\mbox{\isa{\isacommand{sledgehammer}}}} configuration options persistently.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2194 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2195 |   \end{description}%
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2196 | \end{isamarkuptext}%
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2197 | \isamarkuptrue% | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2198 | % | 
| 31913 | 2199 | \isamarkupsection{Checking and refuting propositions%
 | 
| 2200 | } | |
| 2201 | \isamarkuptrue% | |
| 2202 | % | |
| 2203 | \begin{isamarkuptext}%
 | |
| 2204 | Identifying incorrect propositions usually involves evaluation of | |
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2205 | particular assignments and systematic counterexample search. This | 
| 31913 | 2206 | is supported by the following commands. | 
| 2207 | ||
| 2208 |   \begin{matharray}{rcl}
 | |
| 40406 | 2209 |     \indexdef{HOL}{command}{value}\hypertarget{command.HOL.value}{\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 2210 |     \indexdef{HOL}{command}{quickcheck}\hypertarget{command.HOL.quickcheck}{\hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2211 |     \indexdef{HOL}{command}{refute}\hypertarget{command.HOL.refute}{\hyperlink{command.HOL.refute}{\mbox{\isa{\isacommand{refute}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2212 |     \indexdef{HOL}{command}{nitpick}\hypertarget{command.HOL.nitpick}{\hyperlink{command.HOL.nitpick}{\mbox{\isa{\isacommand{nitpick}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2213 |     \indexdef{HOL}{command}{quickcheck\_params}\hypertarget{command.HOL.quickcheck-params}{\hyperlink{command.HOL.quickcheck-params}{\mbox{\isa{\isacommand{quickcheck{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2214 |     \indexdef{HOL}{command}{refute\_params}\hypertarget{command.HOL.refute-params}{\hyperlink{command.HOL.refute-params}{\mbox{\isa{\isacommand{refute{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2215 |     \indexdef{HOL}{command}{nitpick\_params}\hypertarget{command.HOL.nitpick-params}{\hyperlink{command.HOL.nitpick-params}{\mbox{\isa{\isacommand{nitpick{\isaliteral{5F}{\isacharunderscore}}params}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
 | 
| 31913 | 2216 |   \end{matharray}
 | 
| 2217 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2218 |   \begin{railoutput}
 | 
| 42662 | 2219 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2220 | \rail@term{\hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2221 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2222 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2223 | \rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2224 | \rail@nont{\isa{name}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2225 | \rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2226 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2227 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2228 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2229 | \rail@nont{\isa{modes}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2230 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2231 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2232 | \rail@end | 
| 42662 | 2233 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2234 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2235 | \rail@term{\hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2236 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2237 | \rail@term{\hyperlink{command.HOL.refute}{\mbox{\isa{\isacommand{refute}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2238 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2239 | \rail@term{\hyperlink{command.HOL.nitpick}{\mbox{\isa{\isacommand{nitpick}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2240 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2241 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2242 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2243 | \rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2244 | \rail@nont{\isa{args}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2245 | \rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2246 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2247 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2248 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2249 | \rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2250 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2251 | \rail@end | 
| 42662 | 2252 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2253 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2254 | \rail@term{\hyperlink{command.HOL.quickcheck-params}{\mbox{\isa{\isacommand{quickcheck{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2255 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2256 | \rail@term{\hyperlink{command.HOL.refute-params}{\mbox{\isa{\isacommand{refute{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2257 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2258 | \rail@term{\hyperlink{command.HOL.nitpick-params}{\mbox{\isa{\isacommand{nitpick{\isaliteral{5F}{\isacharunderscore}}params}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2259 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2260 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2261 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2262 | \rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2263 | \rail@nont{\isa{args}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2264 | \rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2265 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2266 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2267 | \rail@begin{2}{\isa{modes}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2268 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2269 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2270 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2271 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2272 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2273 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2274 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2275 | \rail@begin{2}{\isa{args}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2276 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2277 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2278 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2279 | \rail@nont{\isa{value}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2280 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2281 | \rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2282 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2283 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2284 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2285 | % FIXME check "value" | 
| 31913 | 2286 | |
| 2287 |   \begin{description}
 | |
| 2288 | ||
| 2289 |   \item \hyperlink{command.HOL.value}{\mbox{\isa{\isacommand{value}}}}~\isa{t} evaluates and prints a
 | |
| 2290 |     term; optionally \isa{modes} can be specified, which are
 | |
| 42926 | 2291 |     appended to the current print mode; see \secref{sec:print-modes}.
 | 
| 31913 | 2292 | Internally, the evaluation is performed by registered evaluators, | 
| 2293 | which are invoked sequentially until a result is returned. | |
| 2294 | Alternatively a specific evaluator can be selected using square | |
| 37444 | 2295 | brackets; typical evaluators use the current set of code equations | 
| 42926 | 2296 |     to normalize and include \isa{simp} for fully symbolic
 | 
| 2297 |     evaluation using the simplifier, \isa{nbe} for
 | |
| 2298 |     \emph{normalization by evaluation} and \emph{code} for code
 | |
| 2299 | generation in SML. | |
| 31913 | 2300 | |
| 2301 |   \item \hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}} tests the current goal for
 | |
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2302 | counterexamples using a series of assignments for its | 
| 31913 | 2303 | free variables; by default the first subgoal is tested, an other | 
| 2304 | can be selected explicitly using an optional goal index. | |
| 40937 | 2305 | Assignments can be chosen exhausting the search space upto a given | 
| 43914 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2306 | size, or using a fixed number of random assignments in the search space, | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2307 | or exploring the search space symbolically using narrowing. | 
| 40937 | 2308 | By default, quickcheck uses exhaustive testing. | 
| 31913 | 2309 | A number of configuration options are supported for | 
| 2310 |     \hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}}, notably:
 | |
| 2311 | ||
| 2312 |     \begin{description}
 | |
| 2313 | ||
| 43914 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2314 |     \item[\isa{tester}] specifies which testing approach to apply.
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2315 |       There are three testers, \isa{exhaustive},
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2316 |       \isa{random}, and \isa{narrowing}.
 | 
| 40937 | 2317 | An unknown configuration option is treated as an argument to tester, | 
| 2318 |       making \isa{{\isaliteral{22}{\isachardoublequote}}tester\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} optional.
 | |
| 43914 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2319 | When multiple testers are given, these are applied in parallel. | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2320 | If no tester is specified, quickcheck uses the testers that are | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2321 | set active, i.e., configurations | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2322 |       \isa{quickcheck{\isaliteral{5F}{\isacharunderscore}}exhaustive{\isaliteral{5F}{\isacharunderscore}}active}, \isa{quickcheck{\isaliteral{5F}{\isacharunderscore}}random{\isaliteral{5F}{\isacharunderscore}}active},
 | 
| 
64819f353c53
updating documentation about quickcheck; adding information about try
 bulwahn parents: 
43578diff
changeset | 2323 |       \isa{quickcheck{\isaliteral{5F}{\isacharunderscore}}narrowing{\isaliteral{5F}{\isacharunderscore}}active} are set to true.
 | 
| 40254 | 2324 |     \item[\isa{size}] specifies the maximum size of the search space
 | 
| 2325 | for assignment values. | |
| 2326 | ||
| 42123 | 2327 |     \item[\isa{eval}] takes a term or a list of terms and evaluates
 | 
| 2328 | these terms under the variable assignment found by quickcheck. | |
| 2329 | ||
| 40254 | 2330 |     \item[\isa{iterations}] sets how many sets of assignments are
 | 
| 2331 | generated for each particular size. | |
| 2332 | ||
| 40406 | 2333 |     \item[\isa{no{\isaliteral{5F}{\isacharunderscore}}assms}] specifies whether assumptions in
 | 
| 40254 | 2334 | structured proofs should be ignored. | 
| 2335 | ||
| 2336 |     \item[\isa{timeout}] sets the time limit in seconds.
 | |
| 31913 | 2337 | |
| 40406 | 2338 |     \item[\isa{default{\isaliteral{5F}{\isacharunderscore}}type}] sets the type(s) generally used to
 | 
| 40254 | 2339 | instantiate type variables. | 
| 2340 | ||
| 2341 |     \item[\isa{report}] if set quickcheck reports how many tests
 | |
| 2342 | fulfilled the preconditions. | |
| 31913 | 2343 | |
| 40254 | 2344 |     \item[\isa{quiet}] if not set quickcheck informs about the
 | 
| 2345 | current size for assignment values. | |
| 2346 | ||
| 2347 |     \item[\isa{expect}] can be used to check if the user's
 | |
| 40406 | 2348 |     expectation was met (\isa{no{\isaliteral{5F}{\isacharunderscore}}expectation}, \isa{no{\isaliteral{5F}{\isacharunderscore}}counterexample}, or \isa{counterexample}).
 | 
| 35351 
7425aece4ee3
allow general mixfix syntax for type constructors;
 wenzelm parents: 
34172diff
changeset | 2349 | |
| 31913 | 2350 |     \end{description}
 | 
| 2351 | ||
| 2352 | These option can be given within square brackets. | |
| 2353 | ||
| 42215 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2354 |   \item \hyperlink{command.HOL.quickcheck-params}{\mbox{\isa{\isacommand{quickcheck{\isaliteral{5F}{\isacharunderscore}}params}}}} changes
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2355 |     \hyperlink{command.HOL.quickcheck}{\mbox{\isa{\isacommand{quickcheck}}}} configuration options persistently.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2356 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2357 |   \item \hyperlink{command.HOL.refute}{\mbox{\isa{\isacommand{refute}}}} tests the current goal for
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2358 | counterexamples using a reduction to SAT. The following configuration | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2359 | options are supported: | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2360 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2361 |     \begin{description}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2362 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2363 |     \item[\isa{minsize}] specifies the minimum size (cardinality) of the
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2364 | models to search for. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2365 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2366 |     \item[\isa{maxsize}] specifies the maximum size (cardinality) of the
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2367 | models to search for. Nonpositive values mean $\infty$. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2368 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2369 |     \item[\isa{maxvars}] specifies the maximum number of Boolean variables
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2370 | to use when transforming the term into a propositional formula. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2371 | Nonpositive values mean $\infty$. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2372 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2373 |     \item[\isa{satsolver}] specifies the SAT solver to use.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2374 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2375 |     \item[\isa{no{\isaliteral{5F}{\isacharunderscore}}assms}] specifies whether assumptions in
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2376 | structured proofs should be ignored. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2377 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2378 |     \item[\isa{maxtime}] sets the time limit in seconds.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2379 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2380 |     \item[\isa{expect}] can be used to check if the user's
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2381 |     expectation was met (\isa{genuine}, \isa{potential},
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2382 |     \isa{none}, or \isa{unknown}).
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2383 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2384 |     \end{description}
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2385 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2386 | These option can be given within square brackets. | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2387 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2388 |   \item \hyperlink{command.HOL.refute-params}{\mbox{\isa{\isacommand{refute{\isaliteral{5F}{\isacharunderscore}}params}}}} changes
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2389 |     \hyperlink{command.HOL.refute}{\mbox{\isa{\isacommand{refute}}}} configuration options persistently.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2390 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2391 |   \item \hyperlink{command.HOL.nitpick}{\mbox{\isa{\isacommand{nitpick}}}} tests the current goal for counterexamples
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2392 | using a reduction to first-order relational logic. See the Nitpick manual | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2393 |     \cite{isabelle-nitpick} for details.
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2394 | |
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2395 |   \item \hyperlink{command.HOL.nitpick-params}{\mbox{\isa{\isacommand{nitpick{\isaliteral{5F}{\isacharunderscore}}params}}}} changes
 | 
| 
de9d43c427ae
document "nitpick(_params)", "refute(_params)", "try", "sledgehammer(_params)", and "solve_direct"
 blanchet parents: 
42123diff
changeset | 2396 |     \hyperlink{command.HOL.nitpick}{\mbox{\isa{\isacommand{nitpick}}}} configuration options persistently.
 | 
| 31913 | 2397 | |
| 2398 |   \end{description}%
 | |
| 2399 | \end{isamarkuptext}%
 | |
| 2400 | \isamarkuptrue% | |
| 2401 | % | |
| 28788 | 2402 | \isamarkupsection{Unstructured case analysis and induction \label{sec:hol-induct-tac}%
 | 
| 26849 | 2403 | } | 
| 2404 | \isamarkuptrue% | |
| 2405 | % | |
| 2406 | \begin{isamarkuptext}%
 | |
| 27124 | 2407 | The following tools of Isabelle/HOL support cases analysis and | 
| 2408 | induction in unstructured tactic scripts; see also | |
| 2409 |   \secref{sec:cases-induct} for proper Isar versions of similar ideas.
 | |
| 26849 | 2410 | |
| 2411 |   \begin{matharray}{rcl}
 | |
| 40406 | 2412 |     \indexdef{HOL}{method}{case\_tac}\hypertarget{method.HOL.case-tac}{\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
 | 
| 2413 |     \indexdef{HOL}{method}{induct\_tac}\hypertarget{method.HOL.induct-tac}{\hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
 | |
| 2414 |     \indexdef{HOL}{method}{ind\_cases}\hypertarget{method.HOL.ind-cases}{\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
 | |
| 2415 |     \indexdef{HOL}{command}{inductive\_cases}\hypertarget{command.HOL.inductive-cases}{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 26849 | 2416 |   \end{matharray}
 | 
| 2417 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2418 |   \begin{railoutput}
 | 
| 42662 | 2419 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2420 | \rail@term{\hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2421 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2422 | \rail@nextbar{1}
 | 
| 42705 | 2423 | \rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2424 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2425 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2426 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2427 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2428 | \rail@nont{\isa{rule}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2429 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2430 | \rail@end | 
| 42662 | 2431 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2432 | \rail@term{\hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2433 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2434 | \rail@nextbar{1}
 | 
| 42705 | 2435 | \rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2436 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2437 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2438 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2439 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2440 | \rail@nont{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2441 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2442 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2443 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2444 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2445 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2446 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2447 | \rail@nont{\isa{rule}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2448 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2449 | \rail@end | 
| 42662 | 2450 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2451 | \rail@term{\hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2452 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2453 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2454 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2455 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2456 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2457 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2458 | \rail@term{\isa{\isakeyword{for}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2459 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2460 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2461 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2462 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2463 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2464 | \rail@end | 
| 42662 | 2465 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2466 | \rail@term{\hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2467 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2468 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2469 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2470 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2471 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2472 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2473 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2474 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2475 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2476 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2477 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2478 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2479 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2480 | \rail@begin{1}{\isa{rule}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2481 | \rail@term{\isa{rule}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2482 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2483 | \rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2484 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2485 | \end{railoutput}
 | 
| 26849 | 2486 | |
| 2487 | ||
| 28788 | 2488 |   \begin{description}
 | 
| 26849 | 2489 | |
| 40406 | 2490 |   \item \hyperlink{method.HOL.case-tac}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}tac}}} and \hyperlink{method.HOL.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}} admit
 | 
| 28788 | 2491 | to reason about inductive types. Rules are selected according to | 
| 2492 |   the declarations by the \hyperlink{attribute.cases}{\mbox{\isa{cases}}} and \hyperlink{attribute.induct}{\mbox{\isa{induct}}}
 | |
| 2493 |   attributes, cf.\ \secref{sec:cases-induct}.  The \hyperlink{command.HOL.datatype}{\mbox{\isa{\isacommand{datatype}}}} package already takes care of this.
 | |
| 27124 | 2494 | |
| 2495 | These unstructured tactics feature both goal addressing and dynamic | |
| 26849 | 2496 |   instantiation.  Note that named rule cases are \emph{not} provided
 | 
| 27124 | 2497 |   as would be by the proper \hyperlink{method.cases}{\mbox{\isa{cases}}} and \hyperlink{method.induct}{\mbox{\isa{induct}}} proof
 | 
| 40406 | 2498 |   methods (see \secref{sec:cases-induct}).  Unlike the \hyperlink{method.induct}{\mbox{\isa{induct}}} method, \hyperlink{method.induct-tac}{\mbox{\isa{induct{\isaliteral{5F}{\isacharunderscore}}tac}}} does not handle structured rule
 | 
| 27124 | 2499 | statements, only the compact object-logic conclusion of the subgoal | 
| 2500 | being addressed. | |
| 42123 | 2501 | |
| 40406 | 2502 |   \item \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}} and \hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}} provide an interface to the internal \verb|mk_cases| operation.  Rules are simplified in an unrestricted
 | 
| 26861 | 2503 | forward manner. | 
| 26849 | 2504 | |
| 40406 | 2505 |   While \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}} is a proof method to apply the
 | 
| 2506 |   result immediately as elimination rules, \hyperlink{command.HOL.inductive-cases}{\mbox{\isa{\isacommand{inductive{\isaliteral{5F}{\isacharunderscore}}cases}}}} provides case split theorems at the theory level
 | |
| 2507 |   for later use.  The \hyperlink{keyword.for}{\mbox{\isa{\isakeyword{for}}}} argument of the \hyperlink{method.HOL.ind-cases}{\mbox{\isa{ind{\isaliteral{5F}{\isacharunderscore}}cases}}} method allows to specify a list of variables that should
 | |
| 26849 | 2508 | be generalized before applying the resulting rule. | 
| 2509 | ||
| 28788 | 2510 |   \end{description}%
 | 
| 26849 | 2511 | \end{isamarkuptext}%
 | 
| 2512 | \isamarkuptrue% | |
| 2513 | % | |
| 2514 | \isamarkupsection{Executable code%
 | |
| 2515 | } | |
| 2516 | \isamarkuptrue% | |
| 2517 | % | |
| 2518 | \begin{isamarkuptext}%
 | |
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2519 | For validation purposes, it is often useful to \emph{execute}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2520 | specifications. In principle, execution could be simulated by | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2521 | Isabelle's inference kernel, i.e. by a combination of resolution and | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2522 | simplification. Unfortunately, this approach is rather inefficient. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2523 | A more efficient way of executing specifications is to translate | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2524 | them into a functional programming language such as ML. | 
| 26849 | 2525 | |
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2526 | Isabelle provides two generic frameworks to support code generation | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2527 | from executable specifications. Isabelle/HOL instantiates these | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2528 | mechanisms in a way that is amenable to end-user applications.% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2529 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2530 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2531 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2532 | \isamarkupsubsection{The new code generator (F. Haftmann)%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2533 | } | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2534 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2535 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2536 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2537 | This framework generates code from functional programs | 
| 37422 | 2538 |   (including overloading using type classes) to SML \cite{SML}, OCaml
 | 
| 38813 | 2539 |   \cite{OCaml}, Haskell \cite{haskell-revised-report} and Scala
 | 
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2540 |   \cite{scala-overview-tech-report}.  Conceptually, code generation is
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2541 |   split up in three steps: \emph{selection} of code theorems,
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2542 |   \emph{translation} into an abstract executable view and
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2543 |   \emph{serialization} to a specific \emph{target language}.
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2544 | Inductive specifications can be executed using the predicate | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2545 |   compiler which operates within HOL.  See \cite{isabelle-codegen} for
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2546 | an introduction. | 
| 37422 | 2547 | |
| 2548 |   \begin{matharray}{rcl}
 | |
| 40406 | 2549 |     \indexdef{HOL}{command}{export\_code}\hypertarget{command.HOL.export-code}{\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isaliteral{5F}{\isacharunderscore}}code}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 37422 | 2550 |     \indexdef{HOL}{attribute}{code}\hypertarget{attribute.HOL.code}{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}} & : & \isa{attribute} \\
 | 
| 40406 | 2551 |     \indexdef{HOL}{command}{code\_abort}\hypertarget{command.HOL.code-abort}{\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}abort}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 2552 |     \indexdef{HOL}{command}{code\_datatype}\hypertarget{command.HOL.code-datatype}{\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}datatype}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2553 |     \indexdef{HOL}{command}{print\_codesetup}\hypertarget{command.HOL.print-codesetup}{\hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}codesetup}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2554 |     \indexdef{HOL}{attribute}{code\_inline}\hypertarget{attribute.HOL.code-inline}{\hyperlink{attribute.HOL.code-inline}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}inline}}}} & : & \isa{attribute} \\
 | |
| 2555 |     \indexdef{HOL}{attribute}{code\_post}\hypertarget{attribute.HOL.code-post}{\hyperlink{attribute.HOL.code-post}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}post}}}} & : & \isa{attribute} \\
 | |
| 2556 |     \indexdef{HOL}{command}{print\_codeproc}\hypertarget{command.HOL.print-codeproc}{\hyperlink{command.HOL.print-codeproc}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}codeproc}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2557 |     \indexdef{HOL}{command}{code\_thms}\hypertarget{command.HOL.code-thms}{\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}thms}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2558 |     \indexdef{HOL}{command}{code\_deps}\hypertarget{command.HOL.code-deps}{\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}deps}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2559 |     \indexdef{HOL}{command}{code\_const}\hypertarget{command.HOL.code-const}{\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}const}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2560 |     \indexdef{HOL}{command}{code\_type}\hypertarget{command.HOL.code-type}{\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}type}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2561 |     \indexdef{HOL}{command}{code\_class}\hypertarget{command.HOL.code-class}{\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}class}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2562 |     \indexdef{HOL}{command}{code\_instance}\hypertarget{command.HOL.code-instance}{\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}instance}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2563 |     \indexdef{HOL}{command}{code\_reserved}\hypertarget{command.HOL.code-reserved}{\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reserved}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2564 |     \indexdef{HOL}{command}{code\_monad}\hypertarget{command.HOL.code-monad}{\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}monad}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2565 |     \indexdef{HOL}{command}{code\_include}\hypertarget{command.HOL.code-include}{\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}include}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2566 |     \indexdef{HOL}{command}{code\_modulename}\hypertarget{command.HOL.code-modulename}{\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}modulename}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 2567 |     \indexdef{HOL}{command}{code\_reflect}\hypertarget{command.HOL.code-reflect}{\hyperlink{command.HOL.code-reflect}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reflect}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}}
 | |
| 37422 | 2568 |   \end{matharray}
 | 
| 2569 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2570 |   \begin{railoutput}
 | 
| 42662 | 2571 | \rail@begin{11}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2572 | \rail@term{\hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2573 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2574 | \rail@nont{\isa{constexpr}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2575 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2576 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2577 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2578 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2579 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2580 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2581 | \rail@term{\isa{\isakeyword{in}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2582 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2583 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2584 | \rail@nextbar{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2585 | \rail@term{\isa{\isakeyword{module{\isaliteral{5F}{\isacharunderscore}}name}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2586 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2587 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2588 | \rail@cr{7}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2589 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2590 | \rail@nextbar{8}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2591 | \rail@term{\isa{\isakeyword{file}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2592 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2593 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2594 | \rail@nextbar{9}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2595 | \rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2596 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2597 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2598 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2599 | \rail@nextbar{8}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2600 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2601 | \rail@nont{\isa{args}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2602 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2603 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2604 | \rail@nextplus{10}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2605 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2606 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2607 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2608 | \rail@begin{1}{\isa{const}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2609 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2610 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2611 | \rail@begin{3}{\isa{constexpr}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2612 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2613 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2614 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2615 | \rail@term{\isa{name{\isaliteral{2E}{\isachardot}}{\isaliteral{5F}{\isacharunderscore}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2616 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2617 | \rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2618 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2619 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2620 | \rail@begin{1}{\isa{typeconstructor}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2621 | \rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2622 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2623 | \rail@begin{1}{\isa{class}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2624 | \rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2625 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2626 | \rail@begin{4}{\isa{target}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2627 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2628 | \rail@term{\isa{SML}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2629 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2630 | \rail@term{\isa{OCaml}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2631 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2632 | \rail@term{\isa{Haskell}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2633 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2634 | \rail@term{\isa{Scala}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2635 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2636 | \rail@end | 
| 42662 | 2637 | \rail@begin{4}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2638 | \rail@term{\hyperlink{attribute.HOL.code}{\mbox{\isa{code}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2639 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2640 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2641 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2642 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2643 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2644 | \rail@term{\isa{abstype}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2645 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2646 | \rail@term{\isa{abstract}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2647 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2648 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2649 | \rail@end | 
| 42662 | 2650 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2651 | \rail@term{\hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}abort}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2652 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2653 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2654 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2655 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2656 | \rail@end | 
| 42662 | 2657 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2658 | \rail@term{\hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}datatype}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2659 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2660 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2661 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2662 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2663 | \rail@end | 
| 42662 | 2664 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2665 | \rail@term{\hyperlink{attribute.HOL.code-inline}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}inline}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2666 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2667 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2668 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2669 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2670 | \rail@end | 
| 42662 | 2671 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2672 | \rail@term{\hyperlink{attribute.HOL.code-post}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}post}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2673 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2674 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2675 | \rail@term{\isa{del}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2676 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2677 | \rail@end | 
| 42662 | 2678 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2679 | \rail@term{\hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}thms}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2680 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2681 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2682 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2683 | \rail@nont{\isa{constexpr}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2684 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2685 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2686 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2687 | \rail@end | 
| 42662 | 2688 | \rail@begin{3}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2689 | \rail@term{\hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}deps}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2690 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2691 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2692 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2693 | \rail@nont{\isa{constexpr}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2694 | \rail@nextplus{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2695 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2696 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2697 | \rail@end | 
| 42662 | 2698 | \rail@begin{7}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2699 | \rail@term{\hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}const}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2700 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2701 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2702 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2703 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2704 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2705 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2706 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2707 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2708 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2709 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2710 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2711 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2712 | \rail@nont{\isa{syntax}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2713 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2714 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2715 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2716 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2717 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2718 | \rail@nextplus{6}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2719 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2720 | \rail@end | 
| 42662 | 2721 | \rail@begin{7}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2722 | \rail@term{\hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}type}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2723 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2724 | \rail@nont{\isa{typeconstructor}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2725 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2726 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2727 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2728 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2729 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2730 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2731 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2732 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2733 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2734 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2735 | \rail@nont{\isa{syntax}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2736 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2737 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2738 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2739 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2740 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2741 | \rail@nextplus{6}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2742 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2743 | \rail@end | 
| 42662 | 2744 | \rail@begin{9}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2745 | \rail@term{\hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}class}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2746 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2747 | \rail@nont{\isa{class}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2748 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2749 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2750 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2751 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2752 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2753 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2754 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2755 | \rail@cr{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2756 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2757 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2758 | \rail@nextbar{6}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2759 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2760 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2761 | \rail@nextplus{7}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2762 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2763 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2764 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2765 | \rail@nextplus{8}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2766 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2767 | \rail@end | 
| 42662 | 2768 | \rail@begin{7}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2769 | \rail@term{\hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}instance}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2770 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2771 | \rail@nont{\isa{typeconstructor}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2772 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2773 | \rail@nont{\isa{class}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2774 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2775 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2776 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2777 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2778 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2779 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2780 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2781 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2782 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2783 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2784 | \rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2785 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2786 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2787 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2788 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2789 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2790 | \rail@nextplus{6}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2791 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2792 | \rail@end | 
| 42662 | 2793 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2794 | \rail@term{\hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reserved}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2795 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2796 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2797 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2798 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2799 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2800 | \rail@end | 
| 42662 | 2801 | \rail@begin{1}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2802 | \rail@term{\hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}monad}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2803 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2804 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2805 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2806 | \rail@end | 
| 42662 | 2807 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2808 | \rail@term{\hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}include}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2809 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2810 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2811 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2812 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2813 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2814 | \rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2815 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2816 | \rail@end | 
| 42662 | 2817 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2818 | \rail@term{\hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}modulename}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2819 | \rail@nont{\isa{target}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2820 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2821 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2822 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2823 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2824 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2825 | \rail@end | 
| 42662 | 2826 | \rail@begin{11}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2827 | \rail@term{\hyperlink{command.HOL.code-reflect}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reflect}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2828 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2829 | \rail@cr{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2830 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2831 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2832 | \rail@term{\isa{\isakeyword{datatypes}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2833 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2834 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2835 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2836 | \rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2837 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2838 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2839 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2840 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2841 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2842 | \rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2843 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2844 | \rail@nextplus{6}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2845 | \rail@cterm{\isa{\isakeyword{and}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2846 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2847 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2848 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2849 | \rail@cr{8}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2850 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2851 | \rail@nextbar{9}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2852 | \rail@term{\isa{\isakeyword{functions}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2853 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2854 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2855 | \rail@nextplus{10}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2856 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2857 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2858 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2859 | \rail@nextbar{9}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2860 | \rail@term{\isa{\isakeyword{file}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2861 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2862 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2863 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2864 | \rail@begin{4}{\isa{syntax}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2865 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2866 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2867 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2868 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2869 | \rail@term{\isa{\isakeyword{infix}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2870 | \rail@nextbar{2}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2871 | \rail@term{\isa{\isakeyword{infixl}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2872 | \rail@nextbar{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2873 | \rail@term{\isa{\isakeyword{infixr}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2874 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2875 | \rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2876 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2877 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2878 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 2879 | \end{railoutput}
 | 
| 37422 | 2880 | |
| 2881 | ||
| 2882 |   \begin{description}
 | |
| 2883 | ||
| 40406 | 2884 |   \item \hyperlink{command.HOL.export-code}{\mbox{\isa{\isacommand{export{\isaliteral{5F}{\isacharunderscore}}code}}}} generates code for a given list
 | 
| 39608 | 2885 | of constants in the specified target language(s). If no | 
| 2886 | serialization instruction is given, only abstract code is generated | |
| 2887 | internally. | |
| 37422 | 2888 | |
| 2889 | Constants may be specified by giving them literally, referring to | |
| 40406 | 2890 |   all executable contants within a certain theory by giving \isa{{\isaliteral{22}{\isachardoublequote}}name{\isaliteral{2E}{\isachardot}}{\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}}, or referring to \emph{all} executable constants currently
 | 
| 2891 |   available by giving \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}}.
 | |
| 37422 | 2892 | |
| 2893 | By default, for each involved theory one corresponding name space | |
| 2894 | module is generated. Alternativly, a module name may be specified | |
| 40406 | 2895 |   after the \hyperlink{keyword.module-name}{\mbox{\isa{\isakeyword{module{\isaliteral{5F}{\isacharunderscore}}name}}}} keyword; then \emph{all} code is
 | 
| 37422 | 2896 | placed in this module. | 
| 2897 | ||
| 39608 | 2898 |   For \emph{SML}, \emph{OCaml} and \emph{Scala} the file specification
 | 
| 2899 |   refers to a single file; for \emph{Haskell}, it refers to a whole
 | |
| 2900 | directory, where code is generated in multiple files reflecting the | |
| 2901 | module hierarchy. Omitting the file specification denotes standard | |
| 37749 | 2902 | output. | 
| 37422 | 2903 | |
| 2904 | Serializers take an optional list of arguments in parentheses. For | |
| 40406 | 2905 |   \emph{SML} and \emph{OCaml}, ``\isa{no{\isaliteral{5F}{\isacharunderscore}}signatures}`` omits
 | 
| 37422 | 2906 | explicit module signatures. | 
| 42123 | 2907 | |
| 39608 | 2908 |   For \emph{Haskell} a module name prefix may be given using the
 | 
| 40406 | 2909 |   ``\isa{{\isaliteral{22}{\isachardoublequote}}root{\isaliteral{3A}{\isacharcolon}}{\isaliteral{22}{\isachardoublequote}}}'' argument; ``\isa{string{\isaliteral{5F}{\isacharunderscore}}classes}'' adds a
 | 
| 39608 | 2910 | ``\verb|deriving (Read, Show)|'' clause to each appropriate | 
| 2911 | datatype declaration. | |
| 37422 | 2912 | |
| 2913 |   \item \hyperlink{attribute.HOL.code}{\mbox{\isa{code}}} explicitly selects (or with option
 | |
| 40406 | 2914 |   ``\isa{{\isaliteral{22}{\isachardoublequote}}del{\isaliteral{22}{\isachardoublequote}}}'' deselects) a code equation for code generation.
 | 
| 38462 
34d3de1254cd
formally document `code abstype` and `code abstract` attributes
 haftmann parents: 
37820diff
changeset | 2915 | Usually packages introducing code equations provide a reasonable | 
| 40406 | 2916 |   default setup for selection.  Variants \isa{{\isaliteral{22}{\isachardoublequote}}code\ abstype{\isaliteral{22}{\isachardoublequote}}} and
 | 
| 2917 |   \isa{{\isaliteral{22}{\isachardoublequote}}code\ abstract{\isaliteral{22}{\isachardoublequote}}} declare abstract datatype certificates or
 | |
| 38462 
34d3de1254cd
formally document `code abstype` and `code abstract` attributes
 haftmann parents: 
37820diff
changeset | 2918 | code equations on abstract datatype representations respectively. | 
| 37422 | 2919 | |
| 40406 | 2920 |   \item \hyperlink{command.HOL.code-abort}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}abort}}}} declares constants which are not
 | 
| 39608 | 2921 | required to have a definition by means of code equations; if needed | 
| 2922 | these are implemented by program abort instead. | |
| 37422 | 2923 | |
| 40406 | 2924 |   \item \hyperlink{command.HOL.code-datatype}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}datatype}}}} specifies a constructor set
 | 
| 37422 | 2925 | for a logical type. | 
| 2926 | ||
| 40406 | 2927 |   \item \hyperlink{command.HOL.print-codesetup}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}codesetup}}}} gives an overview on
 | 
| 37422 | 2928 | selected code equations and code generator datatypes. | 
| 2929 | ||
| 40406 | 2930 |   \item \hyperlink{attribute.HOL.code-inline}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}inline}}} declares (or with option
 | 
| 2931 |   ``\isa{{\isaliteral{22}{\isachardoublequote}}del{\isaliteral{22}{\isachardoublequote}}}'' removes) inlining theorems which are applied as
 | |
| 39608 | 2932 | rewrite rules to any code equation during preprocessing. | 
| 37422 | 2933 | |
| 40406 | 2934 |   \item \hyperlink{attribute.HOL.code-post}{\mbox{\isa{code{\isaliteral{5F}{\isacharunderscore}}post}}} declares (or with option ``\isa{{\isaliteral{22}{\isachardoublequote}}del{\isaliteral{22}{\isachardoublequote}}}'' removes) theorems which are applied as rewrite rules to any
 | 
| 39608 | 2935 | result of an evaluation. | 
| 37422 | 2936 | |
| 40406 | 2937 |   \item \hyperlink{command.HOL.print-codeproc}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}codeproc}}}} prints the setup of the code
 | 
| 39608 | 2938 | generator preprocessor. | 
| 37422 | 2939 | |
| 40406 | 2940 |   \item \hyperlink{command.HOL.code-thms}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}thms}}}} prints a list of theorems
 | 
| 37422 | 2941 | representing the corresponding program containing all given | 
| 2942 | constants after preprocessing. | |
| 2943 | ||
| 40406 | 2944 |   \item \hyperlink{command.HOL.code-deps}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}deps}}}} visualizes dependencies of
 | 
| 37422 | 2945 | theorems representing the corresponding program containing all given | 
| 2946 | constants after preprocessing. | |
| 2947 | ||
| 40406 | 2948 |   \item \hyperlink{command.HOL.code-const}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}const}}}} associates a list of constants
 | 
| 37422 | 2949 | with target-specific serializations; omitting a serialization | 
| 2950 | deletes an existing serialization. | |
| 2951 | ||
| 40406 | 2952 |   \item \hyperlink{command.HOL.code-type}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}type}}}} associates a list of type
 | 
| 37422 | 2953 | constructors with target-specific serializations; omitting a | 
| 2954 | serialization deletes an existing serialization. | |
| 2955 | ||
| 40406 | 2956 |   \item \hyperlink{command.HOL.code-class}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}class}}}} associates a list of classes
 | 
| 37422 | 2957 | with target-specific class names; omitting a serialization deletes | 
| 2958 |   an existing serialization.  This applies only to \emph{Haskell}.
 | |
| 2959 | ||
| 40406 | 2960 |   \item \hyperlink{command.HOL.code-instance}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}instance}}}} declares a list of type
 | 
| 37422 | 2961 | constructor / class instance relations as ``already present'' for a | 
| 40406 | 2962 |   given target.  Omitting a ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2D}{\isacharminus}}{\isaliteral{22}{\isachardoublequote}}}'' deletes an existing
 | 
| 37422 | 2963 | ``already present'' declaration. This applies only to | 
| 2964 |   \emph{Haskell}.
 | |
| 2965 | ||
| 40406 | 2966 |   \item \hyperlink{command.HOL.code-reserved}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reserved}}}} declares a list of names as
 | 
| 37422 | 2967 | reserved for a given target, preventing it to be shadowed by any | 
| 2968 | generated code. | |
| 2969 | ||
| 40406 | 2970 |   \item \hyperlink{command.HOL.code-monad}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}monad}}}} provides an auxiliary mechanism
 | 
| 37422 | 2971 | to generate monadic code for Haskell. | 
| 2972 | ||
| 40406 | 2973 |   \item \hyperlink{command.HOL.code-include}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}include}}}} adds arbitrary named content
 | 
| 2974 |   (``include'') to generated code.  A ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2D}{\isacharminus}}{\isaliteral{22}{\isachardoublequote}}}'' as last argument
 | |
| 37422 | 2975 | will remove an already added ``include''. | 
| 2976 | ||
| 40406 | 2977 |   \item \hyperlink{command.HOL.code-modulename}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}modulename}}}} declares aliasings from one
 | 
| 37422 | 2978 | module name onto another. | 
| 2979 | ||
| 40406 | 2980 |   \item \hyperlink{command.HOL.code-reflect}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}reflect}}}} without a ``\isa{{\isaliteral{22}{\isachardoublequote}}file{\isaliteral{22}{\isachardoublequote}}}''
 | 
| 39608 | 2981 | argument compiles code into the system runtime environment and | 
| 2982 | modifies the code generator setup that future invocations of system | |
| 40406 | 2983 |   runtime code generation referring to one of the ``\isa{{\isaliteral{22}{\isachardoublequote}}datatypes{\isaliteral{22}{\isachardoublequote}}}'' or ``\isa{{\isaliteral{22}{\isachardoublequote}}functions{\isaliteral{22}{\isachardoublequote}}}'' entities use these precompiled
 | 
| 2984 |   entities.  With a ``\isa{{\isaliteral{22}{\isachardoublequote}}file{\isaliteral{22}{\isachardoublequote}}}'' argument, the corresponding code
 | |
| 39608 | 2985 | is generated into that specified file without modifying the code | 
| 2986 | generator setup. | |
| 2987 | ||
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2988 |   \end{description}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2989 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2990 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2991 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2992 | \isamarkupsubsection{The old code generator (S. Berghofer)%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2993 | } | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2994 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2995 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2996 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2997 | This framework generates code from both functional and | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 2998 | relational programs to SML, as explained below. | 
| 26849 | 2999 | |
| 3000 |   \begin{matharray}{rcl}
 | |
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3001 |     \indexdef{}{command}{code\_module}\hypertarget{command.code-module}{\hyperlink{command.code-module}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3002 |     \indexdef{}{command}{code\_library}\hypertarget{command.code-library}{\hyperlink{command.code-library}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}library}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3003 |     \indexdef{}{command}{consts\_code}\hypertarget{command.consts-code}{\hyperlink{command.consts-code}{\mbox{\isa{\isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3004 |     \indexdef{}{command}{types\_code}\hypertarget{command.types-code}{\hyperlink{command.types-code}{\mbox{\isa{\isacommand{types{\isaliteral{5F}{\isacharunderscore}}code}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 42626 | 3005 |     \indexdef{}{attribute}{code}\hypertarget{attribute.code}{\hyperlink{attribute.code}{\mbox{\isa{code}}}} & : & \isa{attribute} \\
 | 
| 26849 | 3006 |   \end{matharray}
 | 
| 3007 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3008 |   \begin{railoutput}
 | 
| 42662 | 3009 | \rail@begin{11}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3010 | \rail@bar | 
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3011 | \rail@term{\hyperlink{command.code-module}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3012 | \rail@nextbar{1}
 | 
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3013 | \rail@term{\hyperlink{command.code-library}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}library}}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3014 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3015 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3016 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3017 | \rail@nont{\isa{modespec}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3018 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3019 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3020 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3021 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3022 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3023 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3024 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3025 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3026 | \rail@term{\isa{\isakeyword{file}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3027 | \rail@nont{\isa{name}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3028 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3029 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3030 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3031 | \rail@term{\isa{\isakeyword{imports}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3032 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3033 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3034 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3035 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3036 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3037 | \rail@cr{7}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3038 | \rail@term{\isa{\isakeyword{contains}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3039 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3040 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3041 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3042 | \rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3043 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3044 | \rail@nextplus{8}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3045 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3046 | \rail@nextbar{9}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3047 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3048 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3049 | \rail@nextplus{10}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3050 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3051 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3052 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3053 | \rail@begin{2}{\isa{modespec}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3054 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3055 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3056 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3057 | \rail@cnont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3058 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3059 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3060 | \rail@end | 
| 42662 | 3061 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3062 | \rail@term{\hyperlink{command.HOL.consts-code}{\mbox{\isa{\isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3063 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3064 | \rail@nont{\isa{codespec}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3065 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3066 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3067 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3068 | \rail@begin{2}{\isa{codespec}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3069 | \rail@nont{\isa{const}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3070 | \rail@nont{\isa{template}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3071 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3072 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3073 | \rail@nont{\isa{attachment}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3074 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3075 | \rail@end | 
| 42662 | 3076 | \rail@begin{2}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3077 | \rail@term{\hyperlink{command.HOL.types-code}{\mbox{\isa{\isacommand{types{\isaliteral{5F}{\isacharunderscore}}code}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3078 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3079 | \rail@nont{\isa{tycodespec}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3080 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3081 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3082 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3083 | \rail@begin{2}{\isa{tycodespec}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3084 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3085 | \rail@nont{\isa{template}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3086 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3087 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3088 | \rail@nont{\isa{attachment}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3089 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3090 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3091 | \rail@begin{1}{\isa{const}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3092 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3093 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3094 | \rail@begin{1}{\isa{template}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3095 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3096 | \rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3097 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3098 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3099 | \rail@begin{2}{\isa{attachment}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3100 | \rail@term{\isa{attach}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3101 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3102 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3103 | \rail@nont{\isa{modespec}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3104 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3105 | \rail@term{\isa{{\isaliteral{7B}{\isacharbraceleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3106 | \rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3107 | \rail@term{\isa{{\isaliteral{7D}{\isacharbraceright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3108 | \rail@end | 
| 42662 | 3109 | \rail@begin{2}{}
 | 
| 42626 | 3110 | \rail@term{\hyperlink{attribute.code}{\mbox{\isa{code}}}}[]
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3111 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3112 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3113 | \rail@nont{\isa{name}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3114 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3115 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3116 | \end{railoutput}%
 | 
| 26849 | 3117 | \end{isamarkuptext}%
 | 
| 3118 | \isamarkuptrue% | |
| 3119 | % | |
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3120 | \isamarkupsubsubsection{Invoking the code generator%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3121 | } | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3122 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3123 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3124 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3125 | The code generator is invoked via the \hyperlink{command.code-module}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}}}}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3126 |   and \hyperlink{command.code-library}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}library}}}} commands, which correspond to
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3127 |   \emph{incremental} and \emph{modular} code generation, respectively.
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3128 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3129 |   \begin{description}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3130 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3131 | \item [Modular] For each theory, an ML structure is generated, | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3132 | containing the code generated from the constants defined in this | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3133 | theory. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3134 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3135 | \item [Incremental] All the generated code is emitted into the same | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3136 | structure. This structure may import code from previously generated | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3137 |   structures, which can be specified via \hyperlink{keyword.imports}{\mbox{\isa{\isakeyword{imports}}}}.
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3138 | Moreover, the generated structure may also be referred to in later | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3139 | invocations of the code generator. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3140 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3141 |   \end{description}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3142 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3143 |   After the \hyperlink{command.code-module}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}}}} and \hyperlink{command.code-library}{\mbox{\isa{\isacommand{code{\isaliteral{5F}{\isacharunderscore}}library}}}}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3144 | keywords, the user may specify an optional list of ``modes'' in | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3145 | parentheses. These can be used to instruct the code generator to | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3146 | emit additional code for special purposes, e.g.\ functions for | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3147 | converting elements of generated datatypes to Isabelle terms, or | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3148 | test data generators. The list of modes is followed by a module | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3149 | name. The module name is optional for modular code generation, but | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3150 | must be specified for incremental code generation. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3151 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3152 | The code can either be written to a file, in which case a file name | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3153 |   has to be specified after the \hyperlink{keyword.file}{\mbox{\isa{\isakeyword{file}}}} keyword, or be loaded
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3154 | directly into Isabelle's ML environment. In the latter case, the | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3155 |   \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}} theory command can be used to inspect the results
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3156 | interactively, for example. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3157 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3158 | The terms from which to generate code can be specified after the | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3159 |   \hyperlink{keyword.contains}{\mbox{\isa{\isakeyword{contains}}}} keyword, either as a list of bindings, or just
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3160 | as a list of terms. In the latter case, the code generator just | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3161 | produces code for all constants and types occuring in the term, but | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3162 | does not bind the compiled terms to ML identifiers. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3163 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3164 | Here is an example:% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3165 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3166 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3167 | \isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3168 | \ Test\isanewline | 
| 42652 | 3169 | \isakeyword{contains}\ test\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{22}{\isachardoublequoteopen}}foldl\ op\ {\isaliteral{2B}{\isacharplus}}\ {\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ int{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5B}{\isacharbrackleft}}{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{2}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{3}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{4}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{5}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3170 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3171 | \noindent This binds the result of compiling the given term to | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3172 | the ML identifier \verb|Test.test|.% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3173 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3174 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3175 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3176 | \isadelimML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3177 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3178 | \endisadelimML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3179 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3180 | \isatagML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3181 | \isacommand{ML}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3182 | \ {\isaliteral{7B2A}{\isacharverbatimopen}}\ %
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3183 | \isaantiq | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3184 | assert{}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3185 | \endisaantiq | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3186 | \ {\isaliteral{28}{\isacharparenleft}}Test{\isaliteral{2E}{\isachardot}}test\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{1}}{\isadigit{5}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3187 | \endisatagML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3188 | {\isafoldML}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3189 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3190 | \isadelimML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3191 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3192 | \endisadelimML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3193 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3194 | \isamarkupsubsubsection{Configuring the code generator%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3195 | } | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3196 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3197 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3198 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3199 | When generating code for a complex term, the code generator | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3200 | recursively calls itself for all subterms. When it arrives at a | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3201 | constant, the default strategy of the code generator is to look up | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3202 | its definition and try to generate code for it. Constants which | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3203 | have no definitions that are immediately executable, may be | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3204 |   associated with a piece of ML code manually using the \indexref{}{command}{consts\_code}\hyperlink{command.consts-code}{\mbox{\isa{\isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}}}} command.  It takes a list whose elements consist of a
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3205 | constant (given in usual term syntax -- an explicit type constraint | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3206 | accounts for overloading), and a mixfix template describing the ML | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3207 | code. The latter is very much the same as the mixfix templates used | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3208 | when declaring new constants. The most notable difference is that | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3209 | terms may be included in the ML template using antiquotation | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3210 |   brackets \verb|{|\verb|*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*|\verb|}|.
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3211 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3212 |   A similar mechanism is available for types: \indexref{}{command}{types\_code}\hyperlink{command.types-code}{\mbox{\isa{\isacommand{types{\isaliteral{5F}{\isacharunderscore}}code}}}} associates type constructors with specific ML code.
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3213 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3214 | For example, the following declarations copied from \verb|~~/src/HOL/Product_Type.thy| describe how the product type of | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3215 | Isabelle/HOL should be compiled to ML.% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3216 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3217 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3218 | \isacommand{typedecl}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3219 | \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ prod\isanewline
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3220 | \isacommand{consts}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3221 | \ Pair\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{27}{\isacharprime}}a\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{27}{\isacharprime}}b\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{27}{\isacharprime}}a{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{27}{\isacharprime}}b{\isaliteral{29}{\isacharparenright}}\ prod{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3222 | \isanewline | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3223 | \isacommand{types{\isaliteral{5F}{\isacharunderscore}}code}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3224 | \ prod\ \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{2F}{\isacharslash}}\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}{\isaliteral{29}{\isacharparenright}}\isanewline
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3225 | \isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3226 | \ Pair\ \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{2C}{\isacharcomma}}{\isaliteral{2F}{\isacharslash}}\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}{\isaliteral{29}{\isacharparenright}}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3227 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3228 | Sometimes, the code associated with a constant or type may | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3229 | need to refer to auxiliary functions, which have to be emitted when | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3230 | the constant is used. Code for such auxiliary functions can be | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3231 |   declared using \hyperlink{keyword.attach}{\mbox{\isa{\isakeyword{attach}}}}. For example, the \isa{wfrec}
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3232 | function can be implemented as follows:% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3233 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3234 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3235 | \isacommand{consts{\isaliteral{5F}{\isacharunderscore}}code}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3236 | \ wfrec\ \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C6D6F64756C653E}{\isasymmodule}}wfrec{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequoteclose}}{\isaliteral{29}{\isacharparenright}}\ \ \isanewline
 | 
| 42652 | 3237 | \isakeyword{attach}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\ fun\ wfrec\ f\ x\ {\isaliteral{3D}{\isacharequal}}\ f\ {\isaliteral{28}{\isacharparenleft}}wfrec\ f{\isaliteral{29}{\isacharparenright}}\ x\ {\isaliteral{2A7D}{\isacharverbatimclose}}%
 | 
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3238 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3239 | If the code containing a call to \isa{wfrec} resides in an
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3240 | ML structure different from the one containing the function | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3241 |   definition attached to \isa{wfrec}, the name of the ML structure
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3242 |   (followed by a ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2E}{\isachardot}}{\isaliteral{22}{\isachardoublequote}}}'')  is inserted in place of ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6D6F64756C653E}{\isasymmodule}}{\isaliteral{22}{\isachardoublequote}}}'' in the above template.  The ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}''  means that
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3243 |   the code generator should ignore the first argument of \isa{wfrec}, i.e.\ the termination relation, which is usually not
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3244 | executable. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3245 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3246 | \medskip Another possibility of configuring the code generator is to | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3247 | register theorems to be used for code generation. Theorems can be | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3248 |   registered via the \hyperlink{attribute.code}{\mbox{\isa{code}}} attribute. It takes an optional
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3249 | name as an argument, which indicates the format of the | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3250 | theorem. Currently supported formats are equations (this is the | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3251 | default when no name is specified) and horn clauses (this is | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3252 |   indicated by the name \texttt{ind}). The left-hand sides of
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3253 | equations may only contain constructors and distinct variables, | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3254 | whereas horn clauses must have the same format as introduction rules | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3255 | of inductive definitions. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3256 | |
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3257 | The following example specifies three equations from which to | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3258 |   generate code for \isa{{\isaliteral{22}{\isachardoublequote}}op\ {\isaliteral{3C}{\isacharless}}{\isaliteral{22}{\isachardoublequote}}} on natural numbers (see also
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3259 | \verb|~~/src/HOL/Nat.thy|).% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3260 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3261 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3262 | \isacommand{lemma}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3263 | \ {\isaliteral{5B}{\isacharbrackleft}}code{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}Suc\ m\ {\isaliteral{3C}{\isacharless}}\ Suc\ n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}m\ {\isaliteral{3C}{\isacharless}}\ n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3264 | \ \ \isakeyword{and}\ {\isaliteral{5B}{\isacharbrackleft}}code{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{28}{\isacharparenleft}}n{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}nat{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3C}{\isacharless}}\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ False{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3265 | \ \ \isakeyword{and}\ {\isaliteral{5B}{\isacharbrackleft}}code{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}\ {\isaliteral{3C}{\isacharless}}\ Suc\ n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ True{\isaliteral{22}{\isachardoublequoteclose}}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3266 | \isadelimproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3267 | \ % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3268 | \endisadelimproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3269 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3270 | \isatagproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3271 | \isacommand{by}\isamarkupfalse%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3272 | \ simp{\isaliteral{5F}{\isacharunderscore}}all%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3273 | \endisatagproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3274 | {\isafoldproof}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3275 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3276 | \isadelimproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3277 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3278 | \endisadelimproof | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3279 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3280 | \isamarkupsubsubsection{Specific HOL code generators%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3281 | } | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3282 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3283 | % | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3284 | \begin{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3285 | The basic code generator framework offered by Isabelle/Pure | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3286 | has already been extended with additional code generators for | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3287 | specific HOL constructs. These include datatypes, recursive | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3288 | functions and inductive relations. The code generator for inductive | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3289 |   relations can handle expressions of the form \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}t\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C696E3E}{\isasymin}}\ r{\isaliteral{22}{\isachardoublequote}}}, where \isa{{\isaliteral{22}{\isachardoublequote}}r{\isaliteral{22}{\isachardoublequote}}} is an inductively defined relation. If at
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3290 |   least one of the \isa{{\isaliteral{22}{\isachardoublequote}}t\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} is a dummy pattern ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}'',
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3291 | the above expression evaluates to a sequence of possible answers. If | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3292 |   all of the \isa{{\isaliteral{22}{\isachardoublequote}}t\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} are proper terms, the expression evaluates
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3293 | to a boolean value. | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3294 | |
| 42652 | 3295 | The following example demonstrates this for beta-reduction on lambda | 
| 3296 | terms (see also \verb|~~/src/HOL/Proofs/Lambda/Lambda.thy|).% | |
| 3297 | \end{isamarkuptext}%
 | |
| 3298 | \isamarkuptrue% | |
| 3299 | \isacommand{datatype}\isamarkupfalse%
 | |
| 3300 | \ dB\ {\isaliteral{3D}{\isacharequal}}\isanewline
 | |
| 3301 | \ \ \ \ Var\ nat\isanewline | |
| 3302 | \ \ {\isaliteral{7C}{\isacharbar}}\ App\ dB\ dB\ \ {\isaliteral{28}{\isacharparenleft}}\isakeyword{infixl}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C6465677265653E}{\isasymdegree}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isadigit{2}}{\isadigit{0}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\isanewline
 | |
| 3303 | \ \ {\isaliteral{7C}{\isacharbar}}\ Abs\ dB\isanewline
 | |
| 3304 | \isanewline | |
| 3305 | \isacommand{primrec}\isamarkupfalse%
 | |
| 3306 | \ lift\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}dB\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ dB{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3307 | \isakeyword{where}\isanewline
 | |
| 3308 | \ \ \ \ {\isaliteral{22}{\isachardoublequoteopen}}lift\ {\isaliteral{28}{\isacharparenleft}}Var\ i{\isaliteral{29}{\isacharparenright}}\ k\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}if\ i\ {\isaliteral{3C}{\isacharless}}\ k\ then\ Var\ i\ else\ Var\ {\isaliteral{28}{\isacharparenleft}}i\ {\isaliteral{2B}{\isacharplus}}\ {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3309 | \ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}lift\ {\isaliteral{28}{\isacharparenleft}}s\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ t{\isaliteral{29}{\isacharparenright}}\ k\ {\isaliteral{3D}{\isacharequal}}\ lift\ s\ k\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ lift\ t\ k{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3310 | \ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}lift\ {\isaliteral{28}{\isacharparenleft}}Abs\ s{\isaliteral{29}{\isacharparenright}}\ k\ {\isaliteral{3D}{\isacharequal}}\ Abs\ {\isaliteral{28}{\isacharparenleft}}lift\ s\ {\isaliteral{28}{\isacharparenleft}}k\ {\isaliteral{2B}{\isacharplus}}\ {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3311 | \isanewline | |
| 3312 | \isacommand{primrec}\isamarkupfalse%
 | |
| 3313 | \ subst\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}dB\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ dB\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ dB{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{27}{\isacharprime}}{\isaliteral{2F}{\isacharslash}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{5B}{\isacharbrackleft}}{\isadigit{3}}{\isadigit{0}}{\isadigit{0}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{0}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{0}}{\isaliteral{5D}{\isacharbrackright}}\ {\isadigit{3}}{\isadigit{0}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\isanewline
 | |
| 3314 | \isakeyword{where}\isanewline
 | |
| 3315 | \ \ \ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}Var\ i{\isaliteral{29}{\isacharparenright}}{\isaliteral{5B}{\isacharbrackleft}}s{\isaliteral{2F}{\isacharslash}}k{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{3D}{\isacharequal}}\isanewline
 | |
| 3316 | \ \ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}if\ k\ {\isaliteral{3C}{\isacharless}}\ i\ then\ Var\ {\isaliteral{28}{\isacharparenleft}}i\ {\isaliteral{2D}{\isacharminus}}\ {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}\ else\ if\ i\ {\isaliteral{3D}{\isacharequal}}\ k\ then\ s\ else\ Var\ i{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3317 | \ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}t\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ u{\isaliteral{29}{\isacharparenright}}{\isaliteral{5B}{\isacharbrackleft}}s{\isaliteral{2F}{\isacharslash}}k{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{3D}{\isacharequal}}\ t{\isaliteral{5B}{\isacharbrackleft}}s{\isaliteral{2F}{\isacharslash}}k{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ u{\isaliteral{5B}{\isacharbrackleft}}s{\isaliteral{2F}{\isacharslash}}k{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3318 | \ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}Abs\ t{\isaliteral{29}{\isacharparenright}}{\isaliteral{5B}{\isacharbrackleft}}s{\isaliteral{2F}{\isacharslash}}k{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{3D}{\isacharequal}}\ Abs\ {\isaliteral{28}{\isacharparenleft}}t{\isaliteral{5B}{\isacharbrackleft}}lift\ s\ {\isadigit{0}}\ {\isaliteral{2F}{\isacharslash}}\ k{\isaliteral{2B}{\isacharplus}}{\isadigit{1}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3319 | \isanewline | |
| 3320 | \isacommand{inductive}\isamarkupfalse%
 | |
| 3321 | \ beta\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}dB\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ dB\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\ \ {\isaliteral{28}{\isacharparenleft}}\isakeyword{infixl}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isadigit{5}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\isanewline
 | |
| 3322 | \isakeyword{where}\isanewline
 | |
| 3323 | \ \ \ \ beta{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}Abs\ s\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ t\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ s{\isaliteral{5B}{\isacharbrackleft}}t{\isaliteral{2F}{\isacharslash}}{\isadigit{0}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3324 | \ \ {\isaliteral{7C}{\isacharbar}}\ appL{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}s\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ s\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ u\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ t\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ u{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3325 | \ \ {\isaliteral{7C}{\isacharbar}}\ appR{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}s\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ u\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ s\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ u\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ t{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3326 | \ \ {\isaliteral{7C}{\isacharbar}}\ abs{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}s\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Abs\ s\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ Abs\ t{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3327 | \isanewline | |
| 3328 | \isacommand{code{\isaliteral{5F}{\isacharunderscore}}module}\isamarkupfalse%
 | |
| 3329 | \ Test\isanewline | |
| 3330 | \isakeyword{contains}\isanewline
 | |
| 3331 | \ \ test{\isadigit{1}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{22}{\isachardoublequoteopen}}Abs\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ Var\ {\isadigit{0}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ Var\ {\isadigit{0}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
 | |
| 3332 | \ \ test{\isadigit{2}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{22}{\isachardoublequoteopen}}Abs\ {\isaliteral{28}{\isacharparenleft}}Abs\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isadigit{0}}\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ Var\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ {\isaliteral{28}{\isacharparenleft}}Abs\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6465677265653E}{\isasymdegree}}\ Var\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isaliteral{5C3C626574613E}{\isasymbeta}}\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequoteclose}}%
 | |
| 3333 | \begin{isamarkuptext}%
 | |
| 3334 | In the above example, \verb|Test.test1| evaluates to a boolean, | |
| 3335 | whereas \verb|Test.test2| is a lazy sequence whose elements can be | |
| 3336 | inspected separately.% | |
| 3337 | \end{isamarkuptext}%
 | |
| 3338 | \isamarkuptrue% | |
| 3339 | % | |
| 3340 | \isadelimML | |
| 3341 | % | |
| 3342 | \endisadelimML | |
| 3343 | % | |
| 3344 | \isatagML | |
| 3345 | \isacommand{ML}\isamarkupfalse%
 | |
| 3346 | \ {\isaliteral{7B2A}{\isacharverbatimopen}}\ %
 | |
| 3347 | \isaantiq | |
| 3348 | assert{}%
 | |
| 3349 | \endisaantiq | |
| 3350 | \ Test{\isaliteral{2E}{\isachardot}}test{\isadigit{1}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}\isanewline
 | |
| 3351 | \isacommand{ML}\isamarkupfalse%
 | |
| 3352 | \ {\isaliteral{7B2A}{\isacharverbatimopen}}\ val\ results\ {\isaliteral{3D}{\isacharequal}}\ DSeq{\isaliteral{2E}{\isachardot}}list{\isaliteral{5F}{\isacharunderscore}}of\ Test{\isaliteral{2E}{\isachardot}}test{\isadigit{2}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}\isanewline
 | |
| 3353 | \isacommand{ML}\isamarkupfalse%
 | |
| 3354 | \ {\isaliteral{7B2A}{\isacharverbatimopen}}\ %
 | |
| 3355 | \isaantiq | |
| 3356 | assert{}%
 | |
| 3357 | \endisaantiq | |
| 3358 | \ {\isaliteral{28}{\isacharparenleft}}length\ results\ {\isaliteral{3D}{\isacharequal}}\ {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}%
 | |
| 3359 | \endisatagML | |
| 3360 | {\isafoldML}%
 | |
| 3361 | % | |
| 3362 | \isadelimML | |
| 3363 | % | |
| 3364 | \endisadelimML | |
| 3365 | % | |
| 3366 | \begin{isamarkuptext}%
 | |
| 3367 | \medskip The theory underlying the HOL code generator is described | |
| 42627 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3368 |   more detailed in \cite{Berghofer-Nipkow:2002}. More examples that
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3369 | illustrate the usage of the code generator can be found e.g.\ in | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3370 | \verb|~~/src/HOL/MicroJava/J/JListExample.thy| and \verb|~~/src/HOL/MicroJava/JVM/JVMListExample.thy|.% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3371 | \end{isamarkuptext}%
 | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3372 | \isamarkuptrue% | 
| 
8749742785b8
moved material about old codegen to isar-ref manual;
 wenzelm parents: 
42626diff
changeset | 3373 | % | 
| 27047 | 3374 | \isamarkupsection{Definition by specification \label{sec:hol-specification}%
 | 
| 3375 | } | |
| 3376 | \isamarkuptrue% | |
| 3377 | % | |
| 3378 | \begin{isamarkuptext}%
 | |
| 3379 | \begin{matharray}{rcl}
 | |
| 40406 | 3380 |     \indexdef{HOL}{command}{specification}\hypertarget{command.HOL.specification}{\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 3381 |     \indexdef{HOL}{command}{ax\_specification}\hypertarget{command.HOL.ax-specification}{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | |
| 27047 | 3382 |   \end{matharray}
 | 
| 3383 | ||
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3384 |   \begin{railoutput}
 | 
| 42662 | 3385 | \rail@begin{6}{}
 | 
| 42596 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3386 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3387 | \rail@term{\hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3388 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3389 | \rail@term{\hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3390 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3391 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3392 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3393 | \rail@nont{\isa{decl}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3394 | \rail@nextplus{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3395 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3396 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3397 | \rail@cr{3}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3398 | \rail@plus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3399 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3400 | \rail@nextbar{4}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3401 | \rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3402 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3403 | \rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3404 | \rail@nextplus{5}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3405 | \rail@endplus | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3406 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3407 | \rail@begin{2}{\isa{decl}}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3408 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3409 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3410 | \rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3411 | \rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3412 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3413 | \rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3414 | \rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3415 | \rail@term{\isa{\isakeyword{overloaded}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3416 | \rail@bar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3417 | \rail@nextbar{1}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3418 | \rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3419 | \rail@endbar | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3420 | \rail@end | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3421 | \end{railoutput}
 | 
| 
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
 wenzelm parents: 
42215diff
changeset | 3422 | |
| 27047 | 3423 | |
| 28788 | 3424 |   \begin{description}
 | 
| 27047 | 3425 | |
| 40406 | 3426 |   \item \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}decls\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} sets up a
 | 
| 27047 | 3427 | goal stating the existence of terms with the properties specified to | 
| 3428 |   hold for the constants given in \isa{decls}.  After finishing the
 | |
| 3429 | proof, the theory will be augmented with definitions for the given | |
| 3430 | constants, as well as with theorems stating the properties for these | |
| 3431 | constants. | |
| 3432 | ||
| 40406 | 3433 |   \item \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}decls\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} sets up
 | 
| 28788 | 3434 | a goal stating the existence of terms with the properties specified | 
| 3435 |   to hold for the constants given in \isa{decls}.  After finishing
 | |
| 3436 | the proof, the theory will be augmented with axioms expressing the | |
| 3437 | properties given in the first place. | |
| 27047 | 3438 | |
| 28788 | 3439 |   \item \isa{decl} declares a constant to be defined by the
 | 
| 27047 | 3440 |   specification given.  The definition for the constant \isa{c} is
 | 
| 40406 | 3441 |   bound to the name \isa{c{\isaliteral{5F}{\isacharunderscore}}def} unless a theorem name is given in
 | 
| 27047 | 3442 | the declaration. Overloaded constants should be declared as such. | 
| 3443 | ||
| 28788 | 3444 |   \end{description}
 | 
| 27047 | 3445 | |
| 40406 | 3446 |   Whether to use \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}} or \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}} is to some extent a matter of style.  \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}} introduces no new axioms, and so by
 | 
| 3447 |   construction cannot introduce inconsistencies, whereas \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}} does introduce axioms, but only after the
 | |
| 27047 | 3448 | user has explicitly proven it to be safe. A practical issue must be | 
| 3449 | considered, though: After introducing two constants with the same | |
| 3450 |   properties using \hyperlink{command.HOL.specification}{\mbox{\isa{\isacommand{specification}}}}, one can prove
 | |
| 3451 | that the two constants are, in fact, equal. If this might be a | |
| 40406 | 3452 |   problem, one should use \hyperlink{command.HOL.ax-specification}{\mbox{\isa{\isacommand{ax{\isaliteral{5F}{\isacharunderscore}}specification}}}}.%
 | 
| 27047 | 3453 | \end{isamarkuptext}%
 | 
| 3454 | \isamarkuptrue% | |
| 3455 | % | |
| 26849 | 3456 | \isadelimtheory | 
| 3457 | % | |
| 3458 | \endisadelimtheory | |
| 3459 | % | |
| 3460 | \isatagtheory | |
| 26840 | 3461 | \isacommand{end}\isamarkupfalse%
 | 
| 3462 | % | |
| 3463 | \endisatagtheory | |
| 3464 | {\isafoldtheory}%
 | |
| 3465 | % | |
| 3466 | \isadelimtheory | |
| 3467 | % | |
| 3468 | \endisadelimtheory | |
| 26849 | 3469 | \isanewline | 
| 26840 | 3470 | \end{isabellebody}%
 | 
| 3471 | %%% Local Variables: | |
| 3472 | %%% mode: latex | |
| 3473 | %%% TeX-master: "root" | |
| 3474 | %%% End: |