10305
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Overloading{\isadigit{2}}}%
|
|
4 |
%
|
|
5 |
\begin{isamarkuptext}%
|
|
6 |
Of course this is not the only possible definition of the two relations.
|
10328
|
7 |
Componentwise comparison of lists of equal length also makes sense. This time
|
|
8 |
the elements of the list must also be of class \isa{ordrel} to permit their
|
|
9 |
comparison:%
|
10305
|
10 |
\end{isamarkuptext}%
|
|
11 |
\isacommand{instance}\ list\ {\isacharcolon}{\isacharcolon}\ {\isacharparenleft}ordrel{\isacharparenright}ordrel\isanewline
|
|
12 |
\isacommand{by}\ intro{\isacharunderscore}classes\isanewline
|
|
13 |
\isanewline
|
|
14 |
\isacommand{defs}\ {\isacharparenleft}\isakeyword{overloaded}{\isacharparenright}\isanewline
|
|
15 |
le{\isacharunderscore}list{\isacharunderscore}def{\isacharcolon}\ {\isachardoublequote}xs\ {\isacharless}{\isacharless}{\isacharequal}\ {\isacharparenleft}ys{\isacharcolon}{\isacharcolon}{\isacharprime}a{\isacharcolon}{\isacharcolon}ordrel\ list{\isacharparenright}\ {\isasymequiv}\isanewline
|
|
16 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ size\ xs\ {\isacharequal}\ size\ ys\ {\isasymand}\ {\isacharparenleft}{\isasymforall}i{\isacharless}size\ xs{\isachardot}\ xs{\isacharbang}i\ {\isacharless}{\isacharless}{\isacharequal}\ ys{\isacharbang}i{\isacharparenright}{\isachardoublequote}%
|
|
17 |
\begin{isamarkuptext}%
|
10328
|
18 |
\noindent
|
10396
|
19 |
The infix function \isa{{\isacharbang}} yields the nth element of a list.%
|
|
20 |
\end{isamarkuptext}%
|
|
21 |
%
|
10878
|
22 |
\isamarkupsubsubsection{Predefined Overloading%
|
10397
|
23 |
}
|
10396
|
24 |
%
|
|
25 |
\begin{isamarkuptext}%
|
|
26 |
HOL comes with a number of overloaded constants and corresponding classes.
|
10978
|
27 |
The most important ones are listed in Table~\ref{tab:overloading} in the appendix. They are
|
10971
|
28 |
defined on all numeric types and sometimes on other types as well, for example
|
10396
|
29 |
\isa{{\isacharminus}}, \isa{{\isasymle}} and \isa{{\isacharless}} on sets.
|
|
30 |
|
10696
|
31 |
In addition there is a special input syntax for bounded quantifiers:
|
|
32 |
\begin{center}
|
|
33 |
\begin{tabular}{lcl}
|
|
34 |
\isa{{\isasymforall}x\ {\isasymle}\ y{\isachardot}\ P\ x} & \isa{{\isasymequiv}} & \isa{{\isasymforall}x{\isachardot}\ x\ {\isasymle}\ y\ {\isasymlongrightarrow}\ P\ x} \\
|
|
35 |
\isa{{\isasymexists}x\ {\isasymle}\ y{\isachardot}\ P\ x} & \isa{{\isasymequiv}} & \isa{{\isasymexists}x{\isachardot}\ x\ {\isasymle}\ y\ {\isasymand}\ P\ x}
|
|
36 |
\end{tabular}
|
|
37 |
\end{center}
|
|
38 |
And analogously for \isa{{\isacharless}} instead of \isa{{\isasymle}}.
|
|
39 |
The form on the left is translated into the one on the right upon input but it is not
|
|
40 |
translated back upon output.%
|
10305
|
41 |
\end{isamarkuptext}%
|
|
42 |
\end{isabellebody}%
|
|
43 |
%%% Local Variables:
|
|
44 |
%%% mode: latex
|
|
45 |
%%% TeX-master: "root"
|
|
46 |
%%% End:
|