ProgTutorial/Base.thy
author Christian Urban <urbanc@in.tum.de>
Wed, 20 Jun 2012 08:53:38 +0100
changeset 530 aabb4c93a6ed
parent 517 d8c376662bb4
child 535 5734ab5dd86d
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
1322990e4ee7 New theory for installing antiquotations.
berghofe
parents:
diff changeset
     1
theory Base
459
4532577b61e0 updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 441
diff changeset
     2
imports Main 
4532577b61e0 updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 441
diff changeset
     3
        "~~/src/HOL/Library/LaTeXsugar"
514
7e25716c3744 updated to outer syntax / parser changes
Christian Urban <urbanc@in.tum.de>
parents: 488
diff changeset
     4
keywords "ML" "setup" "local_setup" :: thy_decl and
7e25716c3744 updated to outer syntax / parser changes
Christian Urban <urbanc@in.tum.de>
parents: 488
diff changeset
     5
         "ML_prf" :: prf_decl and
7e25716c3744 updated to outer syntax / parser changes
Christian Urban <urbanc@in.tum.de>
parents: 488
diff changeset
     6
         "ML_val" :: diag
23
1322990e4ee7 New theory for installing antiquotations.
berghofe
parents:
diff changeset
     7
uses
346
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
     8
  ("output_tutorial.ML")
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
     9
  ("antiquote_setup.ML")
23
1322990e4ee7 New theory for installing antiquotations.
berghofe
parents:
diff changeset
    10
begin
1322990e4ee7 New theory for installing antiquotations.
berghofe
parents:
diff changeset
    11
394
0019ebf76e10 updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 346
diff changeset
    12
notation (latex output)
0019ebf76e10 updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 346
diff changeset
    13
  Cons ("_ # _" [66,65] 65)
0019ebf76e10 updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 346
diff changeset
    14
396
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    15
ML {*
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    16
fun P n = @{term "P::nat \<Rightarrow> bool"} $ (HOLogic.mk_number @{typ "nat"} n) 
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    17
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    18
fun rhs 1 = P 1
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    19
  | rhs n = HOLogic.mk_conj (P n, rhs (n - 1))
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    20
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    21
fun lhs 1 n = HOLogic.mk_imp (HOLogic.mk_eq (P 1, P n), rhs n)
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    22
  | lhs m n = HOLogic.mk_conj (HOLogic.mk_imp 
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    23
                 (HOLogic.mk_eq (P (m - 1), P m), rhs n), lhs (m - 1) n)
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    24
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    25
fun de_bruijn n =
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    26
  HOLogic.mk_Trueprop (HOLogic.mk_imp (lhs n n, rhs n))
Christian Urban <urbanc@in.tum.de>
parents: 394
diff changeset
    27
*}
346
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
    28
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
    29
use "output_tutorial.ML"
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
    30
use "antiquote_setup.ML"
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
    31
471
f65b9f14d5de updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 462
diff changeset
    32
setup {* OutputTutorial.setup *}
f65b9f14d5de updated to new Isabelle
Christian Urban <urbanc@in.tum.de>
parents: 462
diff changeset
    33
setup {* AntiquoteSetup.setup *}
346
0fea8b7a14a1 tuned the ML-output mechanism; tuned slightly the text
Christian Urban <urbanc@in.tum.de>
parents: 328
diff changeset
    34
239
b63c72776f03 replaced "warning" with "writeln"
Christian Urban <urbanc@in.tum.de>
parents: 224
diff changeset
    35
end