doc-src/TutorialI/Misc/types.thy
author blanchet
Tue, 21 Dec 2010 03:56:51 +0100
changeset 41335 66edbd0f7a2e
parent 27015 f8537d69f514
child 42765 aec61b60ff7b
permissions -rw-r--r--
added "smt_triggers" option to experiment with triggers in Sledgehammer; renamings (for consistency)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17914
99ead7a7eb42 fix headers;
wenzelm
parents: 12327
diff changeset
     1
(*<*)theory "types" imports Main begin(*>*)
10788
ea48dd8b0232 *** empty log message ***
nipkow
parents: 9933
diff changeset
     2
types number       = nat
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9792
diff changeset
     3
      gate         = "bool \<Rightarrow> bool \<Rightarrow> bool"
12327
5a4d78204492 *** empty log message ***
nipkow
parents: 11457
diff changeset
     4
      ('a,'b)alist = "('a \<times> 'b)list"
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     5
11428
332347b9b942 tidying the index
paulson
parents: 10885
diff changeset
     6
text{*\noindent
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     7
Internally all synonyms are fully expanded.  As a consequence Isabelle's
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     8
output never contains synonyms.  Their main purpose is to improve the
8771
026f37a86ea7 *** empty log message ***
nipkow
parents: 8745
diff changeset
     9
readability of theories.  Synonyms can be used just like any other
27015
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    10
type.
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    11
*}
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    12
10885
90695f46440b lcp's pass over the book, chapters 1-8
paulson
parents: 10788
diff changeset
    13
subsection{*Constant Definitions*}
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    14
11428
332347b9b942 tidying the index
paulson
parents: 10885
diff changeset
    15
text{*\label{sec:ConstDefinitions}\indexbold{definitions}%
27015
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    16
Nonrecursive definitions can be made with the \commdx{definition}
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    17
command, for example @{text nand} and @{text xor} gates
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    18
(based on type @{typ gate} above):
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    19
*}
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    20
27015
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    21
definition nand :: gate where "nand A B \<equiv> \<not>(A \<and> B)"
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    22
definition xor  :: gate where "xor  A B \<equiv> A \<and> \<not>B \<or> \<not>A \<and> B"
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    23
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    24
text{*\noindent%
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    25
The symbol \indexboldpos{\isasymequiv}{$IsaEq} is a special form of equality
9541
d17c0b34d5c8 *** empty log message ***
nipkow
parents: 8771
diff changeset
    26
that must be used in constant definitions.
11457
279da0358aa9 additional revisions to chapters 1, 2
paulson
parents: 11456
diff changeset
    27
Pattern-matching is not allowed: each definition must be of
279da0358aa9 additional revisions to chapters 1, 2
paulson
parents: 11456
diff changeset
    28
the form $f\,x@1\,\dots\,x@n~\isasymequiv~t$.
279da0358aa9 additional revisions to chapters 1, 2
paulson
parents: 11456
diff changeset
    29
Section~\ref{sec:Simp-with-Defs} explains how definitions are used
27015
f8537d69f514 *** empty log message ***
nipkow
parents: 17914
diff changeset
    30
in proofs. The default name of each definition is $f$@{text"_def"}, where
10788
ea48dd8b0232 *** empty log message ***
nipkow
parents: 9933
diff changeset
    31
$f$ is the name of the defined constant.*}
ea48dd8b0232 *** empty log message ***
nipkow
parents: 9933
diff changeset
    32
(*<*)end(*>*)