doc-src/TutorialI/Types/document/Typedef.tex
changeset 10420 ef006735bee8
parent 10397 e2d0dda41f2c
child 10589 b2d1b393b750
equal deleted inserted replaced
10419:1bfdd19c1d47 10420:ef006735bee8
    13 need for a more advanced type. If you cannot avoid that type, and you are
    13 need for a more advanced type. If you cannot avoid that type, and you are
    14 quite certain that it is not definable by any of the standard means,
    14 quite certain that it is not definable by any of the standard means,
    15 then read on.
    15 then read on.
    16 \begin{warn}
    16 \begin{warn}
    17   Types in HOL must be non-empty; otherwise the quantifier rules would be
    17   Types in HOL must be non-empty; otherwise the quantifier rules would be
    18   unsound, because $\exists x. x=x$ is a theorem.
    18   unsound, because $\exists x.\ x=x$ is a theorem.
    19 \end{warn}%
    19 \end{warn}%
    20 \end{isamarkuptext}%
    20 \end{isamarkuptext}%
    21 %
    21 %
    22 \isamarkupsubsection{Declaring new types%
    22 \isamarkupsubsection{Declaring new types%
    23 }
    23 }
    28 declaration}:%
    28 declaration}:%
    29 \end{isamarkuptext}%
    29 \end{isamarkuptext}%
    30 \isacommand{typedecl}\ my{\isacharunderscore}new{\isacharunderscore}type%
    30 \isacommand{typedecl}\ my{\isacharunderscore}new{\isacharunderscore}type%
    31 \begin{isamarkuptext}%
    31 \begin{isamarkuptext}%
    32 \noindent\indexbold{*typedecl}%
    32 \noindent\indexbold{*typedecl}%
    33 This does not define the type at all but merely introduces its name, \isa{my{\isacharunderscore}new{\isacharunderscore}type}. Thus we know nothing about this type, except that it is
    33 This does not define \isa{my{\isacharunderscore}new{\isacharunderscore}type} at all but merely introduces its
       
    34 name. Thus we know nothing about this type, except that it is
    34 non-empty. Such declarations without definitions are
    35 non-empty. Such declarations without definitions are
    35 useful only if that type can be viewed as a parameter of a theory and we do
    36 useful only if that type can be viewed as a parameter of a theory and we do
    36 not intend to impose any restrictions on it. A typical example is given in
    37 not intend to impose any restrictions on it. A typical example is given in
    37 \S\ref{sec:VMC}, where we define transition relations over an arbitrary type
    38 \S\ref{sec:VMC}, where we define transition relations over an arbitrary type
    38 of states without any internal structure.
    39 of states without any internal structure.
    45 If you are looking for a quick and dirty way of introducing a new type
    46 If you are looking for a quick and dirty way of introducing a new type
    46 together with its properties: declare the type and state its properties as
    47 together with its properties: declare the type and state its properties as
    47 axioms. Example:%
    48 axioms. Example:%
    48 \end{isamarkuptext}%
    49 \end{isamarkuptext}%
    49 \isacommand{axioms}\isanewline
    50 \isacommand{axioms}\isanewline
    50 just{\isacharunderscore}one{\isacharcolon}\ {\isachardoublequote}{\isasymexists}{\isacharbang}\ x{\isacharcolon}{\isacharcolon}my{\isacharunderscore}new{\isacharunderscore}type{\isachardot}\ True{\isachardoublequote}%
    51 just{\isacharunderscore}one{\isacharcolon}\ {\isachardoublequote}{\isasymexists}x{\isacharcolon}{\isacharcolon}my{\isacharunderscore}new{\isacharunderscore}type{\isachardot}\ {\isasymforall}y{\isachardot}\ x\ {\isacharequal}\ y{\isachardoublequote}%
    51 \begin{isamarkuptext}%
    52 \begin{isamarkuptext}%
    52 \noindent
    53 \noindent
    53 However, we strongly discourage this approach, except at explorative stages
    54 However, we strongly discourage this approach, except at explorative stages
    54 of your development. It is extremely easy to write down contradictory sets of
    55 of your development. It is extremely easy to write down contradictory sets of
    55 axioms, in which case you will be able to prove everything but it will mean
    56 axioms, in which case you will be able to prove everything but it will mean