8749
|
1 |
\begin{isabelle}%
|
9541
|
2 |
\isacommand{types}\ number\ \ \ \ \ \ \ =\ nat\isanewline
|
|
3 |
\ \ \ \ \ \ gate\ \ \ \ \ \ \ \ \ =\ {"}bool\ {\isasymRightarrow}\ bool\ {\isasymRightarrow}\ bool{"}\isanewline
|
|
4 |
\ \ \ \ \ \ ('a,'b)alist\ =\ {"}('a\ *\ 'b)list{"}%
|
8749
|
5 |
\begin{isamarkuptext}%
|
|
6 |
\noindent\indexbold{*types}%
|
|
7 |
Internally all synonyms are fully expanded. As a consequence Isabelle's
|
|
8 |
output never contains synonyms. Their main purpose is to improve the
|
8771
|
9 |
readability of theories. Synonyms can be used just like any other
|
8749
|
10 |
type:%
|
|
11 |
\end{isamarkuptext}%
|
9541
|
12 |
\isacommand{consts}\ nand\ ::\ gate\isanewline
|
|
13 |
\ \ \ \ \ \ \ exor\ ::\ gate%
|
8749
|
14 |
\begin{isamarkuptext}%
|
|
15 |
\subsection{Constant definitions}
|
|
16 |
\label{sec:ConstDefinitions}
|
|
17 |
\indexbold{definition}
|
|
18 |
|
|
19 |
The above constants \isa{nand} and \isa{exor} are non-recursive and can
|
|
20 |
therefore be defined directly by%
|
|
21 |
\end{isamarkuptext}%
|
9541
|
22 |
\isacommand{defs}\ nand\_def:\ {"}nand\ A\ B\ {\isasymequiv}\ {\isasymnot}(A\ {\isasymand}\ B){"}\isanewline
|
|
23 |
\ \ \ \ \ exor\_def:\ {"}exor\ A\ B\ {\isasymequiv}\ A\ {\isasymand}\ {\isasymnot}B\ {\isasymor}\ {\isasymnot}A\ {\isasymand}\ B{"}%
|
8749
|
24 |
\begin{isamarkuptext}%
|
|
25 |
\noindent%
|
|
26 |
where \isacommand{defs}\indexbold{*defs} is a keyword and \isa{nand_def} and
|
8771
|
27 |
\isa{exor_def} are user-supplied names.
|
8749
|
28 |
The symbol \indexboldpos{\isasymequiv}{$IsaEq} is a special form of equality
|
9541
|
29 |
that must be used in constant definitions.
|
8749
|
30 |
Declarations and definitions can also be merged%
|
|
31 |
\end{isamarkuptext}%
|
9541
|
32 |
\isacommand{constdefs}\ nor\ ::\ gate\isanewline
|
|
33 |
\ \ \ \ \ \ \ \ \ {"}nor\ A\ B\ {\isasymequiv}\ {\isasymnot}(A\ {\isasymor}\ B){"}\isanewline
|
|
34 |
\ \ \ \ \ \ \ \ \ \ exor2\ ::\ gate\isanewline
|
|
35 |
\ \ \ \ \ \ \ \ \ {"}exor2\ A\ B\ {\isasymequiv}\ (A\ {\isasymor}\ B)\ {\isasymand}\ ({\isasymnot}A\ {\isasymor}\ {\isasymnot}B){"}%
|
8749
|
36 |
\begin{isamarkuptext}%
|
|
37 |
\noindent\indexbold{*constdefs}%
|
|
38 |
in which case the default name of each definition is \isa{$f$_def}, where
|
|
39 |
$f$ is the name of the defined constant.%
|
|
40 |
\end{isamarkuptext}%
|
|
41 |
\end{isabelle}%
|
9145
|
42 |
%%% Local Variables:
|
|
43 |
%%% mode: latex
|
|
44 |
%%% TeX-master: "root"
|
|
45 |
%%% End:
|