author | Christian Urban <urbanc@in.tum.de> |
Mon, 12 Jan 2009 16:03:05 +0000 | |
changeset 66 | d563f8ff6aa0 |
parent 65 | c8e9a4f97916 |
child 68 | e7519207c2b7 |
permissions | -rw-r--r-- |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
theory FirstSteps |
25
e2f9f94b26d4
Antiquotation setup is now contained in theory Base.
berghofe
parents:
21
diff
changeset
|
2 |
imports Base |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
3 |
begin |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
5 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
6 |
chapter {* First Steps *} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
7 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
8 |
text {* |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
9 |
|
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
10 |
Isabelle programming is done in ML. Just like lemmas and proofs, ML-code |
50 | 11 |
in Isabelle is part of a theory. If you want to follow the code written in |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
12 |
this chapter, we assume you are working inside the theory starting with |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
|
6 | 14 |
\begin{center} |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
15 |
\begin{tabular}{@ {}l} |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
16 |
\isacommand{theory} FirstSteps\\ |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
17 |
\isacommand{imports} Main\\ |
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
18 |
\isacommand{begin}\\ |
6 | 19 |
\ldots |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
20 |
\end{tabular} |
6 | 21 |
\end{center} |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
22 |
*} |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
23 |
|
20 | 24 |
section {* Including ML-Code *} |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
25 |
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
26 |
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
27 |
|
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
28 |
text {* |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
29 |
The easiest and quickest way to include code in a theory is |
49 | 30 |
by using the \isacommand{ML}-command. For example\smallskip |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
32 |
\isa{\isacommand{ML} |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
33 |
\isacharverbatimopen\isanewline |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
34 |
\hspace{5mm}@{ML "3 + 4"}\isanewline |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
35 |
\isacharverbatimclose\isanewline |
58 | 36 |
@{text "> 7"}\smallskip} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
37 |
|
58 | 38 |
The @{text [quotes] "> 7"} indicates the response Isabelle prints out when the |
39 |
\isacommand{ML}-command is evaluated. Like ``normal'' Isabelle proof scripts, |
|
40 |
\isacommand{ML}-commands can be evaluated by using the advance and undo buttons of |
|
49 | 41 |
your Isabelle environment. The code inside the \isacommand{ML}-command |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
42 |
can also contain value and function bindings, and even those can be |
58 | 43 |
undone when the proof script is retracted. For better readability, we will in what |
44 |
follows drop the \isacommand{ML} \isa{\isacharverbatimopen \ldots \isacharverbatimclose} |
|
45 |
whenever we show code and its response. |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
46 |
|
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
47 |
Once a portion of code is relatively stable, one usually wants to |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
48 |
export it to a separate ML-file. Such files can then be included in a |
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
49 |
theory by using \isacommand{uses} in the header of the theory, like |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
50 |
|
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
51 |
\begin{center} |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
52 |
\begin{tabular}{@ {}l} |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
53 |
\isacommand{theory} FirstSteps\\ |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
54 |
\isacommand{imports} Main\\ |
58 | 55 |
\isacommand{uses} @{text "\"file_to_be_included.ML\""} @{text "\<dots>"}\\ |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
56 |
\isacommand{begin}\\ |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
57 |
\ldots |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
58 |
\end{tabular} |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
59 |
\end{center} |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
60 |
|
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
61 |
*} |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
62 |
|
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
63 |
section {* Debugging and Printing *} |
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
64 |
|
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
65 |
text {* |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
66 |
|
50 | 67 |
During development you might find it necessary to inspect some data |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
68 |
in your code. This can be done in a ``quick-and-dirty'' fashion using |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
69 |
the function @{ML "warning"}. For example |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
70 |
|
58 | 71 |
@{ML_response_fake [display] "warning \"any string\"" "\"any string\""} |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
72 |
|
58 | 73 |
will print out @{text [quotes] "any string"} inside the response buffer |
74 |
of Isabelle. This function expects a string as argument. If you develop under PolyML, |
|
50 | 75 |
then there is a convenient, though again ``quick-and-dirty'', method for |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
76 |
converting values into strings, namely @{ML makestring}: |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
77 |
|
60
5b9c6010897b
doem tuning and made the cookbook work again with recent changes (CookBook/Package/Ind_Interface.thy needs to be looked at to see what the problem with the new parser type is)
Christian Urban <urbanc@in.tum.de>
parents:
58
diff
changeset
|
78 |
@{ML_response_fake [display] "warning (makestring 1)" "\"1\""} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
79 |
|
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
80 |
However @{ML makestring} only works if the type of what is converted is monomorphic |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
81 |
and is not a function. |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
82 |
|
52 | 83 |
The function @{ML "warning"} should only be used for testing purposes, because any |
84 |
output this function generates will be overwritten as soon as an error is |
|
50 | 85 |
raised. For printing anything more serious and elaborate, the |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
86 |
function @{ML tracing} is more appropriate. This function writes all output into |
49 | 87 |
a separate tracing buffer. For example |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
88 |
|
58 | 89 |
@{ML_response_fake [display] "tracing \"foo\"" "\"foo\""} |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
90 |
|
58 | 91 |
It is also possible to redirect the ``channel'' where the string @{text "foo"} is |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
92 |
printed to a separate file, e.g. to prevent ProofGeneral from choking on massive |
52 | 93 |
amounts of trace output. This redirection can be achieved using the code |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
94 |
*} |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
95 |
|
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
96 |
ML{* |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
97 |
val strip_specials = |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
98 |
let |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
99 |
fun strip ("\^A" :: _ :: cs) = strip cs |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
100 |
| strip (c :: cs) = c :: strip cs |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
101 |
| strip [] = []; |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
102 |
in implode o strip o explode end; |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
103 |
|
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
104 |
fun redirect_tracing stream = |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
105 |
Output.tracing_fn := (fn s => |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
106 |
(TextIO.output (stream, (strip_specials s)); |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
107 |
TextIO.output (stream, "\n"); |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
108 |
TextIO.flushOut stream)); |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
109 |
*} |
14
1c17e99f6f66
added a paragraph about "uses" and started a paragraph about tracing
Christian Urban <urbanc@in.tum.de>
parents:
13
diff
changeset
|
110 |
|
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
111 |
text {* |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
112 |
|
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
113 |
Calling @{ML "redirect_tracing"} with @{ML "(TextIO.openOut \"foo.bar\")"} |
58 | 114 |
will cause that all tracing information is printed into the file @{text "foo.bar"}. |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
115 |
|
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
116 |
*} |
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
117 |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
118 |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
119 |
section {* Antiquotations *} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
120 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
121 |
text {* |
49 | 122 |
The main advantage of embedding all code in a theory is that the code can |
58 | 123 |
contain references to entities defined on the logical level of Isabelle. By |
124 |
this we mean definitions, theorems, terms and so on. This kind of reference is |
|
125 |
realised with antiquotations. For example, one can print out the name of the current |
|
49 | 126 |
theory by typing |
127 |
||
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
128 |
|
58 | 129 |
@{ML_response [display] "Context.theory_name @{theory}" "\"FirstSteps\""} |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
130 |
|
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
131 |
where @{text "@{theory}"} is an antiquotation that is substituted with the |
49 | 132 |
current theory (remember that we assumed we are inside the theory |
58 | 133 |
@{text FirstSteps}). The name of this theory can be extracted with |
49 | 134 |
the function @{ML "Context.theory_name"}. |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
135 |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
136 |
Note, however, that antiquotations are statically scoped, that is the value is |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
137 |
determined at ``compile-time'', not ``run-time''. For example the function |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
138 |
*} |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
139 |
|
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
140 |
ML {* |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
141 |
fun not_current_thyname () = Context.theory_name @{theory} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
142 |
*} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
143 |
|
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
144 |
text {* |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
145 |
|
58 | 146 |
does, as its name suggest, \emph{not} return the name of the current theory, if it is run in a |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
147 |
different theory. Instead, the code above defines the constant function |
58 | 148 |
that always returns the string @{text [quotes] "FirstSteps"}, no matter where the |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
149 |
function is called. Operationally speaking, the antiquotation @{text "@{theory}"} is |
5
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
150 |
\emph{not} replaced with code that will look up the current theory in |
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
151 |
some data structure and return it. Instead, it is literally |
e91f54791e14
minor modifiations to the Intro and FirstSteps chapters
Christian Urban <urbanc@in.tum.de>
parents:
2
diff
changeset
|
152 |
replaced with the value representing the theory name. |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
153 |
|
21
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
154 |
In a similar way you can use antiquotations to refer to theorems or simpsets: |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
155 |
|
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
156 |
@{ML_response_fake [display] "@{thm allI}" "(\<And>x. ?P x) \<Longrightarrow> \<forall>x. ?P x"} |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
157 |
@{ML_response_fake [display] "@{simpset}" "\<dots>"} |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
158 |
|
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
159 |
(FIXME: what does a simpset look like? It seems to be the same problem |
60
5b9c6010897b
doem tuning and made the cookbook work again with recent changes (CookBook/Package/Ind_Interface.thy needs to be looked at to see what the problem with the new parser type is)
Christian Urban <urbanc@in.tum.de>
parents:
58
diff
changeset
|
160 |
as with tokens.) |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
161 |
|
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
162 |
While antiquotations have many applications, they were originally introduced to |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
163 |
avoid explicit bindings for theorems such as |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
164 |
*} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
165 |
|
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
166 |
ML {* |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
167 |
val allI = thm "allI" |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
168 |
*} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
169 |
|
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
170 |
text {* |
58 | 171 |
These bindings were difficult to maintain and also could accidentally |
172 |
be overwritten by the user. This usually broke definitional |
|
49 | 173 |
packages. Antiquotations solve this problem, since they are ``linked'' |
50 | 174 |
statically at compile-time. However, that also sometimes limits their |
58 | 175 |
usefulness. In the course of this introduction, we will learn more about |
49 | 176 |
these antiquotations: they greatly simplify Isabelle programming since one |
177 |
can directly access all kinds of logical elements from ML. |
|
178 |
||
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
179 |
*} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
180 |
|
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
181 |
section {* Terms and Types *} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
182 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
183 |
text {* |
49 | 184 |
One way to construct terms of Isabelle on the ML-level is by using the antiquotation |
185 |
\mbox{@{text "@{term \<dots>}"}}. For example |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
186 |
|
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
187 |
@{ML_response [display] "@{term \"(a::nat) + b = c\"}" |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
188 |
"Const (\"op =\", \<dots>) $ (Const (\"HOL.plus_class.plus\", \<dots>) $ \<dots> $ \<dots>) $ \<dots>"} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
189 |
|
50 | 190 |
This will show the term @{term "(a::nat) + b = c"}, but printed using the internal |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
191 |
representation of this term. This internal representation corresponds to the |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
192 |
datatype @{ML_type "term"}. |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
193 |
|
34 | 194 |
The internal representation of terms uses the usual de Bruijn index mechanism where bound |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
195 |
variables are represented by the constructor @{ML Bound}. The index in @{ML Bound} refers to |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
196 |
the number of Abstractions (@{ML Abs}) we have to skip until we hit the @{ML Abs} that |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
197 |
binds the corresponding variable. However, in Isabelle the names of bound variables are |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
198 |
kept at abstractions for printing purposes, and so should be treated only as comments. |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
199 |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
200 |
\begin{readmore} |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
201 |
Terms are described in detail in \isccite{sec:terms}. Their |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
202 |
definition and many useful operations can be found in @{ML_file "Pure/term.ML"}. |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
203 |
\end{readmore} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
204 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
205 |
Sometimes the internal representation of terms can be surprisingly different |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
206 |
from what you see at the user level, because the layers of |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
207 |
parsing/type-checking/pretty printing can be quite elaborate. |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
208 |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
209 |
\begin{exercise} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
210 |
Look at the internal term representation of the following terms, and |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
211 |
find out why they are represented like this. |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
212 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
213 |
\begin{itemize} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
214 |
\item @{term "case x of 0 \<Rightarrow> 0 | Suc y \<Rightarrow> y"} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
215 |
\item @{term "\<lambda>(x,y). P y x"} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
216 |
\item @{term "{ [x::int] | x. x \<le> -2 }"} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
217 |
\end{itemize} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
218 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
219 |
Hint: The third term is already quite big, and the pretty printer |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
220 |
may omit parts of it by default. If you want to see all of it, you |
52 | 221 |
can use the following ML function to set the limit to a value high |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
222 |
enough: |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
223 |
\end{exercise} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
224 |
|
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
225 |
@{ML [display] "print_depth 50"} |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
226 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
227 |
The antiquotation @{text "@{prop \<dots>}"} constructs terms of propositional type, |
50 | 228 |
inserting the invisible @{text "Trueprop"}-coercions whenever necessary. |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
229 |
Consider for example |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
230 |
|
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
231 |
@{ML_response [display] "(@{term \"P x\"}, @{prop \"P x\"})" "(Free (\"P\", \<dots>) $ Free (\"x\", \<dots>), |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
232 |
Const (\"Trueprop\", \<dots>) $ (Free (\"P\", \<dots>) $ Free (\"x\", \<dots>)))"} |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
233 |
|
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
234 |
which inserts the coercion in the second component and |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
235 |
|
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
236 |
@{ML_response [display] "(@{term \"P x \<Longrightarrow> Q x\"}, @{prop \"P x \<Longrightarrow> Q x\"})" |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
237 |
"(Const (\"==>\", \<dots>) $ \<dots> $ \<dots>, Const (\"==>\", \<dots>) $ \<dots> $ \<dots>)"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
238 |
|
50 | 239 |
which does not (since it is already constructed using the meta-implication). |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
240 |
|
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
241 |
Types can be constructed using the antiquotation @{text "@{typ \<dots>}"}. For example |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
242 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
243 |
@{ML_response_fake [display] "@{typ \"bool \<Rightarrow> nat\"}" "bool \<Rightarrow> nat"} |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
244 |
|
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
245 |
\begin{readmore} |
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
246 |
Types are described in detail in \isccite{sec:types}. Their |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
247 |
definition and many useful operations can also be found in @{ML_file "Pure/type.ML"}. |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
248 |
\end{readmore} |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
249 |
*} |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
250 |
|
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
251 |
|
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
252 |
section {* Constructing Terms and Types Manually *} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
253 |
|
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
254 |
text {* |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
255 |
|
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
256 |
While antiquotations are very convenient for constructing terms and types, |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
257 |
they can only construct fixed terms (remember they are ``linked'' at compile-time). |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
258 |
However, one often needs to construct terms |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
259 |
dynamically. For example, a function that returns the implication |
52 | 260 |
@{text "\<And>(x::\<tau>). P x \<Longrightarrow> Q x"} taking @{term P}, @{term Q} and the type @{term "\<tau>"} |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
261 |
as arguments can only be written as |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
262 |
*} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
263 |
|
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
264 |
ML {* |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
265 |
fun make_imp P Q tau = |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
266 |
let |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
267 |
val x = Free ("x",tau) |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
268 |
in Logic.all x (Logic.mk_implies (P $ x, Q $ x)) |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
269 |
end |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
270 |
*} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
271 |
|
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
272 |
text {* |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
273 |
|
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
274 |
The reason is that one cannot pass the arguments @{term P}, @{term Q} and |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
275 |
@{term "tau"} into an antiquotation. For example the following does \emph{not} work: |
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
276 |
*} |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
277 |
|
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
278 |
ML {* |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
279 |
fun make_wrong_imp P Q tau = @{prop "\<And>x. P x \<Longrightarrow> Q x"} |
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
280 |
*} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
281 |
|
43
02f76f1b6e7b
added positions to anti-quotations; removed old antiquotation_setup; tuned the text a bit
Christian Urban <urbanc@in.tum.de>
parents:
42
diff
changeset
|
282 |
text {* |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
283 |
To see this apply @{text "@{term S}"}, @{text "@{term T}"} and @{text "@{typ nat}"} |
65
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
284 |
to both functions: |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
285 |
|
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
286 |
@{ML_response [display] "make_imp @{term S} @{term T} @{typ nat}" |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
287 |
"Const \<dots> $ |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
288 |
Abs (\"x\", Type (\"nat\",[]), |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
289 |
Const \<dots> $ (Free (\"S\",\<dots>) $ \<dots>) $ |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
290 |
(Free (\"T\",\<dots>) $ \<dots>))"} |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
291 |
@{ML_response [display] "make_wrong_imp @{term S} @{term T} @{typ nat}" |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
292 |
"Const \<dots> $ |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
293 |
Abs (\"x\", \<dots>, |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
294 |
Const \<dots> $ (Const \<dots> $ (Free (\"P\",\<dots>) $ \<dots>)) $ |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
295 |
(Const \<dots> $ (Free (\"Q\",\<dots>) $ \<dots>)))"} |
c8e9a4f97916
tuned and added a section about creating keyword files
Christian Urban <urbanc@in.tum.de>
parents:
60
diff
changeset
|
296 |
|
66 | 297 |
As can be seen, in the first case the arguments are correctly used, while the |
298 |
second generates a term involving the @{term "P"} and @{text "Q"} from the |
|
299 |
antiquotation. |
|
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
300 |
|
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
301 |
One tricky point in constructing terms by hand is to obtain the |
50 | 302 |
fully qualified name for constants. For example the names for @{text "zero"} and |
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
303 |
@{text "+"} are more complex than one first expects, namely |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
304 |
|
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
305 |
\begin{center} |
58 | 306 |
@{text "HOL.zero_class.zero"} and @{text "HOL.plus_class.plus"}. |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
307 |
\end{center} |
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
308 |
|
58 | 309 |
The extra prefixes @{text zero_class} and @{text plus_class} are present because |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
310 |
these constants are defined within type classes; the prefix @{text "HOL"} indicates in |
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
311 |
which theory they are defined. Guessing such internal names can sometimes be quite hard. |
52 | 312 |
Therefore Isabelle provides the antiquotation @{text "@{const_name \<dots>}"} which does the |
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
313 |
expansion automatically, for example: |
49 | 314 |
|
315 |
@{ML_response_fake [display] "@{const_name \"Nil\"}" "List.list.Nil"} |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
316 |
|
19
34b93dbf8c3c
some tuning in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
15
diff
changeset
|
317 |
(FIXME: Is it useful to explain @{text "@{const_syntax}"}?) |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
318 |
|
50 | 319 |
Similarly, types can be constructed manually, for example as follows: |
49 | 320 |
|
321 |
*} |
|
322 |
||
323 |
ML {* |
|
324 |
fun make_fun_type tau1 tau2 = Type ("fun",[tau1,tau2]) |
|
325 |
*} |
|
326 |
||
327 |
text {* |
|
328 |
which can be equally written as |
|
329 |
*} |
|
330 |
||
331 |
ML {* |
|
332 |
fun make_fun_type tau1 tau2 = tau1 --> tau2 |
|
333 |
*} |
|
334 |
||
335 |
text {* |
|
20 | 336 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
337 |
\begin{readmore} |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
338 |
There are many functions in @{ML_file "Pure/logic.ML"} and |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
339 |
@{ML_file "HOL/hologic.ML"} that make such manual constructions of terms |
49 | 340 |
and types easier.\end{readmore} |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
341 |
|
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
342 |
Have a look at these files and try to solve the following two exercises: |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
343 |
|
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
344 |
*} |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
345 |
|
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
346 |
text {* |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
347 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
348 |
\begin{exercise}\label{fun:revsum} |
58 | 349 |
Write a function @{text "rev_sum : term -> term"} that takes a |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
350 |
term of the form @{text "t\<^isub>1 + t\<^isub>2 + \<dots> + t\<^isub>n"} (whereby @{text "i"} might be zero) |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
351 |
and returns the reversed sum @{text "t\<^isub>n + \<dots> + t\<^isub>2 + t\<^isub>1"}. Assume |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
352 |
the @{text "t\<^isub>i"} can be arbitrary expressions and also note that @{text "+"} |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
353 |
associates to the left. Try your function on some examples. |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
354 |
\end{exercise} |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
355 |
|
15
9da9ba2b095b
added a solution section and some other minor additions
Christian Urban <urbanc@in.tum.de>
parents:
14
diff
changeset
|
356 |
\begin{exercise}\label{fun:makesum} |
11
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
357 |
Write a function which takes two terms representing natural numbers |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
358 |
in unary (like @{term "Suc (Suc (Suc 0))"}), and produce the unary |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
359 |
number representing their sum. |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
360 |
\end{exercise} |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
361 |
|
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
362 |
*} |
733614e236a3
tuned and updated antquote_setup.ML
Christian Urban <urbanc@in.tum.de>
parents:
10
diff
changeset
|
363 |
|
49 | 364 |
section {* Type-Checking *} |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
365 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
366 |
text {* |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
367 |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
368 |
We can freely construct and manipulate terms, since they are just |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
369 |
arbitrary unchecked trees. However, we eventually want to see if a |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
370 |
term is well-formed, or type-checks, relative to a theory. |
50 | 371 |
Type-checking is done via the function @{ML cterm_of}, which converts |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
372 |
a @{ML_type term} into a @{ML_type cterm}, a \emph{certified} term. |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
373 |
Unlike @{ML_type term}s, which are just trees, @{ML_type |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
374 |
"cterm"}s are abstract objects that are guaranteed to be |
50 | 375 |
type-correct, and that can only be constructed via the ``official |
376 |
interfaces''. |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
377 |
|
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
378 |
Type-checking is always relative to a theory context. For now we use |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
379 |
the @{ML "@{theory}"} antiquotation to get hold of the current theory. |
47
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
380 |
For example we can write |
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
381 |
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
382 |
@{ML_response_fake [display] "cterm_of @{theory} @{term \"a + b = c\"}" "a + b = c"} |
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
383 |
|
4daf913fdbe1
hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents:
43
diff
changeset
|
384 |
or use the antiquotation |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
385 |
|
41
b11653b11bd3
further progress on the parsing section and tuning on the antiqu's
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
386 |
@{ML_response_fake [display] "@{cterm \"(a::nat) + b = c\"}" "a + b = c"} |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
387 |
|
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
388 |
Attempting |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
389 |
|
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
390 |
@{ML_response_fake_both [display] "@{cterm \"1 + True\"}" "Type unification failed \<dots>"} |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
391 |
|
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
392 |
yields an error. A slightly more elaborate example is |
20 | 393 |
|
41
b11653b11bd3
further progress on the parsing section and tuning on the antiqu's
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
394 |
@{ML_response_fake [display] |
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
395 |
"let |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
396 |
val natT = @{typ \"nat\"} |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
397 |
val zero = @{term \"0::nat\"} |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
398 |
in |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
399 |
cterm_of @{theory} |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
400 |
(Const (@{const_name plus}, natT --> natT --> natT) |
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
401 |
$ zero $ zero) |
41
b11653b11bd3
further progress on the parsing section and tuning on the antiqu's
Christian Urban <urbanc@in.tum.de>
parents:
40
diff
changeset
|
402 |
end" "0 + 0"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
403 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
404 |
\begin{exercise} |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
405 |
Check that the function defined in Exercise~\ref{fun:revsum} returns a |
50 | 406 |
result that type-checks. |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
407 |
\end{exercise} |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
408 |
|
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
409 |
*} |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
410 |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
411 |
section {* Theorems *} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
412 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
413 |
text {* |
50 | 414 |
Just like @{ML_type cterm}s, theorems are abstract objects of type @{ML_type thm} |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
415 |
that can only be built by going through interfaces. In effect all proofs |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
416 |
are checked. |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
417 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
418 |
To see theorems in ``action'', let us give a proof for the following statement |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
419 |
*} |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
420 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
421 |
lemma |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
422 |
assumes assm\<^isub>1: "\<And>(x::nat). P x \<Longrightarrow> Q x" |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
423 |
and assm\<^isub>2: "P t" |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
424 |
shows "Q t" (*<*)oops(*>*) |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
425 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
426 |
text {* |
49 | 427 |
on the ML-level:\footnote{Note that @{text "|>"} is reverse |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
428 |
application. This combinator, and several variants are defined in |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
429 |
@{ML_file "Pure/General/basics.ML"}.} |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
430 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
431 |
@{ML_response_fake [display] |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
432 |
"let |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
433 |
val thy = @{theory} |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
434 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
435 |
val assm1 = cterm_of thy @{prop \"\<And>(x::nat). P x \<Longrightarrow> Q x\"} |
49 | 436 |
val assm2 = cterm_of thy @{prop \"(P::nat\<Rightarrow>bool) t\"} |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
437 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
438 |
val Pt_implies_Qt = |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
439 |
assume assm1 |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
440 |
|> forall_elim (cterm_of thy @{term \"t::nat\"}); |
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
441 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
442 |
val Qt = implies_elim Pt_implies_Qt (assume assm2); |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
443 |
in |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
444 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
445 |
Qt |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
446 |
|> implies_intr assm2 |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
447 |
|> implies_intr assm1 |
48
609f9ef73494
fixed FIXME's in fake responses
Christian Urban <urbanc@in.tum.de>
parents:
47
diff
changeset
|
448 |
end" "\<lbrakk>\<And>x. P x \<Longrightarrow> Q x; P t\<rbrakk> \<Longrightarrow> Q t"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
449 |
|
21
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
450 |
This code-snippet constructs the following proof: |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
451 |
|
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
452 |
\[ |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
453 |
\infer[(@{text "\<Longrightarrow>"}$-$intro)]{\vdash @{prop "(\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> P t \<Longrightarrow> Q t"}} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
454 |
{\infer[(@{text "\<Longrightarrow>"}$-$intro)]{@{prop "\<And>x. P x \<Longrightarrow> Q x"} \vdash @{prop "P t \<Longrightarrow> Q t"}} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
455 |
{\infer[(@{text "\<Longrightarrow>"}$-$elim)]{@{prop "\<And>x. P x \<Longrightarrow> Q x"}, @{prop "P t"} \vdash @{prop "Q t"}} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
456 |
{\infer[(@{text "\<And>"}$-$elim)]{@{prop "\<And>x. P x \<Longrightarrow> Q x"} \vdash @{prop "P t \<Longrightarrow> Q t"}} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
457 |
{\infer[(assume)]{@{prop "\<And>x. P x \<Longrightarrow> Q x"} \vdash @{prop "\<And>x. P x \<Longrightarrow> Q x"}}{}} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
458 |
& |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
459 |
\infer[(assume)]{@{prop "P t"} \vdash @{prop "P t"}}{} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
460 |
} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
461 |
} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
462 |
} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
463 |
\] |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
464 |
|
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
465 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
466 |
\begin{readmore} |
50 | 467 |
For the functions @{text "assume"}, @{text "forall_elim"} etc |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
468 |
see \isccite{sec:thms}. The basic functions for theorems are defined in |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
469 |
@{ML_file "Pure/thm.ML"}. |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
470 |
\end{readmore} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
471 |
|
10
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
472 |
*} |
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
473 |
|
df09e49b19bf
many changes in the FirstSteps section
Christian Urban <urbanc@in.tum.de>
parents:
6
diff
changeset
|
474 |
|
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
475 |
section {* Tactical Reasoning *} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
476 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
477 |
text {* |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
478 |
The goal-oriented tactical style reasoning of the ML level is similar |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
479 |
to the @{text apply}-style at the user level, i.e.~the reasoning is centred |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
480 |
around a \emph{goal}, which is modified in a sequence of proof steps |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
481 |
until it is solved. |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
482 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
483 |
A goal (or goal state) is a special @{ML_type thm}, which by |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
484 |
convention is an implication of the form: |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
485 |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
486 |
@{text[display] "A\<^isub>1 \<Longrightarrow> \<dots> \<Longrightarrow> A\<^isub>n \<Longrightarrow> #(C)"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
487 |
|
49 | 488 |
where @{term C} is the goal to be proved and the @{term "A\<^isub>i"} are the open |
489 |
subgoals. |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
490 |
Since the goal @{term C} can potentially be an implication, there is a |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
491 |
@{text "#"} wrapped around it, which prevents that premises are |
50 | 492 |
misinterpreted as open subgoals. The wrapper @{text "# :: prop \<Rightarrow> |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
493 |
prop"} is just the identity function and used as a syntactic marker. |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
494 |
|
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
495 |
\begin{readmore} |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
496 |
For more on goals see \isccite{sec:tactical-goals}. (FIXME: in which |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
497 |
file is most code for dealing with goals?) |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
498 |
\end{readmore} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
499 |
|
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
500 |
Tactics are functions that map a goal state to a (lazy) |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
501 |
sequence of successor states, hence the type of a tactic is |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
502 |
@{ML_type[display] "thm -> thm Seq.seq"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
503 |
|
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
504 |
\begin{readmore} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
505 |
See @{ML_file "Pure/General/seq.ML"} for the implementation of lazy |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
506 |
sequences. However in day-to-day Isabelle programming, one rarely |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
507 |
constructs sequences explicitly, but uses the predefined tactic |
50 | 508 |
combinators (tacticals) instead. See @{ML_file "Pure/tctical.ML"} |
509 |
for the code; see Chapters 3 and 4 in the old Isabelle Reference Manual. |
|
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
510 |
\end{readmore} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
511 |
|
34 | 512 |
While tactics can operate on the subgoals (the @{text "A\<^isub>i"} above), they |
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
513 |
are expected to leave the conclusion @{term C} intact, with the |
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
514 |
exception of possibly instantiating schematic variables. |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
515 |
|
13
2b07da8b310d
polished and added a subdirectory for the recipes
Christian Urban <urbanc@in.tum.de>
parents:
12
diff
changeset
|
516 |
To see how tactics work, let us transcribe a simple @{text apply}-style |
50 | 517 |
proof into ML: |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
518 |
*} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
519 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
520 |
lemma disj_swap: "P \<or> Q \<Longrightarrow> Q \<or> P" |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
521 |
apply (erule disjE) |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
522 |
apply (rule disjI2) |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
523 |
apply assumption |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
524 |
apply (rule disjI1) |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
525 |
apply assumption |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
526 |
done |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
527 |
|
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
528 |
text {* |
21
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
529 |
To start the proof, the function @{ML "Goal.prove"}~@{text "ctxt xs As C tac"} sets |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
530 |
up a goal state for proving the goal @{text C} under the assumptions @{text As} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
531 |
(empty in the proof at hand) |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
532 |
with the variables @{text xs} that will be generalised once the |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
533 |
goal is proved. The @{text "tac"} is the tactic which proves the goal and which |
50 | 534 |
can make use of the local assumptions (there are none in this example). |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
535 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
536 |
@{ML_response_fake [display] |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
537 |
"let |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
538 |
val ctxt = @{context} |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
539 |
val goal = @{prop \"P \<or> Q \<Longrightarrow> Q \<or> P\"} |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
540 |
in |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
541 |
Goal.prove ctxt [\"P\", \"Q\"] [] goal (fn _ => |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
542 |
eresolve_tac [disjE] 1 |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
543 |
THEN resolve_tac [disjI2] 1 |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
544 |
THEN assume_tac 1 |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
545 |
THEN resolve_tac [disjI1] 1 |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
546 |
THEN assume_tac 1) |
48
609f9ef73494
fixed FIXME's in fake responses
Christian Urban <urbanc@in.tum.de>
parents:
47
diff
changeset
|
547 |
end" "?P \<or> ?Q \<Longrightarrow> ?Q \<or> ?P"} |
21
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
548 |
|
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
549 |
\begin{readmore} |
54
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
550 |
To learn more about the function @{ML Goal.prove} see \isccite{sec:results} and |
1783211b3494
tuned; added document antiquotation ML_response_fake_both
Christian Urban <urbanc@in.tum.de>
parents:
52
diff
changeset
|
551 |
the file @{ML_file "Pure/goal.ML"}. |
21
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
552 |
\end{readmore} |
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
553 |
|
2356e5c70d98
added a proof and tuned the rest
Christian Urban <urbanc@in.tum.de>
parents:
20
diff
changeset
|
554 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
555 |
An alternative way to transcribe this proof is as follows |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
556 |
|
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
557 |
@{ML_response_fake [display] |
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
558 |
"let |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
559 |
val ctxt = @{context} |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
560 |
val goal = @{prop \"P \<or> Q \<Longrightarrow> Q \<or> P\"} |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
561 |
in |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
562 |
Goal.prove ctxt [\"P\", \"Q\"] [] goal (fn _ => |
12
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
563 |
(eresolve_tac [disjE] |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
564 |
THEN' resolve_tac [disjI2] |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
565 |
THEN' assume_tac |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
566 |
THEN' resolve_tac [disjI1] |
2f1736cb8f26
various changes by Alex and Christian
Christian Urban <urbanc@in.tum.de>
parents:
11
diff
changeset
|
567 |
THEN' assume_tac) 1) |
48
609f9ef73494
fixed FIXME's in fake responses
Christian Urban <urbanc@in.tum.de>
parents:
47
diff
changeset
|
568 |
end" "?P \<or> ?Q \<Longrightarrow> ?Q \<or> ?P"} |
42
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
569 |
|
cd612b489504
tuned mostly antiquotation and text
Christian Urban <urbanc@in.tum.de>
parents:
41
diff
changeset
|
570 |
(FIXME: are there any advantages/disadvantages about this way?) |
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
571 |
*} |
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
572 |
|
20 | 573 |
section {* Storing Theorems *} |
574 |
||
575 |
section {* Theorem Attributes *} |
|
576 |
||
39
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
577 |
|
631d12c25bde
substantial changes to the antiquotations (preliminary version)
Christian Urban <urbanc@in.tum.de>
parents:
34
diff
changeset
|
578 |
|
2
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
579 |
|
978a3c2ed7ce
split the document into smaller pieces;
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
580 |
end |