Prove.thy
author Christian Urban <urbanc@in.tum.de>
Mon, 28 Sep 2009 19:24:55 +0200
changeset 47 6a51704204e5
parent 46 e801b929216b
child 48 5d32a81cfe49
permissions -rw-r--r--
consistent state
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Prove
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports Main
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
ML {*
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
val r = ref (NONE:(unit -> term) option)
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
*}
46
e801b929216b some tuning of my code
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
     8
6
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
ML {*
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
let
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
   fun setup_proof (txt, pos) lthy =
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
   let
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
     val trm = ML_Context.evaluate lthy true ("r", r) txt
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
   in
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
       Proof.theorem_i NONE (K I) [[(trm,[])]] lthy
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
   end;
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
   val setup_proof_parser = OuterParse.ML_source >> setup_proof
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
        
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
   val kind = OuterKeyword.thy_goal
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
in
46
e801b929216b some tuning of my code
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
    22
  OuterSyntax.local_theory_to_proof "prove" "proving a proposition" 
6
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
    kind setup_proof_parser
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
end
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
*}
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
46
e801b929216b some tuning of my code
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
    27
e801b929216b some tuning of my code
Christian Urban <urbanc@in.tum.de>
parents: 6
diff changeset
    28
6
6a1b4c22a386 added the prove command
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
end