author | wenzelm |
Mon, 26 Mar 2012 15:38:09 +0200 | |
changeset 47114 | 7c9e31ffcd9e |
parent 46282 | 83864b045a72 |
child 47822 | 34b44d28fc4b |
permissions | -rw-r--r-- |
27037 | 1 |
% |
2 |
\begin{isabellebody}% |
|
40406 | 3 |
\def\isabellecontext{Outer{\isaliteral{5F}{\isacharunderscore}}Syntax}% |
27037 | 4 |
% |
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
40406 | 11 |
\ Outer{\isaliteral{5F}{\isacharunderscore}}Syntax\isanewline |
42651 | 12 |
\isakeyword{imports}\ Base\ Main\isanewline |
27037 | 13 |
\isakeyword{begin}% |
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
47114
7c9e31ffcd9e
updated theory header syntax and related details;
wenzelm
parents:
46282
diff
changeset
|
21 |
\isamarkupchapter{Outer syntax --- the theory language \label{ch:outer-syntax}% |
27037 | 22 |
} |
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}% |
|
26 |
The rather generic framework of Isabelle/Isar syntax emerges from |
|
27 |
three main syntactic categories: \emph{commands} of the top-level |
|
28 |
Isar engine (covering theory and proof elements), \emph{methods} for |
|
29 |
general goal refinements (analogous to traditional ``tactics''), and |
|
30 |
\emph{attributes} for operations on facts (within a certain |
|
31 |
context). Subsequently we give a reference of basic syntactic |
|
32 |
entities underlying Isabelle/Isar syntax in a bottom-up manner. |
|
33 |
Concrete theory and proof language elements will be introduced later |
|
34 |
on. |
|
35 |
||
36 |
\medskip In order to get started with writing well-formed |
|
37 |
Isabelle/Isar documents, the most important aspect to be noted is |
|
38 |
the difference of \emph{inner} versus \emph{outer} syntax. Inner |
|
39 |
syntax is that of Isabelle types and terms of the logic, while outer |
|
40 |
syntax is that of Isabelle/Isar theory sources (specifications and |
|
41 |
proofs). As a general rule, inner syntax entities may occur only as |
|
42 |
\emph{atomic entities} within outer syntax. For example, the string |
|
43 |
\verb|"x + y"| and identifier \verb|z| are legal term |
|
44 |
specifications within a theory, while \verb|x + y| without |
|
45 |
quotes is not. |
|
46 |
||
47 |
Printed theory documents usually omit quotes to gain readability |
|
48 |
(this is a matter of {\LaTeX} macro setup, say via \verb|\isabellestyle|, see also \cite{isabelle-sys}). Experienced |
|
49 |
users of Isabelle/Isar may easily reconstruct the lost technical |
|
50 |
information, while mere readers need not care about quotes at all. |
|
51 |
||
52 |
\medskip Isabelle/Isar input may contain any number of input |
|
53 |
termination characters ``\verb|;|'' (semicolon) to separate |
|
54 |
commands explicitly. This is particularly useful in interactive |
|
55 |
shell sessions to make clear where the current command is intended |
|
56 |
to end. Otherwise, the interpreter loop will continue to issue a |
|
57 |
secondary prompt ``\verb|#|'' until an end-of-command is |
|
58 |
clearly recognized from the input syntax, e.g.\ encounter of the |
|
59 |
next command keyword. |
|
60 |
||
61 |
More advanced interfaces such as Proof~General \cite{proofgeneral} |
|
62 |
do not require explicit semicolons, the amount of input text is |
|
63 |
determined automatically by inspecting the present content of the |
|
64 |
Emacs text buffer. In the printed presentation of Isabelle/Isar |
|
65 |
documents semicolons are omitted altogether for readability. |
|
66 |
||
67 |
\begin{warn} |
|
68 |
Proof~General requires certain syntax classification tables in |
|
69 |
order to achieve properly synchronized interaction with the |
|
70 |
Isabelle/Isar process. These tables need to be consistent with |
|
71 |
the Isabelle version and particular logic image to be used in a |
|
72 |
running session (common object-logics may well change the outer |
|
73 |
syntax). The standard setup should work correctly with any of the |
|
74 |
``official'' logic images derived from Isabelle/HOL (including |
|
75 |
HOLCF etc.). Users of alternative logics may need to tell |
|
76 |
Proof~General explicitly, e.g.\ by giving an option \verb|-k ZF| |
|
77 |
(in conjunction with \verb|-l ZF|, to specify the default |
|
78 |
logic image). Note that option \verb|-L| does both |
|
79 |
of this at the same time. |
|
80 |
\end{warn}% |
|
81 |
\end{isamarkuptext}% |
|
82 |
\isamarkuptrue% |
|
83 |
% |
|
28788 | 84 |
\isamarkupsection{Lexical matters \label{sec:outer-lex}% |
27037 | 85 |
} |
86 |
\isamarkuptrue% |
|
87 |
% |
|
88 |
\begin{isamarkuptext}% |
|
28788 | 89 |
The outer lexical syntax consists of three main categories of |
90 |
syntax tokens: |
|
91 |
||
92 |
\begin{enumerate} |
|
93 |
||
94 |
\item \emph{major keywords} --- the command names that are available |
|
95 |
in the present logic session; |
|
96 |
||
97 |
\item \emph{minor keywords} --- additional literal tokens required |
|
98 |
by the syntax of commands; |
|
99 |
||
100 |
\item \emph{named tokens} --- various categories of identifiers etc. |
|
101 |
||
102 |
\end{enumerate} |
|
27037 | 103 |
|
28788 | 104 |
Major keywords and minor keywords are guaranteed to be disjoint. |
105 |
This helps user-interfaces to determine the overall structure of a |
|
106 |
theory text, without knowing the full details of command syntax. |
|
107 |
Internally, there is some additional information about the kind of |
|
108 |
major keywords, which approximates the command type (theory command, |
|
109 |
proof command etc.). |
|
110 |
||
111 |
Keywords override named tokens. For example, the presence of a |
|
112 |
command called \verb|term| inhibits the identifier \verb|term|, but the string \verb|"term"| can be used instead. |
|
113 |
By convention, the outer syntax always allows quoted strings in |
|
114 |
addition to identifiers, wherever a named entity is expected. |
|
115 |
||
116 |
When tokenizing a given input sequence, the lexer repeatedly takes |
|
117 |
the longest prefix of the input that forms a valid token. Spaces, |
|
118 |
tabs, newlines and formfeeds between tokens serve as explicit |
|
119 |
separators. |
|
120 |
||
121 |
\medskip The categories for named tokens are defined once and for |
|
122 |
all as follows. |
|
27037 | 123 |
|
28788 | 124 |
\begin{center} |
125 |
\begin{supertabular}{rcl} |
|
40406 | 126 |
\indexdef{}{syntax}{ident}\hypertarget{syntax.ident}{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}letter\ quasiletter\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} \\ |
127 |
\indexdef{}{syntax}{longident}\hypertarget{syntax.longident}{\hyperlink{syntax.longident}{\mbox{\isa{longident}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}ident{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}}\verb|.|\isa{{\isaliteral{22}{\isachardoublequote}}ident{\isaliteral{29}{\isacharparenright}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2B}{\isacharplus}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
128 |
\indexdef{}{syntax}{symident}\hypertarget{syntax.symident}{\hyperlink{syntax.symident}{\mbox{\isa{symident}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}sym\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2B}{\isacharplus}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\|\verb|<|\isa{ident}\verb|>| \\ |
|
129 |
\indexdef{}{syntax}{nat}\hypertarget{syntax.nat}{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}} & = & \isa{{\isaliteral{22}{\isachardoublequote}}digit\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2B}{\isacharplus}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
130 |
\indexdef{}{syntax}{float}\hypertarget{syntax.float}{\hyperlink{syntax.float}{\mbox{\isa{float}}}} & = & \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}}} \\ |
|
131 |
\indexdef{}{syntax}{var}\hypertarget{syntax.var}{\hyperlink{syntax.var}{\mbox{\isa{var}}}} & = & \verb|?|\isa{{\isaliteral{22}{\isachardoublequote}}ident\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|?|\isa{ident}\verb|.|\isa{nat} \\ |
|
28788 | 132 |
\indexdef{}{syntax}{typefree}\hypertarget{syntax.typefree}{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}} & = & \verb|'|\isa{ident} \\ |
40406 | 133 |
\indexdef{}{syntax}{typevar}\hypertarget{syntax.typevar}{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}} & = & \verb|?|\isa{{\isaliteral{22}{\isachardoublequote}}typefree\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|?|\isa{typefree}\verb|.|\isa{nat} \\ |
134 |
\indexdef{}{syntax}{string}\hypertarget{syntax.string}{\hyperlink{syntax.string}{\mbox{\isa{string}}}} & = & \verb|"| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|"| \\ |
|
135 |
\indexdef{}{syntax}{altstring}\hypertarget{syntax.altstring}{\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}}} & = & \verb|`| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|`| \\ |
|
136 |
\indexdef{}{syntax}{verbatim}\hypertarget{syntax.verbatim}{\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}} & = & \verb|{*| \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}} \verb|*|\verb|}| \\[1ex] |
|
27037 | 137 |
|
40406 | 138 |
\isa{letter} & = & \isa{{\isaliteral{22}{\isachardoublequote}}latin\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\|\verb|<|\isa{latin}\verb|>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\|\verb|<|\isa{{\isaliteral{22}{\isachardoublequote}}latin\ latin{\isaliteral{22}{\isachardoublequote}}}\verb|>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ greek\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
139 |
& & \verb|\<^isub>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<^isup>| \\ |
|
140 |
\isa{quasiletter} & = & \isa{{\isaliteral{22}{\isachardoublequote}}letter\ \ {\isaliteral{7C}{\isacharbar}}\ \ digit\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|'| \\ |
|
141 |
\isa{latin} & = & \verb|a|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|z|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|A|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|Z| \\ |
|
142 |
\isa{digit} & = & \verb|0|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|9| \\ |
|
143 |
\isa{sym} & = & \verb|!|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|#|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|$|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|%|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|&|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|*|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|+|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|-|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|/|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
144 |
& & \verb|<|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|=|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|?|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|@|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|^|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|_|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb||\verb,|,\verb||\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|~| \\ |
|
145 |
\isa{greek} & = & \verb|\<alpha>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<beta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<gamma>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<delta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
146 |
& & \verb|\<epsilon>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<zeta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<eta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<theta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
147 |
& & \verb|\<iota>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<kappa>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<mu>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<nu>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
148 |
& & \verb|\<xi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<pi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<rho>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<sigma>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<tau>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
149 |
& & \verb|\<upsilon>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<phi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<chi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<psi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
150 |
& & \verb|\<omega>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Gamma>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Delta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Theta>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
151 |
& & \verb|\<Lambda>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Xi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Pi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Sigma>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}} \\ |
|
152 |
& & \verb|\<Upsilon>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Phi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Psi>|\isa{{\isaliteral{22}{\isachardoublequote}}\ \ {\isaliteral{7C}{\isacharbar}}\ \ {\isaliteral{22}{\isachardoublequote}}}\verb|\<Omega>| \\ |
|
28788 | 153 |
\end{supertabular} |
154 |
\end{center} |
|
155 |
||
156 |
A \indexref{}{syntax}{var}\hyperlink{syntax.var}{\mbox{\isa{var}}} or \indexref{}{syntax}{typevar}\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}} describes an unknown, |
|
157 |
which is internally a pair of base name and index (ML type \verb|indexname|). These components are either separated by a dot as in |
|
40406 | 158 |
\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{2E}{\isachardot}}{\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} or \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isadigit{7}}{\isaliteral{2E}{\isachardot}}{\isadigit{3}}{\isaliteral{22}{\isachardoublequote}}} or run together as in \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}. The latter form is possible if the base name does not end |
28788 | 159 |
with digits. If the index is 0, it may be dropped altogether: |
40406 | 160 |
\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isadigit{0}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{2E}{\isachardot}}{\isadigit{0}}{\isaliteral{22}{\isachardoublequote}}} all refer to the |
161 |
same unknown, with basename \isa{{\isaliteral{22}{\isachardoublequote}}x{\isaliteral{22}{\isachardoublequote}}} and index 0. |
|
28788 | 162 |
|
163 |
The syntax of \indexref{}{syntax}{string}\hyperlink{syntax.string}{\mbox{\isa{string}}} admits any characters, including |
|
27037 | 164 |
newlines; ``\verb|"|'' (double-quote) and ``\verb|\|'' (backslash) need to be escaped by a backslash; arbitrary |
165 |
character codes may be specified as ``\verb|\|\isa{ddd}'', |
|
166 |
with three decimal digits. Alternative strings according to |
|
28788 | 167 |
\indexref{}{syntax}{altstring}\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} are analogous, using single back-quotes |
168 |
instead. |
|
169 |
||
170 |
The body of \indexref{}{syntax}{verbatim}\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}} may consist of any text not |
|
27037 | 171 |
containing ``\verb|*|\verb|}|''; this allows |
28788 | 172 |
convenient inclusion of quotes without further escapes. There is no |
173 |
way to escape ``\verb|*|\verb|}|''. If the quoted |
|
174 |
text is {\LaTeX} source, one may usually add some blank or comment |
|
175 |
to avoid the critical character sequence. |
|
176 |
||
40406 | 177 |
Source comments take the form \verb|(*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*)| and may be nested, although the user-interface |
28788 | 178 |
might prevent this. Note that this form indicates source comments |
179 |
only, which are stripped after lexical analysis of the input. The |
|
180 |
Isar syntax also provides proper \emph{document comments} that are |
|
181 |
considered as part of the text (see \secref{sec:comments}). |
|
27037 | 182 |
|
40406 | 183 |
Common mathematical symbols such as \isa{{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}} are represented in |
27037 | 184 |
Isabelle as \verb|\<forall>|. There are infinitely many Isabelle |
185 |
symbols like this, although proper presentation is left to front-end |
|
186 |
tools such as {\LaTeX} or Proof~General with the X-Symbol package. |
|
29722 | 187 |
A list of predefined Isabelle symbols that work well with these |
188 |
tools is given in \appref{app:symbols}. Note that \verb|\<lambda>| |
|
189 |
does not belong to the \isa{letter} category, since it is already |
|
190 |
used differently in the Pure term language.% |
|
27037 | 191 |
\end{isamarkuptext}% |
192 |
\isamarkuptrue% |
|
193 |
% |
|
194 |
\isamarkupsection{Common syntax entities% |
|
195 |
} |
|
196 |
\isamarkuptrue% |
|
197 |
% |
|
198 |
\begin{isamarkuptext}% |
|
199 |
We now introduce several basic syntactic entities, such as names, |
|
200 |
terms, and theorem specifications, which are factored out of the |
|
201 |
actual Isar language elements to be described later.% |
|
202 |
\end{isamarkuptext}% |
|
203 |
\isamarkuptrue% |
|
204 |
% |
|
205 |
\isamarkupsubsection{Names% |
|
206 |
} |
|
207 |
\isamarkuptrue% |
|
208 |
% |
|
209 |
\begin{isamarkuptext}% |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
210 |
Entity \hyperlink{syntax.name}{\mbox{\isa{name}}} usually refers to any name of types, |
27037 | 211 |
constants, theorems etc.\ that are to be \emph{declared} or |
212 |
\emph{defined} (so qualified identifiers are excluded here). Quoted |
|
213 |
strings provide an escape for non-identifier names or those ruled |
|
214 |
out by outer syntax keywords (e.g.\ quoted \verb|"let"|). |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
215 |
Already existing objects are usually referenced by \hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}. |
27037 | 216 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
217 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
218 |
\rail@begin{4}{\indexdef{}{syntax}{name}\hypertarget{syntax.name}{\hyperlink{syntax.name}{\mbox{\isa{name}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
219 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
220 |
\rail@nont{\hyperlink{syntax.ident}{\mbox{\isa{ident}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
221 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
222 |
\rail@nont{\hyperlink{syntax.symident}{\mbox{\isa{symident}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
223 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
224 |
\rail@nont{\hyperlink{syntax.string}{\mbox{\isa{string}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
225 |
\rail@nextbar{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
226 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
227 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
228 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
229 |
\rail@begin{1}{\indexdef{}{syntax}{parname}\hypertarget{syntax.parname}{\hyperlink{syntax.parname}{\mbox{\isa{parname}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
230 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
231 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
232 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
233 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
234 |
\rail@begin{2}{\indexdef{}{syntax}{nameref}\hypertarget{syntax.nameref}{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
235 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
236 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
237 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
238 |
\rail@nont{\hyperlink{syntax.longident}{\mbox{\isa{longident}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
239 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
240 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
241 |
\end{railoutput}% |
40296 | 242 |
\end{isamarkuptext}% |
243 |
\isamarkuptrue% |
|
244 |
% |
|
245 |
\isamarkupsubsection{Numbers% |
|
246 |
} |
|
247 |
\isamarkuptrue% |
|
248 |
% |
|
249 |
\begin{isamarkuptext}% |
|
250 |
The outer lexical syntax (\secref{sec:outer-lex}) admits |
|
251 |
natural numbers and floating point numbers. These are combined as |
|
252 |
\hyperlink{syntax.int}{\mbox{\isa{int}}} and \hyperlink{syntax.real}{\mbox{\isa{real}}} as follows. |
|
253 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
254 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
255 |
\rail@begin{2}{\indexdef{}{syntax}{int}\hypertarget{syntax.int}{\hyperlink{syntax.int}{\mbox{\isa{int}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
256 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
257 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
258 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
259 |
\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
260 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
261 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
262 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
263 |
\rail@begin{2}{\indexdef{}{syntax}{real}\hypertarget{syntax.real}{\hyperlink{syntax.real}{\mbox{\isa{real}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
264 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
265 |
\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
266 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
267 |
\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
268 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
269 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
270 |
\end{railoutput} |
40296 | 271 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
272 |
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
273 |
Note that there is an overlap with the category \hyperlink{syntax.name}{\mbox{\isa{name}}}, |
40296 | 274 |
which also includes \hyperlink{syntax.nat}{\mbox{\isa{nat}}}.% |
27037 | 275 |
\end{isamarkuptext}% |
276 |
\isamarkuptrue% |
|
277 |
% |
|
278 |
\isamarkupsubsection{Comments \label{sec:comments}% |
|
279 |
} |
|
280 |
\isamarkuptrue% |
|
281 |
% |
|
282 |
\begin{isamarkuptext}% |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
283 |
Large chunks of plain \hyperlink{syntax.text}{\mbox{\isa{text}}} are usually given |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
284 |
\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}, i.e.\ enclosed in \verb|{|\verb|*|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}~\verb|*|\verb|}|. For convenience, |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
285 |
any of the smaller text units conforming to \hyperlink{syntax.nameref}{\mbox{\isa{nameref}}} are |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
286 |
admitted as well. A marginal \hyperlink{syntax.comment}{\mbox{\isa{comment}}} is of the form |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
287 |
\verb|--|~\hyperlink{syntax.text}{\mbox{\isa{text}}}. Any number of these may occur |
27037 | 288 |
within Isabelle/Isar commands. |
289 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
290 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
291 |
\rail@begin{2}{\indexdef{}{syntax}{text}\hypertarget{syntax.text}{\hyperlink{syntax.text}{\mbox{\isa{text}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
292 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
293 |
\rail@nont{\hyperlink{syntax.verbatim}{\mbox{\isa{verbatim}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
294 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
295 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
296 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
297 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
298 |
\rail@begin{1}{\indexdef{}{syntax}{comment}\hypertarget{syntax.comment}{\hyperlink{syntax.comment}{\mbox{\isa{comment}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
299 |
\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}{\isaliteral{2D}{\isacharminus}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
300 |
\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
301 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
302 |
\end{railoutput}% |
27037 | 303 |
\end{isamarkuptext}% |
304 |
\isamarkuptrue% |
|
305 |
% |
|
306 |
\isamarkupsubsection{Type classes, sorts and arities% |
|
307 |
} |
|
308 |
\isamarkuptrue% |
|
309 |
% |
|
310 |
\begin{isamarkuptext}% |
|
311 |
Classes are specified by plain names. Sorts have a very simple |
|
312 |
inner syntax, which is either a single class name \isa{c} or a |
|
40406 | 313 |
list \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7B}{\isacharbraceleft}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{22}{\isachardoublequote}}} referring to the |
27037 | 314 |
intersection of these classes. The syntax of type arities is given |
315 |
directly at the outer level. |
|
316 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
317 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
318 |
\rail@begin{3}{\indexdef{}{syntax}{classdecl}\hypertarget{syntax.classdecl}{\hyperlink{syntax.classdecl}{\mbox{\isa{classdecl}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
319 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
320 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
321 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
322 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
323 |
\rail@term{\isa{{\isaliteral{3C}{\isacharless}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
324 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
325 |
\rail@term{\isa{{\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
326 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
327 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
328 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
329 |
\rail@nextplus{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
330 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
331 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
332 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
333 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
334 |
\rail@begin{1}{\indexdef{}{syntax}{sort}\hypertarget{syntax.sort}{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
335 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
336 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
337 |
\rail@begin{3}{\indexdef{}{syntax}{arity}\hypertarget{syntax.arity}{\hyperlink{syntax.arity}{\mbox{\isa{arity}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
338 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
339 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
340 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
341 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
342 |
\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
343 |
\rail@nextplus{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
344 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
345 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
346 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
347 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
348 |
\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
349 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
350 |
\end{railoutput}% |
27037 | 351 |
\end{isamarkuptext}% |
352 |
\isamarkuptrue% |
|
353 |
% |
|
354 |
\isamarkupsubsection{Types and terms \label{sec:types-terms}% |
|
355 |
} |
|
356 |
\isamarkuptrue% |
|
357 |
% |
|
358 |
\begin{isamarkuptext}% |
|
359 |
The actual inner Isabelle syntax, that of types and terms of the |
|
360 |
logic, is far too sophisticated in order to be modelled explicitly |
|
361 |
at the outer theory level. Basically, any such entity has to be |
|
362 |
quoted to turn it into a single token (the parsing and type-checking |
|
363 |
is performed internally later). For convenience, a slightly more |
|
364 |
liberal convention is adopted: quotes may be omitted for any type or |
|
365 |
term that is already atomic at the outer level. For example, one |
|
366 |
may just write \verb|x| instead of quoted \verb|"x"|. |
|
40406 | 367 |
Note that symbolic identifiers (e.g.\ \verb|++| or \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}{\isaliteral{22}{\isachardoublequote}}} are available as well, provided these have not been superseded |
27037 | 368 |
by commands or other keywords already (such as \verb|=| or |
369 |
\verb|+|). |
|
370 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
371 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
372 |
\rail@begin{3}{\indexdef{}{syntax}{type}\hypertarget{syntax.type}{\hyperlink{syntax.type}{\mbox{\isa{type}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
373 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
374 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
375 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
376 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
377 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
378 |
\rail@nont{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
379 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
380 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
381 |
\rail@begin{2}{\indexdef{}{syntax}{term}\hypertarget{syntax.term}{\hyperlink{syntax.term}{\mbox{\isa{term}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
382 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
383 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
384 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
385 |
\rail@nont{\hyperlink{syntax.var}{\mbox{\isa{var}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
386 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
387 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
388 |
\rail@begin{1}{\indexdef{}{syntax}{prop}\hypertarget{syntax.prop}{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
389 |
\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
390 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
391 |
\end{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
392 |
|
27037 | 393 |
|
394 |
Positional instantiations are indicated by giving a sequence of |
|
40406 | 395 |
terms, or the placeholder ``\isa{{\isaliteral{5F}{\isacharunderscore}}}'' (underscore), which means to |
27037 | 396 |
skip a position. |
397 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
398 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
399 |
\rail@begin{2}{\indexdef{}{syntax}{inst}\hypertarget{syntax.inst}{\hyperlink{syntax.inst}{\mbox{\isa{inst}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
400 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
401 |
\rail@term{\isa{{\isaliteral{5F}{\isacharunderscore}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
402 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
403 |
\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
404 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
405 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
406 |
\rail@begin{2}{\indexdef{}{syntax}{insts}\hypertarget{syntax.insts}{\hyperlink{syntax.insts}{\mbox{\isa{insts}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
407 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
408 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
409 |
\rail@cnont{\hyperlink{syntax.inst}{\mbox{\isa{inst}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
410 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
411 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
412 |
\end{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
413 |
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
414 |
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
415 |
Type declarations and definitions usually refer to \hyperlink{syntax.typespec}{\mbox{\isa{typespec}}} on the left-hand side. This models basic type constructor |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
416 |
application at the outer syntax level. Note that only plain postfix |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
417 |
notation is available here, but no infixes. |
27037 | 418 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
419 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
420 |
\rail@begin{4}{\indexdef{}{syntax}{typespec}\hypertarget{syntax.typespec}{\hyperlink{syntax.typespec}{\mbox{\isa{typespec}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
421 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
422 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
423 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
424 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
425 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
426 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
427 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
428 |
\rail@nextplus{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
429 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
430 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
431 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
432 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
433 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
434 |
\rail@end |
42705 | 435 |
\rail@begin{6}{\indexdef{}{syntax}{typespec\_sorts}\hypertarget{syntax.typespec-sorts}{\hyperlink{syntax.typespec-sorts}{\mbox{\isa{typespec{\isaliteral{5F}{\isacharunderscore}}sorts}}}}} |
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
436 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
437 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
438 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
439 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
440 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
441 |
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
442 |
\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
443 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
444 |
\rail@nextbar{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
445 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
446 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
447 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
448 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
449 |
\rail@nextbar{4} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
450 |
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
451 |
\rail@nont{\hyperlink{syntax.sort}{\mbox{\isa{sort}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
452 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
453 |
\rail@nextplus{5} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
454 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
455 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
456 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
457 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
458 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
459 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
460 |
\end{railoutput}% |
27037 | 461 |
\end{isamarkuptext}% |
462 |
\isamarkuptrue% |
|
463 |
% |
|
464 |
\isamarkupsubsection{Term patterns and declarations \label{sec:term-decls}% |
|
465 |
} |
|
466 |
\isamarkuptrue% |
|
467 |
% |
|
468 |
\begin{isamarkuptext}% |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
469 |
Wherever explicit propositions (or term fragments) occur in a |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
470 |
proof text, casual binding of schematic term variables may be given |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
471 |
specified via patterns of the form ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C49533E}{\isasymIS}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}''. |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
472 |
This works both for \hyperlink{syntax.term}{\mbox{\isa{term}}} and \hyperlink{syntax.prop}{\mbox{\isa{prop}}}. |
27037 | 473 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
474 |
\begin{railoutput} |
42705 | 475 |
\rail@begin{2}{\indexdef{}{syntax}{term\_pat}\hypertarget{syntax.term-pat}{\hyperlink{syntax.term-pat}{\mbox{\isa{term{\isaliteral{5F}{\isacharunderscore}}pat}}}}} |
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
476 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
477 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
478 |
\rail@term{\isa{\isakeyword{is}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
479 |
\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
480 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
481 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
482 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
483 |
\rail@end |
42705 | 484 |
\rail@begin{2}{\indexdef{}{syntax}{prop\_pat}\hypertarget{syntax.prop-pat}{\hyperlink{syntax.prop-pat}{\mbox{\isa{prop{\isaliteral{5F}{\isacharunderscore}}pat}}}}} |
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
485 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
486 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
487 |
\rail@term{\isa{\isakeyword{is}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
488 |
\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
489 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
490 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
491 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
492 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
493 |
\end{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
494 |
|
27037 | 495 |
|
40406 | 496 |
\medskip Declarations of local variables \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} and |
497 |
logical propositions \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} represent different views on |
|
27037 | 498 |
the same principle of introducing a local scope. In practice, one |
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
499 |
may usually omit the typing of \hyperlink{syntax.vars}{\mbox{\isa{vars}}} (due to |
27037 | 500 |
type-inference), and the naming of propositions (due to implicit |
501 |
references of current facts). In any case, Isar proof elements |
|
502 |
usually admit to introduce multiple such items simultaneously. |
|
503 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
504 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
505 |
\rail@begin{2}{\indexdef{}{syntax}{vars}\hypertarget{syntax.vars}{\hyperlink{syntax.vars}{\mbox{\isa{vars}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
506 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
507 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
508 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
509 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
510 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
511 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
512 |
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
513 |
\rail@nont{\hyperlink{syntax.type}{\mbox{\isa{type}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
514 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
515 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
516 |
\rail@begin{3}{\indexdef{}{syntax}{props}\hypertarget{syntax.props}{\hyperlink{syntax.props}{\mbox{\isa{props}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
517 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
518 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
519 |
\rail@nont{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
520 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
521 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
522 |
\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
523 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
524 |
\rail@nextbar{1} |
42705 | 525 |
\rail@nont{\hyperlink{syntax.prop-pat}{\mbox{\isa{prop{\isaliteral{5F}{\isacharunderscore}}pat}}}}[] |
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
526 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
527 |
\rail@nextplus{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
528 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
529 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
530 |
\end{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
531 |
|
27037 | 532 |
|
533 |
The treatment of multiple declarations corresponds to the |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
534 |
complementary focus of \hyperlink{syntax.vars}{\mbox{\isa{vars}}} versus \hyperlink{syntax.props}{\mbox{\isa{props}}}. In |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
535 |
``\isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}}'' the typing refers to all variables, while |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
536 |
in \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} the naming refers to all propositions |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
537 |
collectively. Isar language elements that refer to \hyperlink{syntax.vars}{\mbox{\isa{vars}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
538 |
or \hyperlink{syntax.props}{\mbox{\isa{props}}} typically admit separate typings or namings via |
27037 | 539 |
another level of iteration, with explicit \indexref{}{keyword}{and}\hyperlink{keyword.and}{\mbox{\isa{\isakeyword{and}}}} |
540 |
separators; e.g.\ see \hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}} and \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} in |
|
541 |
\secref{sec:proof-context}.% |
|
542 |
\end{isamarkuptext}% |
|
543 |
\isamarkuptrue% |
|
544 |
% |
|
28788 | 545 |
\isamarkupsubsection{Attributes and theorems \label{sec:syn-att}% |
546 |
} |
|
547 |
\isamarkuptrue% |
|
548 |
% |
|
549 |
\begin{isamarkuptext}% |
|
550 |
Attributes have their own ``semi-inner'' syntax, in the sense |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
551 |
that input conforming to \hyperlink{syntax.args}{\mbox{\isa{args}}} below is parsed by the |
28788 | 552 |
attribute a second time. The attribute argument specifications may |
553 |
be any sequence of atomic entities (identifiers, strings etc.), or |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
554 |
properly bracketed argument lists. Below \hyperlink{syntax.atom}{\mbox{\isa{atom}}} refers to |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
555 |
any atomic entity, including any \hyperlink{syntax.keyword}{\mbox{\isa{keyword}}} conforming to |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
556 |
\hyperlink{syntax.symident}{\mbox{\isa{symident}}}. |
28788 | 557 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
558 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
559 |
\rail@begin{7}{\indexdef{}{syntax}{atom}\hypertarget{syntax.atom}{\hyperlink{syntax.atom}{\mbox{\isa{atom}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
560 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
561 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
562 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
563 |
\rail@nont{\hyperlink{syntax.typefree}{\mbox{\isa{typefree}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
564 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
565 |
\rail@nont{\hyperlink{syntax.typevar}{\mbox{\isa{typevar}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
566 |
\rail@nextbar{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
567 |
\rail@nont{\hyperlink{syntax.var}{\mbox{\isa{var}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
568 |
\rail@nextbar{4} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
569 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
570 |
\rail@nextbar{5} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
571 |
\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
572 |
\rail@nextbar{6} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
573 |
\rail@nont{\hyperlink{syntax.keyword}{\mbox{\isa{keyword}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
574 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
575 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
576 |
\rail@begin{3}{\isa{arg}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
577 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
578 |
\rail@nont{\hyperlink{syntax.atom}{\mbox{\isa{atom}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
579 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
580 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
581 |
\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
582 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
583 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
584 |
\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
585 |
\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
586 |
\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
587 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
588 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
589 |
\rail@begin{2}{\indexdef{}{syntax}{args}\hypertarget{syntax.args}{\hyperlink{syntax.args}{\mbox{\isa{args}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
590 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
591 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
592 |
\rail@cnont{\isa{arg}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
593 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
594 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
595 |
\rail@begin{3}{\indexdef{}{syntax}{attributes}\hypertarget{syntax.attributes}{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
596 |
\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
597 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
598 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
599 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
600 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
601 |
\rail@nont{\hyperlink{syntax.args}{\mbox{\isa{args}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
602 |
\rail@nextplus{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
603 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
604 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
605 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
606 |
\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
607 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
608 |
\end{railoutput} |
28788 | 609 |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
610 |
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
611 |
Theorem specifications come in several flavors: \hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
612 |
and \hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}} usually refer to axioms, assumptions or |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
613 |
results of goal statements, while \hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}} collects lists of |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
614 |
existing theorems. Existing theorems are given by \hyperlink{syntax.thmref}{\mbox{\isa{thmref}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
615 |
and \hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}, the former requires an actual singleton |
28788 | 616 |
result. |
617 |
||
618 |
There are three forms of theorem references: |
|
619 |
\begin{enumerate} |
|
620 |
||
40406 | 621 |
\item named facts \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{22}{\isachardoublequote}}}, |
28788 | 622 |
|
40406 | 623 |
\item selections from named facts \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{28}{\isacharparenleft}}i{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} or \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{28}{\isacharparenleft}}j\ {\isaliteral{2D}{\isacharminus}}\ k{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, |
28788 | 624 |
|
625 |
\item literal fact propositions using \indexref{}{syntax}{altstring}\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}} syntax |
|
40406 | 626 |
\verb|`|\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}}\verb|`| (see also method |
28788 | 627 |
\indexref{}{method}{fact}\hyperlink{method.fact}{\mbox{\isa{fact}}}). |
628 |
||
629 |
\end{enumerate} |
|
630 |
||
631 |
Any kind of theorem specification may include lists of attributes |
|
632 |
both on the left and right hand sides; attributes are applied to any |
|
633 |
immediately preceding fact. If names are omitted, the theorems are |
|
634 |
not stored within the theorem database of the theory or proof |
|
635 |
context, but any given attributes are applied nonetheless. |
|
636 |
||
40406 | 637 |
An extra pair of brackets around attributes (like ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5B}{\isacharbrackleft}}simproc\ a{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}'') abbreviates a theorem reference involving an |
28788 | 638 |
internal dummy fact, which will be ignored later on. So only the |
639 |
effect of the attribute on the background context will persist. |
|
640 |
This form of in-place declarations is particularly useful with |
|
641 |
commands like \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} and \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}. |
|
642 |
||
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
643 |
\begin{railoutput} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
644 |
\rail@begin{2}{\indexdef{}{syntax}{axmdecl}\hypertarget{syntax.axmdecl}{\hyperlink{syntax.axmdecl}{\mbox{\isa{axmdecl}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
645 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
646 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
647 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
648 |
\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
649 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
650 |
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
651 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
652 |
\rail@begin{1}{\indexdef{}{syntax}{thmdecl}\hypertarget{syntax.thmdecl}{\hyperlink{syntax.thmdecl}{\mbox{\isa{thmdecl}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
653 |
\rail@nont{\isa{thmbind}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
654 |
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
655 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
656 |
\rail@begin{1}{\indexdef{}{syntax}{thmdef}\hypertarget{syntax.thmdef}{\hyperlink{syntax.thmdef}{\mbox{\isa{thmdef}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
657 |
\rail@nont{\isa{thmbind}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
658 |
\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
659 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
660 |
\rail@begin{4}{\indexdef{}{syntax}{thmref}\hypertarget{syntax.thmref}{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
661 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
662 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
663 |
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
664 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
665 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
666 |
\rail@nont{\isa{selection}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
667 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
668 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
669 |
\rail@nont{\hyperlink{syntax.altstring}{\mbox{\isa{altstring}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
670 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
671 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
672 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
673 |
\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
674 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
675 |
\rail@nextbar{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
676 |
\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
677 |
\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
678 |
\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
679 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
680 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
681 |
\rail@begin{2}{\indexdef{}{syntax}{thmrefs}\hypertarget{syntax.thmrefs}{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
682 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
683 |
\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
684 |
\rail@nextplus{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
685 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
686 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
687 |
\rail@begin{3}{\isa{thmbind}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
688 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
689 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
690 |
\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
691 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
692 |
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
693 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
694 |
\rail@nont{\hyperlink{syntax.attributes}{\mbox{\isa{attributes}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
695 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
696 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
697 |
\rail@begin{4}{\isa{selection}} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
698 |
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
699 |
\rail@plus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
700 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
701 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
702 |
\rail@nextbar{1} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
703 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
704 |
\rail@term{\isa{{\isaliteral{2D}{\isacharminus}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
705 |
\rail@bar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
706 |
\rail@nextbar{2} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
707 |
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
708 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
709 |
\rail@endbar |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
710 |
\rail@nextplus{3} |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
711 |
\rail@cterm{\isa{{\isaliteral{2C}{\isacharcomma}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
712 |
\rail@endplus |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
713 |
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[] |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
714 |
\rail@end |
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
40406
diff
changeset
|
715 |
\end{railoutput}% |
28788 | 716 |
\end{isamarkuptext}% |
717 |
\isamarkuptrue% |
|
718 |
% |
|
27037 | 719 |
\isadelimtheory |
720 |
% |
|
721 |
\endisadelimtheory |
|
722 |
% |
|
723 |
\isatagtheory |
|
724 |
\isacommand{end}\isamarkupfalse% |
|
725 |
% |
|
726 |
\endisatagtheory |
|
727 |
{\isafoldtheory}% |
|
728 |
% |
|
729 |
\isadelimtheory |
|
730 |
% |
|
731 |
\endisadelimtheory |
|
732 |
\isanewline |
|
733 |
\end{isabellebody}% |
|
734 |
%%% Local Variables: |
|
735 |
%%% mode: latex |
|
736 |
%%% TeX-master: "root" |
|
737 |
%%% End: |