| author | wenzelm | 
| Thu, 07 Apr 2011 21:23:57 +0200 | |
| changeset 42279 | 6da43a5018e2 | 
| parent 42247 | 12fe41a92cd5 | 
| child 42358 | b47d41d9f4b5 | 
| permissions | -rw-r--r-- | 
| 28762 | 1  | 
%  | 
2  | 
\begin{isabellebody}%
 | 
|
| 40406 | 3  | 
\def\isabellecontext{Inner{\isaliteral{5F}{\isacharunderscore}}Syntax}%
 | 
| 28762 | 4  | 
%  | 
5  | 
\isadelimtheory  | 
|
6  | 
%  | 
|
7  | 
\endisadelimtheory  | 
|
8  | 
%  | 
|
9  | 
\isatagtheory  | 
|
10  | 
\isacommand{theory}\isamarkupfalse%
 | 
|
| 40406 | 11  | 
\ Inner{\isaliteral{5F}{\isacharunderscore}}Syntax\isanewline
 | 
| 28762 | 12  | 
\isakeyword{imports}\ Main\isanewline
 | 
13  | 
\isakeyword{begin}%
 | 
|
14  | 
\endisatagtheory  | 
|
15  | 
{\isafoldtheory}%
 | 
|
16  | 
%  | 
|
17  | 
\isadelimtheory  | 
|
18  | 
%  | 
|
19  | 
\endisadelimtheory  | 
|
20  | 
%  | 
|
21  | 
\isamarkupchapter{Inner syntax --- the term language \label{ch:inner-syntax}%
 | 
|
22  | 
}  | 
|
23  | 
\isamarkuptrue%  | 
|
24  | 
%  | 
|
25  | 
\isamarkupsection{Printing logical entities%
 | 
|
26  | 
}  | 
|
27  | 
\isamarkuptrue%  | 
|
28  | 
%  | 
|
29  | 
\isamarkupsubsection{Diagnostic commands%
 | 
|
30  | 
}  | 
|
31  | 
\isamarkuptrue%  | 
|
32  | 
%  | 
|
33  | 
\begin{isamarkuptext}%
 | 
|
34  | 
\begin{matharray}{rcl}
 | 
|
| 40406 | 35  | 
    \indexdef{}{command}{typ}\hypertarget{command.typ}{\hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
36  | 
    \indexdef{}{command}{term}\hypertarget{command.term}{\hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
37  | 
    \indexdef{}{command}{prop}\hypertarget{command.prop}{\hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
38  | 
    \indexdef{}{command}{thm}\hypertarget{command.thm}{\hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
39  | 
    \indexdef{}{command}{prf}\hypertarget{command.prf}{\hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
40  | 
    \indexdef{}{command}{full\_prf}\hypertarget{command.full-prf}{\hyperlink{command.full-prf}{\mbox{\isa{\isacommand{full{\isaliteral{5F}{\isacharunderscore}}prf}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
41  | 
    \indexdef{}{command}{pr}\hypertarget{command.pr}{\hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}any\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 42  | 
  \end{matharray}
 | 
43  | 
||
44  | 
These diagnostic commands assist interactive development by printing  | 
|
45  | 
internal logical entities in a human-readable fashion.  | 
|
46  | 
||
47  | 
  \begin{rail}
 | 
|
48  | 
'typ' modes? type  | 
|
49  | 
;  | 
|
50  | 
'term' modes? term  | 
|
51  | 
;  | 
|
52  | 
'prop' modes? prop  | 
|
53  | 
;  | 
|
54  | 
'thm' modes? thmrefs  | 
|
55  | 
;  | 
|
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
56  | 
( 'prf' | 'full_prf' ) modes? thmrefs?  | 
| 28762 | 57  | 
;  | 
| 39165 | 58  | 
'pr' modes? nat?  | 
| 28762 | 59  | 
;  | 
60  | 
||
61  | 
    modes: '(' (name + ) ')'
 | 
|
62  | 
;  | 
|
63  | 
  \end{rail}
 | 
|
64  | 
||
65  | 
  \begin{description}
 | 
|
66  | 
||
| 40406 | 67  | 
  \item \hyperlink{command.typ}{\mbox{\isa{\isacommand{typ}}}}~\isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} reads and prints types of the
 | 
| 28762 | 68  | 
meta-logic according to the current theory or proof context.  | 
69  | 
||
| 40406 | 70  | 
  \item \hyperlink{command.term}{\mbox{\isa{\isacommand{term}}}}~\isa{t} and \hyperlink{command.prop}{\mbox{\isa{\isacommand{prop}}}}~\isa{{\isaliteral{5C3C7068693E}{\isasymphi}}}
 | 
| 28762 | 71  | 
read, type-check and print terms or propositions according to the  | 
72  | 
  current theory or proof context; the inferred type of \isa{t} is
 | 
|
73  | 
output as well. Note that these commands are also useful in  | 
|
74  | 
inspecting the current environment of term abbreviations.  | 
|
75  | 
||
| 40406 | 76  | 
  \item \hyperlink{command.thm}{\mbox{\isa{\isacommand{thm}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} retrieves
 | 
| 28762 | 77  | 
theorems from the current theory or proof context. Note that any  | 
78  | 
attributes included in the theorem specifications are applied to a  | 
|
79  | 
temporary context derived from the current theory or proof; the  | 
|
| 40406 | 80  | 
  result is discarded, i.e.\ attributes involved in \isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} do not have any permanent effect.
 | 
| 28762 | 81  | 
|
82  | 
  \item \hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}} displays the (compact) proof term of the
 | 
|
83  | 
current proof state (if present), or of the given theorems. Note  | 
|
84  | 
that this requires proof terms to be switched on for the current  | 
|
85  | 
object logic (see the ``Proof terms'' section of the Isabelle  | 
|
86  | 
reference manual for information on how to do this).  | 
|
87  | 
||
| 40406 | 88  | 
  \item \hyperlink{command.full-prf}{\mbox{\isa{\isacommand{full{\isaliteral{5F}{\isacharunderscore}}prf}}}} is like \hyperlink{command.prf}{\mbox{\isa{\isacommand{prf}}}}, but displays
 | 
| 28762 | 89  | 
the full proof term, i.e.\ also displays information omitted in the  | 
| 40406 | 90  | 
  compact proof term, which is denoted by ``\isa{{\isaliteral{5F}{\isacharunderscore}}}'' placeholders
 | 
| 28762 | 91  | 
there.  | 
92  | 
||
| 40406 | 93  | 
  \item \hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}goals{\isaliteral{22}{\isachardoublequote}}} prints the current proof state
 | 
| 39165 | 94  | 
(if present), including current facts and goals. The optional limit  | 
95  | 
arguments affect the number of goals to be displayed, which is  | 
|
96  | 
initially 10. Omitting limit value leaves the current setting  | 
|
97  | 
unchanged.  | 
|
| 28762 | 98  | 
|
99  | 
  \end{description}
 | 
|
100  | 
||
101  | 
  All of the diagnostic commands above admit a list of \isa{modes}
 | 
|
102  | 
to be specified, which is appended to the current print mode (see  | 
|
103  | 
  also \cite{isabelle-ref}).  Thus the output behavior may be modified
 | 
|
| 40406 | 104  | 
  according particular print mode features.  For example, \hyperlink{command.pr}{\mbox{\isa{\isacommand{pr}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}latex\ xsymbols{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} would print the current proof state
 | 
| 28762 | 105  | 
with mathematical symbols and special characters represented in  | 
106  | 
  {\LaTeX} source, according to the Isabelle style
 | 
|
107  | 
  \cite{isabelle-sys}.
 | 
|
108  | 
||
109  | 
  Note that antiquotations (cf.\ \secref{sec:antiq}) provide a more
 | 
|
110  | 
systematic way to include formal items into the printed text  | 
|
111  | 
document.%  | 
|
112  | 
\end{isamarkuptext}%
 | 
|
113  | 
\isamarkuptrue%  | 
|
114  | 
%  | 
|
115  | 
\isamarkupsubsection{Details of printed content%
 | 
|
116  | 
}  | 
|
117  | 
\isamarkuptrue%  | 
|
118  | 
%  | 
|
119  | 
\begin{isamarkuptext}%
 | 
|
120  | 
\begin{mldecls} 
 | 
|
| 
39134
 
917b4b6ba3d2
turned show_sorts/show_types into proper configuration options;
 
wenzelm 
parents: 
39130 
diff
changeset
 | 
121  | 
    \indexdef{}{ML}{show\_types}\verb|show_types: bool Config.T| & default \verb|false| \\
 | 
| 
 
917b4b6ba3d2
turned show_sorts/show_types into proper configuration options;
 
wenzelm 
parents: 
39130 
diff
changeset
 | 
122  | 
    \indexdef{}{ML}{show\_sorts}\verb|show_sorts: bool Config.T| & default \verb|false| \\
 | 
| 
39050
 
600de0485859
turned show_consts into proper configuration option;
 
wenzelm 
parents: 
38980 
diff
changeset
 | 
123  | 
    \indexdef{}{ML}{show\_consts}\verb|show_consts: bool Config.T| & default \verb|false| \\
 | 
| 
40879
 
ca132ef44944
configuration option "show_abbrevs" supersedes print mode "no_abbrevs", with inverted meaning;
 
wenzelm 
parents: 
40406 
diff
changeset
 | 
124  | 
    \indexdef{}{ML}{show\_abbrevs}\verb|show_abbrevs: bool Config.T| & default \verb|true| \\
 | 
| 32836 | 125  | 
    \indexdef{}{ML}{long\_names}\verb|long_names: bool Unsynchronized.ref| & default \verb|false| \\
 | 
126  | 
    \indexdef{}{ML}{short\_names}\verb|short_names: bool Unsynchronized.ref| & default \verb|false| \\
 | 
|
127  | 
    \indexdef{}{ML}{unique\_names}\verb|unique_names: bool Unsynchronized.ref| & default \verb|true| \\
 | 
|
| 
39137
 
ccb53edd59f0
turned show_brackets into proper configuration option;
 
wenzelm 
parents: 
39134 
diff
changeset
 | 
128  | 
    \indexdef{}{ML}{show\_brackets}\verb|show_brackets: bool Config.T| & default \verb|false| \\
 | 
| 39130 | 129  | 
    \indexdef{}{ML}{eta\_contract}\verb|eta_contract: bool Config.T| & default \verb|true| \\
 | 
130  | 
    \indexdef{}{ML}{Goal\_Display.goals\_limit}\verb|Goal_Display.goals_limit: int Config.T| & default \verb|10| \\
 | 
|
131  | 
    \indexdef{}{ML}{Goal\_Display.show\_main\_goal}\verb|Goal_Display.show_main_goal: bool Config.T| & default \verb|false| \\
 | 
|
| 39279 | 132  | 
    \indexdef{}{ML}{show\_hyps}\verb|show_hyps: bool Config.T| & default \verb|false| \\
 | 
133  | 
    \indexdef{}{ML}{show\_tags}\verb|show_tags: bool Config.T| & default \verb|false| \\
 | 
|
| 
38980
 
af73cf0dc31f
turned show_question_marks into proper configuration option;
 
wenzelm 
parents: 
36747 
diff
changeset
 | 
134  | 
    \indexdef{}{ML}{show\_question\_marks}\verb|show_question_marks: bool Config.T| & default \verb|true| \\
 | 
| 28762 | 135  | 
  \end{mldecls}
 | 
136  | 
||
137  | 
These global ML variables control the detail of information that is  | 
|
138  | 
displayed for types, terms, theorems, goals etc.  | 
|
139  | 
||
140  | 
In interactive sessions, the user interface usually manages these  | 
|
141  | 
global parameters of the Isabelle process, even with some concept of  | 
|
142  | 
persistence. Nonetheless it is occasionally useful to manipulate ML  | 
|
| 40406 | 143  | 
  variables directly, e.g.\ using \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}} or \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}}.
 | 
| 28762 | 144  | 
|
145  | 
Batch-mode logic sessions may be configured by putting appropriate  | 
|
146  | 
ML text directly into the \verb|ROOT.ML| file.  | 
|
147  | 
||
148  | 
  \begin{description}
 | 
|
149  | 
||
150  | 
\item \verb|show_types| and \verb|show_sorts| control printing of type  | 
|
151  | 
constraints for term variables, and sort constraints for type  | 
|
152  | 
variables. By default, neither of these are shown in output. If  | 
|
153  | 
\verb|show_sorts| is set to \verb|true|, types are always shown as  | 
|
154  | 
well.  | 
|
155  | 
||
156  | 
Note that displaying types and sorts may explain why a polymorphic  | 
|
157  | 
inference rule fails to resolve with some goal, or why a rewrite  | 
|
158  | 
rule does not apply as expected.  | 
|
159  | 
||
160  | 
\item \verb|show_consts| controls printing of types of constants when  | 
|
161  | 
displaying a goal state.  | 
|
162  | 
||
163  | 
Note that the output can be enormous, because polymorphic constants  | 
|
164  | 
often occur at several different type instances.  | 
|
165  | 
||
| 
40879
 
ca132ef44944
configuration option "show_abbrevs" supersedes print mode "no_abbrevs", with inverted meaning;
 
wenzelm 
parents: 
40406 
diff
changeset
 | 
166  | 
\item \verb|show_abbrevs| controls folding of constant abbreviations.  | 
| 
 
ca132ef44944
configuration option "show_abbrevs" supersedes print mode "no_abbrevs", with inverted meaning;
 
wenzelm 
parents: 
40406 
diff
changeset
 | 
167  | 
|
| 28762 | 168  | 
\item \verb|long_names|, \verb|short_names|, and \verb|unique_names|  | 
169  | 
control the way of printing fully qualified internal names in  | 
|
170  | 
  external form.  See also \secref{sec:antiq} for the document
 | 
|
171  | 
antiquotation options of the same names.  | 
|
172  | 
||
173  | 
\item \verb|show_brackets| controls bracketing in pretty printed  | 
|
174  | 
output. If set to \verb|true|, all sub-expressions of the pretty  | 
|
175  | 
printing tree will be parenthesized, even if this produces malformed  | 
|
176  | 
term syntax! This crude way of showing the internal structure of  | 
|
177  | 
pretty printed entities may occasionally help to diagnose problems  | 
|
178  | 
with operator priorities, for example.  | 
|
179  | 
||
| 40406 | 180  | 
  \item \verb|eta_contract| controls \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6574613E}{\isasymeta}}{\isaliteral{22}{\isachardoublequote}}}-contracted printing of
 | 
| 28762 | 181  | 
terms.  | 
182  | 
||
| 40406 | 183  | 
  The \isa{{\isaliteral{5C3C6574613E}{\isasymeta}}}-contraction law asserts \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ f\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ f{\isaliteral{22}{\isachardoublequote}}},
 | 
| 28762 | 184  | 
  provided \isa{x} is not free in \isa{f}.  It asserts
 | 
| 40406 | 185  | 
  \emph{extensionality} of functions: \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ g{\isaliteral{22}{\isachardoublequote}}} if \isa{{\isaliteral{22}{\isachardoublequote}}f\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ g\ x{\isaliteral{22}{\isachardoublequote}}} for all \isa{x}.  Higher-order unification frequently puts
 | 
186  | 
  terms into a fully \isa{{\isaliteral{5C3C6574613E}{\isasymeta}}}-expanded form.  For example, if \isa{F} has type \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} then its expanded form is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}h{\isaliteral{2E}{\isachardot}}\ F\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ h\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.
 | 
|
| 28762 | 187  | 
|
| 40406 | 188  | 
  Setting \verb|eta_contract| makes Isabelle perform \isa{{\isaliteral{5C3C6574613E}{\isasymeta}}}-contractions before printing, so that \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}h{\isaliteral{2E}{\isachardot}}\ F\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x{\isaliteral{2E}{\isachardot}}\ h\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}
 | 
| 28762 | 189  | 
  appears simply as \isa{F}.
 | 
190  | 
||
| 40406 | 191  | 
  Note that the distinction between a term and its \isa{{\isaliteral{5C3C6574613E}{\isasymeta}}}-expanded
 | 
| 28762 | 192  | 
form occasionally matters. While higher-order resolution and  | 
| 40406 | 193  | 
  rewriting operate modulo \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{5C3C6574613E}{\isasymeta}}{\isaliteral{22}{\isachardoublequote}}}-conversion, some other tools
 | 
| 28762 | 194  | 
might look at terms more discretely.  | 
195  | 
||
| 39130 | 196  | 
\item \verb|Goal_Display.goals_limit| controls the maximum number of  | 
197  | 
subgoals to be shown in goal output.  | 
|
| 28762 | 198  | 
|
| 39130 | 199  | 
\item \verb|Goal_Display.show_main_goal| controls whether the main  | 
200  | 
result to be proven should be displayed. This information might be  | 
|
201  | 
relevant for schematic goals, to inspect the current claim that has  | 
|
202  | 
been synthesized so far.  | 
|
| 28762 | 203  | 
|
204  | 
\item \verb|show_hyps| controls printing of implicit hypotheses of  | 
|
205  | 
local facts. Normally, only those hypotheses are displayed that are  | 
|
206  | 
  \emph{not} covered by the assumptions of the current context: this
 | 
|
207  | 
situation indicates a fault in some tool being used.  | 
|
208  | 
||
209  | 
  By setting \verb|show_hyps| to \verb|true|, output of \emph{all}
 | 
|
210  | 
hypotheses can be enforced, which is occasionally useful for  | 
|
211  | 
diagnostic purposes.  | 
|
212  | 
||
213  | 
\item \verb|show_tags| controls printing of extra annotations within  | 
|
214  | 
theorems, such as internal position information, or the case names  | 
|
| 40406 | 215  | 
  being attached by the attribute \hyperlink{attribute.case-names}{\mbox{\isa{case{\isaliteral{5F}{\isacharunderscore}}names}}}.
 | 
| 28762 | 216  | 
|
217  | 
  Note that the \hyperlink{attribute.tagged}{\mbox{\isa{tagged}}} and \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}
 | 
|
218  | 
attributes provide low-level access to the collection of tags  | 
|
219  | 
associated with a theorem.  | 
|
220  | 
||
221  | 
\item \verb|show_question_marks| controls printing of question marks  | 
|
| 40406 | 222  | 
  for schematic variables, such as \isa{{\isaliteral{3F}{\isacharquery}}x}.  Only the leading
 | 
| 28762 | 223  | 
question mark is affected, the remaining text is unchanged  | 
224  | 
(including proper markup for schematic variables that might be  | 
|
225  | 
relevant for user interfaces).  | 
|
226  | 
||
227  | 
  \end{description}%
 | 
|
228  | 
\end{isamarkuptext}%
 | 
|
229  | 
\isamarkuptrue%  | 
|
230  | 
%  | 
|
231  | 
\isamarkupsubsection{Printing limits%
 | 
|
232  | 
}  | 
|
233  | 
\isamarkuptrue%  | 
|
234  | 
%  | 
|
235  | 
\begin{isamarkuptext}%
 | 
|
236  | 
\begin{mldecls}
 | 
|
| 36745 | 237  | 
    \indexdef{}{ML}{Pretty.margin\_default}\verb|Pretty.margin_default: int Unsynchronized.ref| \\
 | 
| 30121 | 238  | 
    \indexdef{}{ML}{print\_depth}\verb|print_depth: int -> unit| \\
 | 
| 28762 | 239  | 
  \end{mldecls}
 | 
240  | 
||
241  | 
These ML functions set limits for pretty printed text.  | 
|
242  | 
||
243  | 
  \begin{description}
 | 
|
244  | 
||
| 36745 | 245  | 
\item \verb|Pretty.margin_default| indicates the global default for  | 
246  | 
the right margin of the built-in pretty printer, with initial value  | 
|
247  | 
76. Note that user-interfaces typically control margins  | 
|
248  | 
automatically when resizing windows, or even bypass the formatting  | 
|
249  | 
engine of Isabelle/ML altogether and do it within the front end via  | 
|
250  | 
Isabelle/Scala.  | 
|
| 28762 | 251  | 
|
252  | 
  \item \verb|print_depth|~\isa{n} limits the printing depth of the
 | 
|
253  | 
ML toplevel pretty printer; the precise effect depends on the ML  | 
|
254  | 
  compiler and run-time system.  Typically \isa{n} should be less
 | 
|
255  | 
than 10. Bigger values such as 100--1000 are useful for debugging.  | 
|
256  | 
||
257  | 
  \end{description}%
 | 
|
258  | 
\end{isamarkuptext}%
 | 
|
259  | 
\isamarkuptrue%  | 
|
260  | 
%  | 
|
261  | 
\isamarkupsection{Mixfix annotations%
 | 
|
262  | 
}  | 
|
263  | 
\isamarkuptrue%  | 
|
264  | 
%  | 
|
265  | 
\begin{isamarkuptext}%
 | 
|
266  | 
Mixfix annotations specify concrete \emph{inner syntax} of
 | 
|
| 
35351
 
7425aece4ee3
allow general mixfix syntax for type constructors;
 
wenzelm 
parents: 
32836 
diff
changeset
 | 
267  | 
Isabelle types and terms. Locally fixed parameters in toplevel  | 
| 
 
7425aece4ee3
allow general mixfix syntax for type constructors;
 
wenzelm 
parents: 
32836 
diff
changeset
 | 
268  | 
theorem statements, locale specifications etc.\ also admit mixfix  | 
| 
 
7425aece4ee3
allow general mixfix syntax for type constructors;
 
wenzelm 
parents: 
32836 
diff
changeset
 | 
269  | 
annotations.  | 
| 28762 | 270  | 
|
271  | 
  \indexouternonterm{infix}\indexouternonterm{mixfix}\indexouternonterm{structmixfix}
 | 
|
272  | 
  \begin{rail}
 | 
|
273  | 
    infix: '(' ('infix' | 'infixl' | 'infixr') string nat ')'
 | 
|
274  | 
;  | 
|
275  | 
    mixfix: infix | '(' string prios? nat? ')' | '(' 'binder' string prios? nat ')'
 | 
|
276  | 
;  | 
|
277  | 
    structmixfix: mixfix | '(' 'structure' ')'
 | 
|
278  | 
;  | 
|
279  | 
||
280  | 
prios: '[' (nat + ',') ']'  | 
|
281  | 
;  | 
|
282  | 
  \end{rail}
 | 
|
283  | 
||
284  | 
  Here the \railtok{string} specifications refer to the actual mixfix
 | 
|
285  | 
template, which may include literal text, spacing, blocks, and  | 
|
| 40406 | 286  | 
  arguments (denoted by ``\isa{{\isaliteral{5F}{\isacharunderscore}}}''); the special symbol
 | 
287  | 
  ``\verb|\<index>|'' (printed as ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C696E6465783E}{\isasymindex}}{\isaliteral{22}{\isachardoublequote}}}'') represents an index
 | 
|
| 28762 | 288  | 
argument that specifies an implicit structure reference (see also  | 
289  | 
  \secref{sec:locale}).  Infix and binder declarations provide common
 | 
|
290  | 
abbreviations for particular mixfix declarations. So in practice,  | 
|
291  | 
mixfix templates mostly degenerate to literal text for concrete  | 
|
292  | 
syntax, such as ``\verb|++|'' for an infix symbol.  | 
|
293  | 
||
294  | 
\medskip In full generality, mixfix declarations work as follows.  | 
|
| 40406 | 295  | 
  Suppose a constant \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} is
 | 
296  | 
  annotated by \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}mixfix\ {\isaliteral{5B}{\isacharbrackleft}}p\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{5D}{\isacharbrackright}}\ p{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, where \isa{{\isaliteral{22}{\isachardoublequote}}mixfix{\isaliteral{22}{\isachardoublequote}}} is a string \isa{{\isaliteral{22}{\isachardoublequote}}d\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{0}}\ {\isaliteral{5F}{\isacharunderscore}}\ d\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5F}{\isacharunderscore}}\ d\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} consisting of
 | 
|
| 28762 | 297  | 
delimiters that surround argument positions as indicated by  | 
298  | 
underscores.  | 
|
299  | 
||
300  | 
Altogether this determines a production for a context-free priority  | 
|
| 40406 | 301  | 
  grammar, where for each argument \isa{{\isaliteral{22}{\isachardoublequote}}i{\isaliteral{22}{\isachardoublequote}}} the syntactic category
 | 
302  | 
  is determined by \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} (with priority \isa{{\isaliteral{22}{\isachardoublequote}}p\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}}), and
 | 
|
303  | 
  the result category is determined from \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} (with
 | 
|
304  | 
  priority \isa{{\isaliteral{22}{\isachardoublequote}}p{\isaliteral{22}{\isachardoublequote}}}).  Priority specifications are optional, with
 | 
|
| 28762 | 305  | 
default 0 for arguments and 1000 for the result.  | 
306  | 
||
| 40406 | 307  | 
  Since \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} may be again a function type, the constant
 | 
| 28762 | 308  | 
type scheme may have more argument positions than the mixfix  | 
| 40406 | 309  | 
  pattern.  Printing a nested application \isa{{\isaliteral{22}{\isachardoublequote}}c\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{22}{\isachardoublequote}}} for
 | 
310  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}m\ {\isaliteral{3E}{\isachargreater}}\ n{\isaliteral{22}{\isachardoublequote}}} works by attaching concrete notation only to the
 | 
|
311  | 
  innermost part, essentially by printing \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}c\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ t\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{22}{\isachardoublequote}}}
 | 
|
| 28762 | 312  | 
instead. If a term has fewer arguments than specified in the mixfix  | 
313  | 
template, the concrete syntax is ignored.  | 
|
314  | 
||
315  | 
\medskip A mixfix template may also contain additional directives  | 
|
316  | 
for pretty printing, notably spaces, blocks, and breaks. The  | 
|
317  | 
general template format is a sequence over any of the following  | 
|
318  | 
entities.  | 
|
319  | 
||
320  | 
  \begin{description}
 | 
|
321  | 
||
| 40406 | 322  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}d{\isaliteral{22}{\isachardoublequote}}} is a delimiter, namely a non-empty sequence of
 | 
| 28762 | 323  | 
characters other than the following special characters:  | 
324  | 
||
325  | 
\smallskip  | 
|
326  | 
  \begin{tabular}{ll}
 | 
|
327  | 
\verb|'| & single quote \\  | 
|
328  | 
\verb|_| & underscore \\  | 
|
| 40406 | 329  | 
    \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C696E6465783E}{\isasymindex}}{\isaliteral{22}{\isachardoublequote}}} & index symbol \\
 | 
| 28762 | 330  | 
\verb|(| & open parenthesis \\  | 
331  | 
\verb|)| & close parenthesis \\  | 
|
332  | 
\verb|/| & slash \\  | 
|
333  | 
  \end{tabular}
 | 
|
334  | 
\medskip  | 
|
335  | 
||
336  | 
\item \verb|'| escapes the special meaning of these  | 
|
337  | 
meta-characters, producing a literal version of the following  | 
|
338  | 
character, unless that is a blank.  | 
|
339  | 
||
340  | 
A single quote followed by a blank separates delimiters, without  | 
|
341  | 
affecting printing, but input tokens may have additional white space  | 
|
342  | 
here.  | 
|
343  | 
||
344  | 
\item \verb|_| is an argument position, which stands for a  | 
|
345  | 
certain syntactic category in the underlying grammar.  | 
|
346  | 
||
| 40406 | 347  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C696E6465783E}{\isasymindex}}{\isaliteral{22}{\isachardoublequote}}} is an indexed argument position; this is the place
 | 
| 28762 | 348  | 
where implicit structure arguments can be attached.  | 
349  | 
||
| 40406 | 350  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}s{\isaliteral{22}{\isachardoublequote}}} is a non-empty sequence of spaces for printing.
 | 
| 28762 | 351  | 
This and the following specifications do not affect parsing at all.  | 
352  | 
||
353  | 
  \item \verb|(|\isa{n} opens a pretty printing block.  The
 | 
|
354  | 
optional number specifies how much indentation to add when a line  | 
|
355  | 
break occurs within the block. If the parenthesis is not followed  | 
|
356  | 
by digits, the indentation defaults to 0. A block specified via  | 
|
357  | 
\verb|(00| is unbreakable.  | 
|
358  | 
||
359  | 
\item \verb|)| closes a pretty printing block.  | 
|
360  | 
||
361  | 
\item \verb|//| forces a line break.  | 
|
362  | 
||
363  | 
  \item \verb|/|\isa{s} allows a line break.  Here \isa{s}
 | 
|
364  | 
stands for the string of spaces (zero or more) right after the  | 
|
365  | 
  slash.  These spaces are printed if the break is \emph{not} taken.
 | 
|
366  | 
||
367  | 
  \end{description}
 | 
|
368  | 
||
369  | 
For example, the template \verb|(_ +/ _)| specifies an infix  | 
|
370  | 
operator. There are two argument positions; the delimiter  | 
|
371  | 
\verb|+| is preceded by a space and followed by a space or  | 
|
372  | 
line break; the entire phrase is a pretty printing block.  | 
|
373  | 
||
374  | 
The general idea of pretty printing with blocks and breaks is also  | 
|
375  | 
  described in \cite{paulson-ml2}.%
 | 
|
376  | 
\end{isamarkuptext}%
 | 
|
377  | 
\isamarkuptrue%  | 
|
378  | 
%  | 
|
| 35414 | 379  | 
\isamarkupsection{Explicit notation%
 | 
| 28762 | 380  | 
}  | 
381  | 
\isamarkuptrue%  | 
|
382  | 
%  | 
|
383  | 
\begin{isamarkuptext}%
 | 
|
384  | 
\begin{matharray}{rcll}
 | 
|
| 40406 | 385  | 
    \indexdef{}{command}{type\_notation}\hypertarget{command.type-notation}{\hyperlink{command.type-notation}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}notation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
386  | 
    \indexdef{}{command}{no\_type\_notation}\hypertarget{command.no-type-notation}{\hyperlink{command.no-type-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}type{\isaliteral{5F}{\isacharunderscore}}notation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
387  | 
    \indexdef{}{command}{notation}\hypertarget{command.notation}{\hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
388  | 
    \indexdef{}{command}{no\_notation}\hypertarget{command.no-notation}{\hyperlink{command.no-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}notation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
389  | 
    \indexdef{}{command}{write}\hypertarget{command.write}{\hyperlink{command.write}{\mbox{\isa{\isacommand{write}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 390  | 
  \end{matharray}
 | 
391  | 
||
392  | 
  \begin{rail}
 | 
|
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
393  | 
    ('type_notation' | 'no_type_notation') target? mode? \\ (nameref mixfix + 'and')
 | 
| 35414 | 394  | 
;  | 
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
395  | 
    ('notation' | 'no_notation') target? mode? \\ (nameref structmixfix + 'and')
 | 
| 28762 | 396  | 
;  | 
| 
36508
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
397  | 
'write' mode? (nameref structmixfix + 'and')  | 
| 
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
398  | 
;  | 
| 28762 | 399  | 
  \end{rail}
 | 
400  | 
||
401  | 
  \begin{description}
 | 
|
402  | 
||
| 40406 | 403  | 
  \item \hyperlink{command.type-notation}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}notation}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{28}{\isacharparenleft}}mx{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} associates mixfix
 | 
| 35414 | 404  | 
syntax with an existing type constructor. The arity of the  | 
405  | 
constructor is retrieved from the context.  | 
|
406  | 
||
| 40406 | 407  | 
  \item \hyperlink{command.no-type-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}type{\isaliteral{5F}{\isacharunderscore}}notation}}}} is similar to \hyperlink{command.type-notation}{\mbox{\isa{\isacommand{type{\isaliteral{5F}{\isacharunderscore}}notation}}}}, but removes the specified syntax annotation from
 | 
| 35414 | 408  | 
the present context.  | 
409  | 
||
| 40406 | 410  | 
  \item \hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{28}{\isacharparenleft}}mx{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} associates mixfix
 | 
| 35414 | 411  | 
syntax with an existing constant or fixed variable. The type  | 
412  | 
declaration of the given entity is retrieved from the context.  | 
|
| 28762 | 413  | 
|
| 40406 | 414  | 
  \item \hyperlink{command.no-notation}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}notation}}}} is similar to \hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}},
 | 
| 28762 | 415  | 
but removes the specified syntax annotation from the present  | 
416  | 
context.  | 
|
417  | 
||
| 
36508
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
418  | 
  \item \hyperlink{command.write}{\mbox{\isa{\isacommand{write}}}} is similar to \hyperlink{command.notation}{\mbox{\isa{\isacommand{notation}}}}, but
 | 
| 
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
419  | 
works within an Isar proof body.  | 
| 
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
420  | 
|
| 35414 | 421  | 
  \end{description}
 | 
422  | 
||
| 
36508
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
423  | 
  Note that the more primitive commands \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} and
 | 
| 40406 | 424  | 
  \hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}syntax}}}} (\secref{sec:syn-trans}) provide raw access
 | 
| 
36508
 
03d2a2d0ee4a
allow concrete syntax for local entities within a proof body, either via regular mixfix annotations to 'fix' etc. or the separate 'write' command;
 
wenzelm 
parents: 
35414 
diff
changeset
 | 
425  | 
to the syntax tables of a global theory.%  | 
| 28762 | 426  | 
\end{isamarkuptext}%
 | 
427  | 
\isamarkuptrue%  | 
|
428  | 
%  | 
|
429  | 
\isamarkupsection{The Pure syntax \label{sec:pure-syntax}%
 | 
|
430  | 
}  | 
|
431  | 
\isamarkuptrue%  | 
|
432  | 
%  | 
|
433  | 
\isamarkupsubsection{Priority grammars \label{sec:priority-grammar}%
 | 
|
434  | 
}  | 
|
435  | 
\isamarkuptrue%  | 
|
436  | 
%  | 
|
437  | 
\begin{isamarkuptext}%
 | 
|
438  | 
A context-free grammar consists of a set of \emph{terminal
 | 
|
439  | 
  symbols}, a set of \emph{nonterminal symbols} and a set of
 | 
|
| 40406 | 440  | 
  \emph{productions}.  Productions have the form \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C67616D6D613E}{\isasymgamma}}{\isaliteral{22}{\isachardoublequote}}},
 | 
441  | 
  where \isa{A} is a nonterminal and \isa{{\isaliteral{5C3C67616D6D613E}{\isasymgamma}}} is a string of
 | 
|
| 28762 | 442  | 
terminals and nonterminals. One designated nonterminal is called  | 
443  | 
  the \emph{root symbol}.  The language defined by the grammar
 | 
|
444  | 
consists of all strings of terminals that can be derived from the  | 
|
445  | 
root symbol by applying productions as rewrite rules.  | 
|
446  | 
||
447  | 
  The standard Isabelle parser for inner syntax uses a \emph{priority
 | 
|
448  | 
grammar}. Each nonterminal is decorated by an integer priority:  | 
|
| 40406 | 449  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup p\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.  In a derivation, \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup p\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} may be rewritten
 | 
450  | 
  using a production \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup q\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C67616D6D613E}{\isasymgamma}}{\isaliteral{22}{\isachardoublequote}}} only if \isa{{\isaliteral{22}{\isachardoublequote}}p\ {\isaliteral{5C3C6C653E}{\isasymle}}\ q{\isaliteral{22}{\isachardoublequote}}}.  Any
 | 
|
| 28762 | 451  | 
priority grammar can be translated into a normal context-free  | 
452  | 
grammar by introducing new nonterminals and productions.  | 
|
453  | 
||
454  | 
  \medskip Formally, a set of context free productions \isa{G}
 | 
|
| 40406 | 455  | 
  induces a derivation relation \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub G{\isaliteral{22}{\isachardoublequote}}} as follows.  Let \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}} and \isa{{\isaliteral{5C3C626574613E}{\isasymbeta}}} denote strings of terminal or nonterminal symbols.
 | 
456  | 
  Then \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup p\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\isaliteral{5C3C5E7375623E}{}\isactrlsub G\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C67616D6D613E}{\isasymgamma}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{22}{\isachardoublequote}}} holds if and only if \isa{G}
 | 
|
457  | 
  contains some production \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup q\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C67616D6D613E}{\isasymgamma}}{\isaliteral{22}{\isachardoublequote}}} for \isa{{\isaliteral{22}{\isachardoublequote}}p\ {\isaliteral{5C3C6C653E}{\isasymle}}\ q{\isaliteral{22}{\isachardoublequote}}}.
 | 
|
| 28762 | 458  | 
|
459  | 
\medskip The following grammar for arithmetic expressions  | 
|
460  | 
demonstrates how binding power and associativity of operators can be  | 
|
461  | 
enforced by priorities.  | 
|
462  | 
||
463  | 
  \begin{center}
 | 
|
464  | 
  \begin{tabular}{rclr}
 | 
|
| 40406 | 465  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \verb|(| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|)| \\
 | 
466  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \verb|0| \\
 | 
|
467  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|+| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
468  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|*| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
469  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \verb|-| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 470  | 
  \end{tabular}
 | 
471  | 
  \end{center}
 | 
|
472  | 
The choice of priorities determines that \verb|-| binds  | 
|
473  | 
tighter than \verb|*|, which binds tighter than \verb|+|. Furthermore \verb|+| associates to the left and  | 
|
474  | 
\verb|*| to the right.  | 
|
475  | 
||
476  | 
\medskip For clarity, grammars obey these conventions:  | 
|
477  | 
  \begin{itemize}
 | 
|
478  | 
||
479  | 
\item All priorities must lie between 0 and 1000.  | 
|
480  | 
||
481  | 
\item Priority 0 on the right-hand side and priority 1000 on the  | 
|
482  | 
left-hand side may be omitted.  | 
|
483  | 
||
| 40406 | 484  | 
  \item The production \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup p\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{22}{\isachardoublequote}}} is written as \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{28}{\isacharparenleft}}p{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, i.e.\ the priority of the left-hand side actually appears in
 | 
| 28762 | 485  | 
a column on the far right.  | 
486  | 
||
| 40406 | 487  | 
  \item Alternatives are separated by \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 28762 | 488  | 
|
| 40406 | 489  | 
  \item Repetition is indicated by dots \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} in an informal
 | 
| 28762 | 490  | 
but obvious way.  | 
491  | 
||
492  | 
  \end{itemize}
 | 
|
493  | 
||
494  | 
Using these conventions, the example grammar specification above  | 
|
495  | 
takes the form:  | 
|
496  | 
  \begin{center}
 | 
|
497  | 
  \begin{tabular}{rclc}
 | 
|
| 40406 | 498  | 
    \isa{A} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \verb|(| \isa{A} \verb|)| \\
 | 
499  | 
              & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|0| & \qquad\qquad \\
 | 
|
500  | 
              & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{A} \verb|+| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
501  | 
              & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|*| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
502  | 
              & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|-| \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 503  | 
  \end{tabular}
 | 
504  | 
  \end{center}%
 | 
|
505  | 
\end{isamarkuptext}%
 | 
|
506  | 
\isamarkuptrue%  | 
|
507  | 
%  | 
|
508  | 
\isamarkupsubsection{The Pure grammar%
 | 
|
509  | 
}  | 
|
510  | 
\isamarkuptrue%  | 
|
511  | 
%  | 
|
512  | 
\begin{isamarkuptext}%
 | 
|
| 40406 | 513  | 
The priority grammar of the \isa{{\isaliteral{22}{\isachardoublequote}}Pure{\isaliteral{22}{\isachardoublequote}}} theory is defined as follows:
 | 
| 28762 | 514  | 
|
515  | 
%FIXME syntax for "index" (?)  | 
|
516  | 
%FIXME "op" versions of ==> etc. (?)  | 
|
517  | 
||
518  | 
  \begin{center}
 | 
|
519  | 
  \begin{supertabular}{rclr}
 | 
|
520  | 
||
| 40406 | 521  | 
  \indexdef{inner}{syntax}{any}\hypertarget{syntax.inner.any}{\hyperlink{syntax.inner.any}{\mbox{\isa{any}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}prop\ \ {\isaliteral{7C}{\isacharbar}}\ \ logic{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
| 28762 | 522  | 
|
523  | 
  \indexdef{inner}{syntax}{prop}\hypertarget{syntax.inner.prop}{\hyperlink{syntax.inner.prop}{\mbox{\isa{prop}}}} & = & \verb|(| \isa{prop} \verb|)| \\
 | 
|
| 40406 | 524  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{4}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|::| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
525  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|==| \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
526  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C65717569763E}{\isasymequiv}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
527  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|&&&| \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
528  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|==>| \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
529  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{2}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
530  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|[|\verb,|,\verb|| \isa{prop} \verb|;| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|;| \isa{prop} \verb||\verb,|,\verb|]| \verb|==>| \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
531  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C6272616B6B3E}{\isasymlbrakk}}{\isaliteral{22}{\isachardoublequote}}} \isa{prop} \verb|;| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|;| \isa{prop} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C726272616B6B3E}{\isasymrbrakk}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}prop\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
532  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|!!| \isa{idts} \verb|.| \isa{prop} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
533  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}} \isa{idts} \verb|.| \isa{prop} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
534  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|OFCLASS| \verb|(| \isa{type} \verb|,| \isa{logic} \verb|)| \\
 | 
|
535  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|SORT_CONSTRAINT| \verb|(| \isa{type} \verb|)| \\
 | 
|
536  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|TERM| \isa{logic} \\
 | 
|
537  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|PROP| \isa{aprop} \\\\
 | 
|
| 28762 | 538  | 
|
| 28857 | 539  | 
  \indexdef{inner}{syntax}{aprop}\hypertarget{syntax.inner.aprop}{\hyperlink{syntax.inner.aprop}{\mbox{\isa{aprop}}}} & = & \verb|(| \isa{aprop} \verb|)| \\
 | 
| 40406 | 540  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ longid\ \ {\isaliteral{7C}{\isacharbar}}\ \ var\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|...| \\
 | 
541  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|CONST| \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|CONST| \isa{{\isaliteral{22}{\isachardoublequote}}longid{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
542  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}logic\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ \ any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{9}}{\isadigit{9}}{\isadigit{9}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
|
| 28762 | 543  | 
|
544  | 
  \indexdef{inner}{syntax}{logic}\hypertarget{syntax.inner.logic}{\hyperlink{syntax.inner.logic}{\mbox{\isa{logic}}}} & = & \verb|(| \isa{logic} \verb|)| \\
 | 
|
| 40406 | 545  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}logic\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{4}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|::| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
546  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ longid\ \ {\isaliteral{7C}{\isacharbar}}\ \ var\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|...| \\
 | 
|
547  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|CONST| \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|CONST| \isa{{\isaliteral{22}{\isachardoublequote}}longid{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
548  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}logic\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ \ any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{9}}{\isadigit{9}}{\isadigit{9}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
549  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|%| \isa{pttrns} \verb|.| \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
550  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}} \isa{pttrns} \verb|.| \isa{{\isaliteral{22}{\isachardoublequote}}any\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{3}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
551  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|TYPE| \verb|(| \isa{type} \verb|)| \\\\
 | 
|
| 28762 | 552  | 
|
| 40406 | 553  | 
  \indexdef{inner}{syntax}{idt}\hypertarget{syntax.inner.idt}{\hyperlink{syntax.inner.idt}{\mbox{\isa{idt}}}} & = & \verb|(| \isa{idt} \verb|)|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ id\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_| \\
 | 
554  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{id} \verb|::| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
555  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|_| \verb|::| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
|
| 28762 | 556  | 
|
| 40406 | 557  | 
  \indexdef{inner}{syntax}{idts}\hypertarget{syntax.inner.idts}{\hyperlink{syntax.inner.idts}{\mbox{\isa{idts}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}idt\ \ {\isaliteral{7C}{\isacharbar}}\ \ idt\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ idts{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
| 28762 | 558  | 
|
559  | 
  \indexdef{inner}{syntax}{pttrn}\hypertarget{syntax.inner.pttrn}{\hyperlink{syntax.inner.pttrn}{\mbox{\isa{pttrn}}}} & = & \isa{idt} \\\\
 | 
|
560  | 
||
| 40406 | 561  | 
  \indexdef{inner}{syntax}{pttrns}\hypertarget{syntax.inner.pttrns}{\hyperlink{syntax.inner.pttrns}{\mbox{\isa{pttrns}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}pttrn\ \ {\isaliteral{7C}{\isacharbar}}\ \ pttrn\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ pttrns{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
| 28762 | 562  | 
|
563  | 
  \indexdef{inner}{syntax}{type}\hypertarget{syntax.inner.type}{\hyperlink{syntax.inner.type}{\mbox{\isa{type}}}} & = & \verb|(| \isa{type} \verb|)| \\
 | 
|
| 40406 | 564  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}tid\ \ {\isaliteral{7C}{\isacharbar}}\ \ tvar\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_| \\
 | 
565  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}tid{\isaliteral{22}{\isachardoublequote}}} \verb|::| \isa{{\isaliteral{22}{\isachardoublequote}}sort\ \ {\isaliteral{7C}{\isacharbar}}\ \ tvar\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|::| \isa{{\isaliteral{22}{\isachardoublequote}}sort\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_| \verb|::| \isa{{\isaliteral{22}{\isachardoublequote}}sort{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
566  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ type\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ id\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|(| \isa{type} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{type} \verb|)| \isa{id} \\
 | 
|
567  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}longid\ \ {\isaliteral{7C}{\isacharbar}}\ \ type\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{0}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}\ longid{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
568  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|(| \isa{type} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{type} \verb|)| \isa{longid} \\
 | 
|
569  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}type\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|=>| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
570  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}type\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isadigit{1}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}{\isaliteral{22}{\isachardoublequote}}} \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
571  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|[| \isa{type} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{type} \verb|]| \verb|=>| \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
572  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|[| \isa{type} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{type} \verb|]| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}{\isaliteral{22}{\isachardoublequote}}} \isa{type} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{0}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\\\
 | 
|
| 28762 | 573  | 
|
| 40406 | 574  | 
  \indexdef{inner}{syntax}{sort}\hypertarget{syntax.inner.sort}{\hyperlink{syntax.inner.sort}{\mbox{\isa{sort}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}id\ \ {\isaliteral{7C}{\isacharbar}}\ \ longid\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|{}| \\
 | 
575  | 
    & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} & \verb|{| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}id\ {\isaliteral{7C}{\isacharbar}}\ longid{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|,| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}id\ {\isaliteral{7C}{\isacharbar}}\ longid{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \verb|}| \\
 | 
|
| 28762 | 576  | 
  \end{supertabular}
 | 
577  | 
  \end{center}
 | 
|
578  | 
||
579  | 
\medskip Here literal terminals are printed \verb|verbatim|;  | 
|
580  | 
  see also \secref{sec:inner-lex} for further token categories of the
 | 
|
581  | 
inner syntax. The meaning of the nonterminals defined by the above  | 
|
582  | 
grammar is as follows:  | 
|
583  | 
||
584  | 
  \begin{description}
 | 
|
585  | 
||
586  | 
  \item \indexref{inner}{syntax}{any}\hyperlink{syntax.inner.any}{\mbox{\isa{any}}} denotes any term.
 | 
|
587  | 
||
588  | 
  \item \indexref{inner}{syntax}{prop}\hyperlink{syntax.inner.prop}{\mbox{\isa{prop}}} denotes meta-level propositions,
 | 
|
589  | 
  which are terms of type \isa{prop}.  The syntax of such formulae of
 | 
|
590  | 
the meta-logic is carefully distinguished from usual conventions for  | 
|
| 40406 | 591  | 
  object-logics.  In particular, plain \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}{\isaliteral{22}{\isachardoublequote}}}-term notation is
 | 
| 28762 | 592  | 
  \emph{not} recognized as \hyperlink{syntax.inner.prop}{\mbox{\isa{prop}}}.
 | 
593  | 
||
594  | 
  \item \indexref{inner}{syntax}{aprop}\hyperlink{syntax.inner.aprop}{\mbox{\isa{aprop}}} denotes atomic propositions, which
 | 
|
595  | 
  are embedded into regular \hyperlink{syntax.inner.prop}{\mbox{\isa{prop}}} by means of an
 | 
|
596  | 
explicit \verb|PROP| token.  | 
|
597  | 
||
598  | 
  Terms of type \isa{prop} with non-constant head, e.g.\ a plain
 | 
|
599  | 
  variable, are printed in this form.  Constants that yield type \isa{prop} are expected to provide their own concrete syntax; otherwise
 | 
|
600  | 
  the printed version will appear like \hyperlink{syntax.inner.logic}{\mbox{\isa{logic}}} and
 | 
|
601  | 
  cannot be parsed again as \hyperlink{syntax.inner.prop}{\mbox{\isa{prop}}}.
 | 
|
602  | 
||
603  | 
  \item \indexref{inner}{syntax}{logic}\hyperlink{syntax.inner.logic}{\mbox{\isa{logic}}} denotes arbitrary terms of a
 | 
|
604  | 
  logical type, excluding type \isa{prop}.  This is the main
 | 
|
| 40406 | 605  | 
  syntactic category of object-logic entities, covering plain \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-term notation (variables, abstraction, application), plus
 | 
| 28762 | 606  | 
anything defined by the user.  | 
607  | 
||
608  | 
When specifying notation for logical entities, all logical types  | 
|
609  | 
  (excluding \isa{prop}) are \emph{collapsed} to this single category
 | 
|
610  | 
  of \hyperlink{syntax.inner.logic}{\mbox{\isa{logic}}}.
 | 
|
611  | 
||
612  | 
  \item \indexref{inner}{syntax}{idt}\hyperlink{syntax.inner.idt}{\mbox{\isa{idt}}} denotes identifiers, possibly
 | 
|
613  | 
constrained by types.  | 
|
614  | 
||
615  | 
  \item \indexref{inner}{syntax}{idts}\hyperlink{syntax.inner.idts}{\mbox{\isa{idts}}} denotes a sequence of \indexref{inner}{syntax}{idt}\hyperlink{syntax.inner.idt}{\mbox{\isa{idt}}}.  This is the most basic category for variables in
 | 
|
| 40406 | 616  | 
  iterated binders, such as \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}{\isaliteral{22}{\isachardoublequote}}} or \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 28762 | 617  | 
|
618  | 
  \item \indexref{inner}{syntax}{pttrn}\hyperlink{syntax.inner.pttrn}{\mbox{\isa{pttrn}}} and \indexref{inner}{syntax}{pttrns}\hyperlink{syntax.inner.pttrns}{\mbox{\isa{pttrns}}}
 | 
|
619  | 
denote patterns for abstraction, cases bindings etc. In Pure, these  | 
|
620  | 
  categories start as a merely copy of \hyperlink{syntax.inner.idt}{\mbox{\isa{idt}}} and
 | 
|
621  | 
  \hyperlink{syntax.inner.idts}{\mbox{\isa{idts}}}, respectively.  Object-logics may add
 | 
|
622  | 
additional productions for binding forms.  | 
|
623  | 
||
624  | 
  \item \indexref{inner}{syntax}{type}\hyperlink{syntax.inner.type}{\mbox{\isa{type}}} denotes types of the meta-logic.
 | 
|
625  | 
||
626  | 
  \item \indexref{inner}{syntax}{sort}\hyperlink{syntax.inner.sort}{\mbox{\isa{sort}}} denotes meta-level sorts.
 | 
|
627  | 
||
628  | 
  \end{description}
 | 
|
629  | 
||
630  | 
Here are some further explanations of certain syntax features.  | 
|
631  | 
||
632  | 
  \begin{itemize}
 | 
|
633  | 
||
| 40406 | 634  | 
  \item In \hyperlink{syntax.inner.idts}{\mbox{\isa{idts}}}, note that \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat\ y{\isaliteral{22}{\isachardoublequote}}} is
 | 
635  | 
  parsed as \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}nat\ y{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, treating \isa{y} like a type
 | 
|
| 28762 | 636  | 
  constructor applied to \isa{nat}.  To avoid this interpretation,
 | 
| 40406 | 637  | 
  write \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}\ y{\isaliteral{22}{\isachardoublequote}}} with explicit parentheses.
 | 
| 28762 | 638  | 
|
| 40406 | 639  | 
  \item Similarly, \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{22}{\isachardoublequote}}} is parsed as \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}nat\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.  The correct form is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, or \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{22}{\isachardoublequote}}} if \isa{y} is last in the
 | 
| 28762 | 640  | 
sequence of identifiers.  | 
641  | 
||
642  | 
\item Type constraints for terms bind very weakly. For example,  | 
|
| 40406 | 643  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3C}{\isacharless}}\ y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{22}{\isachardoublequote}}} is normally parsed as \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}x\ {\isaliteral{3C}{\isacharless}}\ y{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{22}{\isachardoublequote}}}, unless \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3C}{\isacharless}}{\isaliteral{22}{\isachardoublequote}}} has a very low priority, in which case the
 | 
644  | 
  input is likely to be ambiguous.  The correct form is \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3C}{\isacharless}}\ {\isaliteral{28}{\isacharparenleft}}y\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.
 | 
|
| 28762 | 645  | 
|
646  | 
\item Constraints may be either written with two literal colons  | 
|
647  | 
``\verb|::|'' or the double-colon symbol \verb|\<Colon>|,  | 
|
648  | 
  which actually looks exactly the same in some {\LaTeX} styles.
 | 
|
649  | 
||
650  | 
\item Dummy variables (written as underscore) may occur in different  | 
|
651  | 
roles.  | 
|
652  | 
||
653  | 
  \begin{description}
 | 
|
654  | 
||
| 40406 | 655  | 
  \item A type ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}'' or ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ sort{\isaliteral{22}{\isachardoublequote}}}'' acts like an
 | 
| 28762 | 656  | 
anonymous inference parameter, which is filled-in according to the  | 
657  | 
most general type produced by the type-checking phase.  | 
|
658  | 
||
| 40406 | 659  | 
  \item A bound ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}'' refers to a vacuous abstraction, where
 | 
| 28762 | 660  | 
the body does not refer to the binding introduced here. As in the  | 
| 40406 | 661  | 
  term \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{2E}{\isachardot}}\ x{\isaliteral{22}{\isachardoublequote}}}, which is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{22}{\isachardoublequote}}}-equivalent to \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\ y{\isaliteral{2E}{\isachardot}}\ x{\isaliteral{22}{\isachardoublequote}}}.
 | 
| 28762 | 662  | 
|
| 40406 | 663  | 
  \item A free ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}'' refers to an implicit outer binding.
 | 
664  | 
  Higher definitional packages usually allow forms like \isa{{\isaliteral{22}{\isachardoublequote}}f\ x\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3D}{\isacharequal}}\ x{\isaliteral{22}{\isachardoublequote}}}.
 | 
|
| 28762 | 665  | 
|
| 40406 | 666  | 
  \item A schematic ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}'' (within a term pattern, see
 | 
| 28762 | 667  | 
  \secref{sec:term-decls}) refers to an anonymous variable that is
 | 
668  | 
implicitly abstracted over its context of locally bound variables.  | 
|
| 40406 | 669  | 
  For example, this allows pattern matching of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7B}{\isacharbraceleft}}x{\isaliteral{2E}{\isachardot}}\ f\ x\ {\isaliteral{3D}{\isacharequal}}\ g\ x{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequote}}} against \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7B}{\isacharbraceleft}}x{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequote}}}, or even \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7B}{\isacharbraceleft}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5F}{\isacharunderscore}}{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequote}}} by
 | 
| 28762 | 670  | 
using both bound and schematic dummies.  | 
671  | 
||
672  | 
  \end{description}
 | 
|
673  | 
||
674  | 
\item The three literal dots ``\verb|...|'' may be also  | 
|
675  | 
written as ellipsis symbol \verb|\<dots>|. In both cases this  | 
|
676  | 
refers to a special schematic variable, which is bound in the  | 
|
677  | 
context. This special term abbreviation works nicely with  | 
|
678  | 
  calculational reasoning (\secref{sec:calculation}).
 | 
|
679  | 
||
680  | 
  \end{itemize}%
 | 
|
681  | 
\end{isamarkuptext}%
 | 
|
682  | 
\isamarkuptrue%  | 
|
683  | 
%  | 
|
684  | 
\isamarkupsection{Lexical matters \label{sec:inner-lex}%
 | 
|
685  | 
}  | 
|
686  | 
\isamarkuptrue%  | 
|
687  | 
%  | 
|
688  | 
\begin{isamarkuptext}%
 | 
|
689  | 
The inner lexical syntax vaguely resembles the outer one  | 
|
690  | 
  (\secref{sec:outer-lex}), but some details are different.  There are
 | 
|
691  | 
two main categories of inner syntax tokens:  | 
|
692  | 
||
693  | 
  \begin{enumerate}
 | 
|
694  | 
||
695  | 
  \item \emph{delimiters} --- the literal tokens occurring in
 | 
|
696  | 
productions of the given priority grammar (cf.\  | 
|
697  | 
  \secref{sec:priority-grammar});
 | 
|
698  | 
||
699  | 
  \item \emph{named tokens} --- various categories of identifiers etc.
 | 
|
700  | 
||
701  | 
  \end{enumerate}
 | 
|
702  | 
||
703  | 
Delimiters override named tokens and may thus render certain  | 
|
704  | 
identifiers inaccessible. Sometimes the logical context admits  | 
|
705  | 
alternative ways to refer to the same entity, potentially via  | 
|
706  | 
qualified names.  | 
|
707  | 
||
708  | 
\medskip The categories for named tokens are defined once and for  | 
|
709  | 
all as follows, reusing some categories of the outer token syntax  | 
|
710  | 
  (\secref{sec:outer-lex}).
 | 
|
711  | 
||
712  | 
  \begin{center}
 | 
|
713  | 
  \begin{supertabular}{rcl}
 | 
|
714  | 
    \indexdef{inner}{syntax}{id}\hypertarget{syntax.inner.id}{\hyperlink{syntax.inner.id}{\mbox{\isa{id}}}} & = & \indexref{}{syntax}{ident}\hyperlink{syntax.ident}{\mbox{\isa{ident}}} \\
 | 
|
715  | 
    \indexdef{inner}{syntax}{longid}\hypertarget{syntax.inner.longid}{\hyperlink{syntax.inner.longid}{\mbox{\isa{longid}}}} & = & \indexref{}{syntax}{longident}\hyperlink{syntax.longident}{\mbox{\isa{longident}}} \\
 | 
|
716  | 
    \indexdef{inner}{syntax}{var}\hypertarget{syntax.inner.var}{\hyperlink{syntax.inner.var}{\mbox{\isa{var}}}} & = & \indexref{}{syntax}{var}\hyperlink{syntax.var}{\mbox{\isa{var}}} \\
 | 
|
717  | 
    \indexdef{inner}{syntax}{tid}\hypertarget{syntax.inner.tid}{\hyperlink{syntax.inner.tid}{\mbox{\isa{tid}}}} & = & \indexref{}{syntax}{typefree}\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}} \\
 | 
|
718  | 
    \indexdef{inner}{syntax}{tvar}\hypertarget{syntax.inner.tvar}{\hyperlink{syntax.inner.tvar}{\mbox{\isa{tvar}}}} & = & \indexref{}{syntax}{typevar}\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}} \\
 | 
|
| 40406 | 719  | 
    \indexdef{inner}{syntax}{num}\hypertarget{syntax.inner.num}{\hyperlink{syntax.inner.num}{\mbox{\isa{num}}}} & = & \indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}}\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|-|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}} \\
 | 
720  | 
    \indexdef{inner}{syntax}{float\_token}\hypertarget{syntax.inner.float-token}{\hyperlink{syntax.inner.float-token}{\mbox{\isa{float{\isaliteral{5F}{\isacharunderscore}}token}}}} & = & \indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}}\verb|.|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}}\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|-|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}}\verb|.|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}} \\
 | 
|
721  | 
    \indexdef{inner}{syntax}{xnum}\hypertarget{syntax.inner.xnum}{\hyperlink{syntax.inner.xnum}{\mbox{\isa{xnum}}}} & = & \verb|#|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}}\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|#-|\indexref{}{syntax}{nat}\hyperlink{syntax.nat}{\mbox{\isa{nat}}} \\
 | 
|
| 28762 | 722  | 
|
| 40406 | 723  | 
    \indexdef{inner}{syntax}{xstr}\hypertarget{syntax.inner.xstr}{\hyperlink{syntax.inner.xstr}{\mbox{\isa{xstr}}}} & = & \verb|''| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|''| \\
 | 
| 28762 | 724  | 
  \end{supertabular}
 | 
725  | 
  \end{center}
 | 
|
726  | 
||
| 40406 | 727  | 
  The token categories \hyperlink{syntax.inner.num}{\mbox{\isa{num}}}, \hyperlink{syntax.inner.float-token}{\mbox{\isa{float{\isaliteral{5F}{\isacharunderscore}}token}}}, \hyperlink{syntax.inner.xnum}{\mbox{\isa{xnum}}}, and \hyperlink{syntax.inner.xstr}{\mbox{\isa{xstr}}} are
 | 
| 29158 | 728  | 
not used in Pure. Object-logics may implement numerals and string  | 
729  | 
constants by adding appropriate syntax declarations, together with  | 
|
730  | 
some translation functions (e.g.\ see Isabelle/HOL).  | 
|
731  | 
||
| 40406 | 732  | 
  The derived categories \indexdef{inner}{syntax}{num\_const}\hypertarget{syntax.inner.num-const}{\hyperlink{syntax.inner.num-const}{\mbox{\isa{num{\isaliteral{5F}{\isacharunderscore}}const}}}} and
 | 
733  | 
  \indexdef{inner}{syntax}{float\_const}\hypertarget{syntax.inner.float-const}{\hyperlink{syntax.inner.float-const}{\mbox{\isa{float{\isaliteral{5F}{\isacharunderscore}}const}}}} provide robust access to \hyperlink{syntax.inner.num}{\mbox{\isa{num}}}, and \hyperlink{syntax.inner.float-token}{\mbox{\isa{float{\isaliteral{5F}{\isacharunderscore}}token}}}, respectively: the
 | 
|
| 29158 | 734  | 
syntax tree holds a syntactic constant instead of a free variable.%  | 
| 28762 | 735  | 
\end{isamarkuptext}%
 | 
736  | 
\isamarkuptrue%  | 
|
737  | 
%  | 
|
738  | 
\isamarkupsection{Syntax and translations \label{sec:syn-trans}%
 | 
|
739  | 
}  | 
|
740  | 
\isamarkuptrue%  | 
|
741  | 
%  | 
|
742  | 
\begin{isamarkuptext}%
 | 
|
743  | 
\begin{matharray}{rcl}
 | 
|
| 
41229
 
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
 
wenzelm 
parents: 
40879 
diff
changeset
 | 
744  | 
    \indexdef{}{command}{nonterminal}\hypertarget{command.nonterminal}{\hyperlink{command.nonterminal}{\mbox{\isa{\isacommand{nonterminal}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 40406 | 745  | 
    \indexdef{}{command}{syntax}\hypertarget{command.syntax}{\hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
746  | 
    \indexdef{}{command}{no\_syntax}\hypertarget{command.no-syntax}{\hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}syntax}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
747  | 
    \indexdef{}{command}{translations}\hypertarget{command.translations}{\hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
748  | 
    \indexdef{}{command}{no\_translations}\hypertarget{command.no-translations}{\hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}translations}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 749  | 
  \end{matharray}
 | 
750  | 
||
751  | 
  \begin{rail}
 | 
|
| 
41229
 
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
 
wenzelm 
parents: 
40879 
diff
changeset
 | 
752  | 
'nonterminal' (name + 'and')  | 
| 28762 | 753  | 
;  | 
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
754  | 
    ('syntax' | 'no_syntax') mode? (constdecl +)
 | 
| 28762 | 755  | 
;  | 
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
756  | 
    ('translations' | 'no_translations') (transpat ('==' | '=>' | '<=' | rightleftharpoons | rightharpoonup | leftharpoondown) transpat +)
 | 
| 28762 | 757  | 
;  | 
758  | 
||
759  | 
    mode: ('(' ( name | 'output' | name 'output' ) ')')
 | 
|
760  | 
;  | 
|
761  | 
    transpat: ('(' nameref ')')? string
 | 
|
762  | 
;  | 
|
763  | 
  \end{rail}
 | 
|
764  | 
||
765  | 
  \begin{description}
 | 
|
766  | 
||
| 
41229
 
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
 
wenzelm 
parents: 
40879 
diff
changeset
 | 
767  | 
  \item \hyperlink{command.nonterminal}{\mbox{\isa{\isacommand{nonterminal}}}}~\isa{c} declares a type
 | 
| 28762 | 768  | 
  constructor \isa{c} (without arguments) to act as purely syntactic
 | 
769  | 
type: a nonterminal symbol of the inner syntax.  | 
|
770  | 
||
| 40406 | 771  | 
  \item \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}mode{\isaliteral{29}{\isacharparenright}}\ decls{\isaliteral{22}{\isachardoublequote}}} is similar to
 | 
| 28762 | 772  | 
  \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{decls}, except that the actual logical
 | 
773  | 
signature extension is omitted. Thus the context free grammar of  | 
|
774  | 
Isabelle's inner syntax may be augmented in arbitrary ways,  | 
|
775  | 
  independently of the logic.  The \isa{mode} argument refers to the
 | 
|
776  | 
  print mode that the grammar rules belong; unless the \indexref{}{keyword}{output}\hyperlink{keyword.output}{\mbox{\isa{\isakeyword{output}}}} indicator is given, all productions are added both to the
 | 
|
777  | 
input and output grammar.  | 
|
778  | 
||
| 40406 | 779  | 
  \item \hyperlink{command.no-syntax}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}syntax}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}mode{\isaliteral{29}{\isacharparenright}}\ decls{\isaliteral{22}{\isachardoublequote}}} removes grammar
 | 
| 28762 | 780  | 
  declarations (and translations) resulting from \isa{decls}, which
 | 
781  | 
  are interpreted in the same manner as for \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} above.
 | 
|
782  | 
||
783  | 
  \item \hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}}~\isa{rules} specifies syntactic
 | 
|
| 40406 | 784  | 
  translation rules (i.e.\ macros): parse~/ print rules (\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C72696768746C656674686172706F6F6E733E}{\isasymrightleftharpoons}}{\isaliteral{22}{\isachardoublequote}}}),
 | 
785  | 
  parse rules (\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7269676874686172706F6F6E75703E}{\isasymrightharpoonup}}{\isaliteral{22}{\isachardoublequote}}}), or print rules (\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C656674686172706F6F6E646F776E3E}{\isasymleftharpoondown}}{\isaliteral{22}{\isachardoublequote}}}).
 | 
|
| 28762 | 786  | 
Translation patterns may be prefixed by the syntactic category to be  | 
787  | 
  used for parsing; the default is \isa{logic}.
 | 
|
788  | 
||
| 40406 | 789  | 
  \item \hyperlink{command.no-translations}{\mbox{\isa{\isacommand{no{\isaliteral{5F}{\isacharunderscore}}translations}}}}~\isa{rules} removes syntactic
 | 
| 28762 | 790  | 
translation rules, which are interpreted in the same manner as for  | 
791  | 
  \hyperlink{command.translations}{\mbox{\isa{\isacommand{translations}}}} above.
 | 
|
792  | 
||
793  | 
  \end{description}%
 | 
|
794  | 
\end{isamarkuptext}%
 | 
|
795  | 
\isamarkuptrue%  | 
|
796  | 
%  | 
|
797  | 
\isamarkupsection{Syntax translation functions \label{sec:tr-funs}%
 | 
|
798  | 
}  | 
|
799  | 
\isamarkuptrue%  | 
|
800  | 
%  | 
|
801  | 
\begin{isamarkuptext}%
 | 
|
802  | 
\begin{matharray}{rcl}
 | 
|
| 40406 | 803  | 
    \indexdef{}{command}{parse\_ast\_translation}\hypertarget{command.parse-ast-translation}{\hyperlink{command.parse-ast-translation}{\mbox{\isa{\isacommand{parse{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
804  | 
    \indexdef{}{command}{parse\_translation}\hypertarget{command.parse-translation}{\hyperlink{command.parse-translation}{\mbox{\isa{\isacommand{parse{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
805  | 
    \indexdef{}{command}{print\_translation}\hypertarget{command.print-translation}{\hyperlink{command.print-translation}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
806  | 
    \indexdef{}{command}{typed\_print\_translation}\hypertarget{command.typed-print-translation}{\hyperlink{command.typed-print-translation}{\mbox{\isa{\isacommand{typed{\isaliteral{5F}{\isacharunderscore}}print{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
807  | 
    \indexdef{}{command}{print\_ast\_translation}\hypertarget{command.print-ast-translation}{\hyperlink{command.print-ast-translation}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
 | 
|
| 28762 | 808  | 
  \end{matharray}
 | 
809  | 
||
810  | 
  \begin{rail}
 | 
|
| 
40255
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
811  | 
( 'parse_ast_translation' | 'parse_translation' | 'print_translation' |  | 
| 
 
9ffbc25e1606
eliminated obsolete \_ escapes in rail environments;
 
wenzelm 
parents: 
39279 
diff
changeset
 | 
812  | 
    'typed_print_translation' | 'print_ast_translation' ) ('(advanced)')? text
 | 
| 28762 | 813  | 
;  | 
814  | 
  \end{rail}
 | 
|
815  | 
||
816  | 
Syntax translation functions written in ML admit almost arbitrary  | 
|
817  | 
manipulations of Isabelle's inner syntax. Any of the above commands  | 
|
818  | 
  have a single \railqtok{text} argument that refers to an ML
 | 
|
819  | 
expression of appropriate type, which are as follows by default:  | 
|
820  | 
||
821  | 
%FIXME proper antiquotations  | 
|
822  | 
\begin{ttbox}
 | 
|
823  | 
val parse_ast_translation : (string * (ast list -> ast)) list  | 
|
824  | 
val parse_translation : (string * (term list -> term)) list  | 
|
825  | 
val print_translation : (string * (term list -> term)) list  | 
|
| 
42247
 
12fe41a92cd5
typed_print_translation: discontinued show_sorts argument;
 
wenzelm 
parents: 
41229 
diff
changeset
 | 
826  | 
val typed_print_translation : (string * (typ -> term list -> term)) list  | 
| 28762 | 827  | 
val print_ast_translation : (string * (ast list -> ast)) list  | 
828  | 
\end{ttbox}
 | 
|
829  | 
||
| 40406 | 830  | 
  If the \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}advanced{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option is given, the corresponding
 | 
| 28762 | 831  | 
translation functions may depend on the current theory or proof  | 
832  | 
context. This allows to implement advanced syntax mechanisms, as  | 
|
833  | 
translations functions may refer to specific theory declarations or  | 
|
834  | 
auxiliary proof data.  | 
|
835  | 
||
| 30397 | 836  | 
  See also \cite{isabelle-ref} for more information on the general
 | 
837  | 
concept of syntax transformations in Isabelle.  | 
|
| 28762 | 838  | 
|
839  | 
%FIXME proper antiquotations  | 
|
840  | 
\begin{ttbox}
 | 
|
841  | 
val parse_ast_translation:  | 
|
842  | 
(string * (Proof.context -> ast list -> ast)) list  | 
|
843  | 
val parse_translation:  | 
|
844  | 
(string * (Proof.context -> term list -> term)) list  | 
|
845  | 
val print_translation:  | 
|
846  | 
(string * (Proof.context -> term list -> term)) list  | 
|
847  | 
val typed_print_translation:  | 
|
| 
42247
 
12fe41a92cd5
typed_print_translation: discontinued show_sorts argument;
 
wenzelm 
parents: 
41229 
diff
changeset
 | 
848  | 
(string * (Proof.context -> typ -> term list -> term)) list  | 
| 28762 | 849  | 
val print_ast_translation:  | 
850  | 
(string * (Proof.context -> ast list -> ast)) list  | 
|
851  | 
\end{ttbox}%
 | 
|
852  | 
\end{isamarkuptext}%
 | 
|
853  | 
\isamarkuptrue%  | 
|
854  | 
%  | 
|
855  | 
\isamarkupsection{Inspecting the syntax%
 | 
|
856  | 
}  | 
|
857  | 
\isamarkuptrue%  | 
|
858  | 
%  | 
|
859  | 
\begin{isamarkuptext}%
 | 
|
860  | 
\begin{matharray}{rcl}
 | 
|
| 40406 | 861  | 
    \indexdef{}{command}{print\_syntax}\hypertarget{command.print-syntax}{\hyperlink{command.print-syntax}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}syntax}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
 | 
| 28762 | 862  | 
  \end{matharray}
 | 
863  | 
||
864  | 
  \begin{description}
 | 
|
865  | 
||
| 40406 | 866  | 
  \item \hyperlink{command.print-syntax}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}syntax}}}} prints the inner syntax of the
 | 
| 28762 | 867  | 
current context. The output can be quite large; the most important  | 
868  | 
sections are explained below.  | 
|
869  | 
||
870  | 
  \begin{description}
 | 
|
871  | 
||
| 40406 | 872  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}lexicon{\isaliteral{22}{\isachardoublequote}}} lists the delimiters of the inner token
 | 
| 28762 | 873  | 
  language; see \secref{sec:inner-lex}.
 | 
874  | 
||
| 40406 | 875  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}prods{\isaliteral{22}{\isachardoublequote}}} lists the productions of the underlying
 | 
| 28762 | 876  | 
  priority grammar; see \secref{sec:priority-grammar}.
 | 
877  | 
||
| 40406 | 878  | 
  The nonterminal \isa{{\isaliteral{22}{\isachardoublequote}}A\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7375703E}{}\isactrlsup p\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} is rendered in plain text as \isa{{\isaliteral{22}{\isachardoublequote}}A{\isaliteral{5B}{\isacharbrackleft}}p{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}; delimiters are quoted.  Many productions have an extra
 | 
879  | 
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ name{\isaliteral{22}{\isachardoublequote}}}.  These names later become the heads of parse
 | 
|
| 28762 | 880  | 
trees; they also guide the pretty printer.  | 
881  | 
||
882  | 
  Productions without such parse tree names are called \emph{copy
 | 
|
883  | 
productions}. Their right-hand side must have exactly one  | 
|
884  | 
nonterminal symbol (or named token). The parser does not create a  | 
|
885  | 
new parse tree node for copy productions, but simply returns the  | 
|
886  | 
parse tree of the right-hand symbol.  | 
|
887  | 
||
888  | 
If the right-hand side of a copy production consists of a single  | 
|
889  | 
  nonterminal without any delimiters, then it is called a \emph{chain
 | 
|
890  | 
production}. Chain productions act as abbreviations: conceptually,  | 
|
891  | 
they are removed from the grammar by adding new productions.  | 
|
892  | 
Priority information attached to chain productions is ignored; only  | 
|
| 40406 | 893  | 
  the dummy value \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2D}{\isacharminus}}{\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} is displayed.
 | 
| 28762 | 894  | 
|
| 40406 | 895  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}print\ modes{\isaliteral{22}{\isachardoublequote}}} lists the alternative print modes
 | 
| 28762 | 896  | 
  provided by this grammar; see \secref{sec:print-modes}.
 | 
897  | 
||
| 40406 | 898  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}parse{\isaliteral{5F}{\isacharunderscore}}rules{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}print{\isaliteral{5F}{\isacharunderscore}}rules{\isaliteral{22}{\isachardoublequote}}} relate to
 | 
| 28762 | 899  | 
  syntax translations (macros); see \secref{sec:syn-trans}.
 | 
900  | 
||
| 40406 | 901  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}parse{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}print{\isaliteral{5F}{\isacharunderscore}}ast{\isaliteral{5F}{\isacharunderscore}}translation{\isaliteral{22}{\isachardoublequote}}} list sets of constants that invoke
 | 
| 28762 | 902  | 
translation functions for abstract syntax trees, which are only  | 
903  | 
  required in very special situations; see \secref{sec:tr-funs}.
 | 
|
904  | 
||
| 40406 | 905  | 
  \item \isa{{\isaliteral{22}{\isachardoublequote}}parse{\isaliteral{5F}{\isacharunderscore}}translation{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}print{\isaliteral{5F}{\isacharunderscore}}translation{\isaliteral{22}{\isachardoublequote}}}
 | 
| 28762 | 906  | 
list the sets of constants that invoke regular translation  | 
907  | 
  functions; see \secref{sec:tr-funs}.
 | 
|
908  | 
||
909  | 
  \end{description}
 | 
|
910  | 
||
911  | 
  \end{description}%
 | 
|
912  | 
\end{isamarkuptext}%
 | 
|
913  | 
\isamarkuptrue%  | 
|
914  | 
%  | 
|
915  | 
\isadelimtheory  | 
|
916  | 
%  | 
|
917  | 
\endisadelimtheory  | 
|
918  | 
%  | 
|
919  | 
\isatagtheory  | 
|
920  | 
\isacommand{end}\isamarkupfalse%
 | 
|
921  | 
%  | 
|
922  | 
\endisatagtheory  | 
|
923  | 
{\isafoldtheory}%
 | 
|
924  | 
%  | 
|
925  | 
\isadelimtheory  | 
|
926  | 
%  | 
|
927  | 
\endisadelimtheory  | 
|
928  | 
\isanewline  | 
|
929  | 
\end{isabellebody}%
 | 
|
930  | 
%%% Local Variables:  | 
|
931  | 
%%% mode: latex  | 
|
932  | 
%%% TeX-master: "root"  | 
|
933  | 
%%% End:  |