author | Norbert Schirmer <norbert.schirmer@web.de> |
Tue, 14 May 2019 13:39:31 +0200 | |
changeset 563 | 50d3059de9c6 |
parent 562 | daf404920ab9 |
child 564 | 6e2479089226 |
permissions | -rw-r--r-- |
23 | 1 |
theory Base |
459 | 2 |
imports Main |
3 |
"~~/src/HOL/Library/LaTeXsugar" |
|
23 | 4 |
begin |
5 |
||
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
6 |
ML \<open>@{assert} true\<close> |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
7 |
ML \<open>@{print} (2 + 3 +4)\<close> |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
8 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
9 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
10 |
print_ML_antiquotations |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
11 |
text \<open> |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
12 |
Can we put an ML-val into the text? |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
13 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
14 |
@{ML [display] \<open>2 + 3\<close>} |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
15 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
16 |
\<close> |
394 | 17 |
notation (latex output) |
18 |
Cons ("_ # _" [66,65] 65) |
|
19 |
||
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
20 |
ML %linenosgrayML{*fun P n = @{term "P::nat \<Rightarrow> bool"} $ (HOLogic.mk_number @{typ "nat"} n) |
396 | 21 |
|
22 |
fun rhs 1 = P 1 |
|
23 |
| rhs n = HOLogic.mk_conj (P n, rhs (n - 1)) |
|
24 |
||
25 |
fun lhs 1 n = HOLogic.mk_imp (HOLogic.mk_eq (P 1, P n), rhs n) |
|
26 |
| lhs m n = HOLogic.mk_conj (HOLogic.mk_imp |
|
27 |
(HOLogic.mk_eq (P (m - 1), P m), rhs n), lhs (m - 1) n) |
|
28 |
||
29 |
fun de_bruijn n = |
|
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
30 |
HOLogic.mk_Trueprop (HOLogic.mk_imp (lhs n n, rhs n))*} |
346
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
328
diff
changeset
|
31 |
|
538
e9fd5eff62c1
removed "use" for "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
535
diff
changeset
|
32 |
ML_file "output_tutorial.ML" |
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
33 |
text \<open> |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
34 |
Can we put an ML-val into the text? |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
35 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
36 |
@{ML [gray] \<open>2 + 3\<close>} |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
37 |
\<close> |
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
38 |
|
538
e9fd5eff62c1
removed "use" for "ML_file"
Christian Urban <urbanc@in.tum.de>
parents:
535
diff
changeset
|
39 |
ML_file "antiquote_setup.ML" |
346
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
328
diff
changeset
|
40 |
|
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
41 |
|
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
42 |
(*setup {* OutputTutorial.setup *}*) (* Seems to be standard now, we don't need this anymoe *) |
471 | 43 |
setup {* AntiquoteSetup.setup *} |
346
0fea8b7a14a1
tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents:
328
diff
changeset
|
44 |
|
562
daf404920ab9
Accomodate to Isabelle 2018
Norbert Schirmer <norbert.schirmer@web.de>
parents:
557
diff
changeset
|
45 |
|
239
b63c72776f03
replaced "warning" with "writeln"
Christian Urban <urbanc@in.tum.de>
parents:
224
diff
changeset
|
46 |
end |