src/HOL/Extraction.thy
author haftmann
Sat, 08 Sep 2018 08:09:07 +0000
changeset 68940 25b431feb2e9
parent 62922 96691631c1eb
child 69593 3dda49e08b9d
permissions -rw-r--r--
more appropriate conversion of HOL character literals to character codes: symbolic newline is interpreted as 0x10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
     1
(*  Title:      HOL/Extraction.thy
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
     2
    Author:     Stefan Berghofer, TU Muenchen
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
     3
*)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
     4
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
     5
section \<open>Program extraction for HOL\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
     6
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14981
diff changeset
     7
theory Extraction
58112
8081087096ad renamed modules defining old datatypes, as a step towards having 'datatype_new' take 'datatype's place
blanchet
parents: 55642
diff changeset
     8
imports Option
15131
c69542757a4d New theory header syntax.
nipkow
parents: 14981
diff changeset
     9
begin
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    10
48891
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 37233
diff changeset
    11
ML_file "Tools/rewrite_hol_proof.ML"
c0eafbd55de3 prefer ML_file over old uses;
wenzelm
parents: 37233
diff changeset
    12
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
    13
subsection \<open>Setup\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    14
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
    15
setup \<open>
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18511
diff changeset
    16
  Extraction.add_types
29930
80a9a55b0a0e Adapted to encoding of sets as predicates.
berghofe
parents: 28797
diff changeset
    17
      [("bool", ([], NONE))] #>
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18511
diff changeset
    18
  Extraction.set_preprocessor (fn thy =>
62922
96691631c1eb clarified context;
wenzelm
parents: 60758
diff changeset
    19
    let val ctxt = Proof_Context.init_global thy in
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    20
      Proofterm.rewrite_proof_notypes
28797
9dcd32ee5dbe rewrite_proof: simplified simprocs (no name required);
wenzelm
parents: 27982
diff changeset
    21
        ([], RewriteHOLProof.elim_cong :: ProofRewriteRules.rprocs true) o
17203
29b2563f5c11 refer to theory instead of low-level tsig;
wenzelm
parents: 16417
diff changeset
    22
      Proofterm.rewrite_proof thy
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
    23
        (RewriteHOLProof.rews,
62922
96691631c1eb clarified context;
wenzelm
parents: 60758
diff changeset
    24
         ProofRewriteRules.rprocs true @ [ProofRewriteRules.expand_of_class ctxt]) o
96691631c1eb clarified context;
wenzelm
parents: 60758
diff changeset
    25
      ProofRewriteRules.elim_vars (curry Const @{const_name default})
96691631c1eb clarified context;
wenzelm
parents: 60758
diff changeset
    26
    end)
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
    27
\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    28
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    29
lemmas [extraction_expand] =
22281
23e0fde84cb7 Added meta_spec to extraction_expand.
berghofe
parents: 20941
diff changeset
    30
  meta_spec atomize_eq atomize_all atomize_imp atomize_conj
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    31
  allE rev_mp conjE Eq_TrueI Eq_FalseI eqTrueI eqTrueE eq_cong2
20941
beedcae49096 added eq_True eq_False True_implies_equals to extraction_expand
haftmann
parents: 18708
diff changeset
    32
  notE' impE' impE iffE imp_cong simp_thms eq_True eq_False
18456
8cc35e95450a updated auxiliary facts for induct method;
wenzelm
parents: 17203
diff changeset
    33
  induct_forall_eq induct_implies_eq induct_equal_eq induct_conj_eq
34913
d8cb720c9c53 Expand proofs of induct_atomize'/rulify'.
berghofe
parents: 33723
diff changeset
    34
  induct_atomize induct_atomize' induct_rulify induct_rulify'
d8cb720c9c53 Expand proofs of induct_atomize'/rulify'.
berghofe
parents: 33723
diff changeset
    35
  induct_rulify_fallback induct_trueI
60070
73c6e58a105c prepared for more meta-simp rules (by Stefan Berghofer)
nipkow
parents: 59940
diff changeset
    36
  True_implies_equals implies_True_equals TrueE
60169
5ef8ed685965 swap False to the right in assumptions to be eliminated at the right end
nipkow
parents: 60151
diff changeset
    37
  False_implies_equals implies_False_swap
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    38
33704
6aeb8454efc1 add_expand_thm: explicit indication of is_def instead of fragile heuristic, tuned signature;
wenzelm
parents: 30235
diff changeset
    39
lemmas [extraction_expand_def] =
59940
087d81f5213e local setup of induction tools, with restricted access to auxiliary consts;
wenzelm
parents: 58889
diff changeset
    40
  HOL.induct_forall_def HOL.induct_implies_def HOL.induct_equal_def HOL.induct_conj_def
087d81f5213e local setup of induction tools, with restricted access to auxiliary consts;
wenzelm
parents: 58889
diff changeset
    41
  HOL.induct_true_def HOL.induct_false_def
33704
6aeb8454efc1 add_expand_thm: explicit indication of is_def instead of fragile heuristic, tuned signature;
wenzelm
parents: 30235
diff changeset
    42
58350
919149921e46 added 'extraction' plugins -- this might help 'HOL-Proofs'
blanchet
parents: 58343
diff changeset
    43
datatype (plugins only: code extraction) sumbool = Left | Right
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    44
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
    45
subsection \<open>Type of extracted program\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    46
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    47
extract_type
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    48
  "typeof (Trueprop P) \<equiv> typeof P"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    49
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    50
  "typeof P \<equiv> Type (TYPE(Null)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    51
     typeof (P \<longrightarrow> Q) \<equiv> Type (TYPE('Q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    52
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    53
  "typeof Q \<equiv> Type (TYPE(Null)) \<Longrightarrow> typeof (P \<longrightarrow> Q) \<equiv> Type (TYPE(Null))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    54
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    55
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    56
     typeof (P \<longrightarrow> Q) \<equiv> Type (TYPE('P \<Rightarrow> 'Q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    57
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    58
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    59
     typeof (\<forall>x. P x) \<equiv> Type (TYPE(Null))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    60
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    61
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE('P))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    62
     typeof (\<forall>x::'a. P x) \<equiv> Type (TYPE('a \<Rightarrow> 'P))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    63
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    64
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    65
     typeof (\<exists>x::'a. P x) \<equiv> Type (TYPE('a))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    66
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    67
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE('P))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    68
     typeof (\<exists>x::'a. P x) \<equiv> Type (TYPE('a \<times> 'P))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    69
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    70
  "typeof P \<equiv> Type (TYPE(Null)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    71
     typeof (P \<or> Q) \<equiv> Type (TYPE(sumbool))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    72
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    73
  "typeof P \<equiv> Type (TYPE(Null)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    74
     typeof (P \<or> Q) \<equiv> Type (TYPE('Q option))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    75
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    76
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    77
     typeof (P \<or> Q) \<equiv> Type (TYPE('P option))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    78
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    79
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    80
     typeof (P \<or> Q) \<equiv> Type (TYPE('P + 'Q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    81
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    82
  "typeof P \<equiv> Type (TYPE(Null)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    83
     typeof (P \<and> Q) \<equiv> Type (TYPE('Q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    84
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    85
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    86
     typeof (P \<and> Q) \<equiv> Type (TYPE('P))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    87
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    88
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow> typeof Q \<equiv> Type (TYPE('Q)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    89
     typeof (P \<and> Q) \<equiv> Type (TYPE('P \<times> 'Q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    90
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    91
  "typeof (P = Q) \<equiv> typeof ((P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    92
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    93
  "typeof (x \<in> P) \<equiv> typeof P"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    94
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
    95
subsection \<open>Realizability\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    96
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    97
realizability
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    98
  "(realizes t (Trueprop P)) \<equiv> (Trueprop (realizes t P))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
    99
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   100
  "(typeof P) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   101
     (realizes t (P \<longrightarrow> Q)) \<equiv> (realizes Null P \<longrightarrow> realizes t Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   102
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   103
  "(typeof P) \<equiv> (Type (TYPE('P))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   104
   (typeof Q) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   105
     (realizes t (P \<longrightarrow> Q)) \<equiv> (\<forall>x::'P. realizes x P \<longrightarrow> realizes Null Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   106
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   107
  "(realizes t (P \<longrightarrow> Q)) \<equiv> (\<forall>x. realizes x P \<longrightarrow> realizes (t x) Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   108
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   109
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   110
     (realizes t (\<forall>x. P x)) \<equiv> (\<forall>x. realizes Null (P x))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   111
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   112
  "(realizes t (\<forall>x. P x)) \<equiv> (\<forall>x. realizes (t x) (P x))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   113
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   114
  "(\<lambda>x. typeof (P x)) \<equiv> (\<lambda>x. Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   115
     (realizes t (\<exists>x. P x)) \<equiv> (realizes Null (P t))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   116
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   117
  "(realizes t (\<exists>x. P x)) \<equiv> (realizes (snd t) (P (fst t)))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   118
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   119
  "(typeof P) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   120
   (typeof Q) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   121
     (realizes t (P \<or> Q)) \<equiv>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   122
     (case t of Left \<Rightarrow> realizes Null P | Right \<Rightarrow> realizes Null Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   123
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   124
  "(typeof P) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   125
     (realizes t (P \<or> Q)) \<equiv>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   126
     (case t of None \<Rightarrow> realizes Null P | Some q \<Rightarrow> realizes q Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   127
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   128
  "(typeof Q) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   129
     (realizes t (P \<or> Q)) \<equiv>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   130
     (case t of None \<Rightarrow> realizes Null Q | Some p \<Rightarrow> realizes p P)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   131
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   132
  "(realizes t (P \<or> Q)) \<equiv>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   133
   (case t of Inl p \<Rightarrow> realizes p P | Inr q \<Rightarrow> realizes q Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   134
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   135
  "(typeof P) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   136
     (realizes t (P \<and> Q)) \<equiv> (realizes Null P \<and> realizes t Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   137
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   138
  "(typeof Q) \<equiv> (Type (TYPE(Null))) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   139
     (realizes t (P \<and> Q)) \<equiv> (realizes t P \<and> realizes Null Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   140
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   141
  "(realizes t (P \<and> Q)) \<equiv> (realizes (fst t) P \<and> realizes (snd t) Q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   142
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   143
  "typeof P \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   144
     realizes t (\<not> P) \<equiv> \<not> realizes Null P"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   145
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   146
  "typeof P \<equiv> Type (TYPE('P)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   147
     realizes t (\<not> P) \<equiv> (\<forall>x::'P. \<not> realizes x P)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   148
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   149
  "typeof (P::bool) \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   150
   typeof Q \<equiv> Type (TYPE(Null)) \<Longrightarrow>
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   151
     realizes t (P = Q) \<equiv> realizes Null P = realizes Null Q"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   152
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   153
  "(realizes t (P = Q)) \<equiv> (realizes t ((P \<longrightarrow> Q) \<and> (Q \<longrightarrow> P)))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   154
60758
d8d85a8172b5 isabelle update_cartouches;
wenzelm
parents: 60169
diff changeset
   155
subsection \<open>Computational content of basic inference rules\<close>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   156
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   157
theorem disjE_realizer:
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   158
  assumes r: "case x of Inl p \<Rightarrow> P p | Inr q \<Rightarrow> Q q"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   159
  and r1: "\<And>p. P p \<Longrightarrow> R (f p)" and r2: "\<And>q. Q q \<Longrightarrow> R (g q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   160
  shows "R (case x of Inl p \<Rightarrow> f p | Inr q \<Rightarrow> g q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   161
proof (cases x)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   162
  case Inl
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   163
  with r show ?thesis by simp (rule r1)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   164
next
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   165
  case Inr
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   166
  with r show ?thesis by simp (rule r2)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   167
qed
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   168
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   169
theorem disjE_realizer2:
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   170
  assumes r: "case x of None \<Rightarrow> P | Some q \<Rightarrow> Q q"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   171
  and r1: "P \<Longrightarrow> R f" and r2: "\<And>q. Q q \<Longrightarrow> R (g q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   172
  shows "R (case x of None \<Rightarrow> f | Some q \<Rightarrow> g q)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   173
proof (cases x)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   174
  case None
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   175
  with r show ?thesis by simp (rule r1)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   176
next
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   177
  case Some
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   178
  with r show ?thesis by simp (rule r2)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   179
qed
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   180
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   181
theorem disjE_realizer3:
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   182
  assumes r: "case x of Left \<Rightarrow> P | Right \<Rightarrow> Q"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   183
  and r1: "P \<Longrightarrow> R f" and r2: "Q \<Longrightarrow> R g"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   184
  shows "R (case x of Left \<Rightarrow> f | Right \<Rightarrow> g)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   185
proof (cases x)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   186
  case Left
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   187
  with r show ?thesis by simp (rule r1)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   188
next
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   189
  case Right
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   190
  with r show ?thesis by simp (rule r2)
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   191
qed
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   192
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   193
theorem conjI_realizer:
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   194
  "P p \<Longrightarrow> Q q \<Longrightarrow> P (fst (p, q)) \<and> Q (snd (p, q))"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   195
  by simp
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   196
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   197
theorem exI_realizer:
13918
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   198
  "P y x \<Longrightarrow> P (snd (x, y)) (fst (x, y))" by simp
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   199
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   200
theorem exE_realizer: "P (snd p) (fst p) \<Longrightarrow>
15393
2e6a9146caca Realizer for exE now uses let instead of case.
berghofe
parents: 15140
diff changeset
   201
  (\<And>x y. P y x \<Longrightarrow> Q (f x y)) \<Longrightarrow> Q (let (x, y) = p in f x y)"
2e6a9146caca Realizer for exE now uses let instead of case.
berghofe
parents: 15140
diff changeset
   202
  by (cases p) (simp add: Let_def)
13918
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   203
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   204
theorem exE_realizer': "P (snd p) (fst p) \<Longrightarrow>
2134ed516b1b Tuned realizer for exE rule, to avoid blowup of extracted program.
berghofe
parents: 13725
diff changeset
   205
  (\<And>x y. P y x \<Longrightarrow> Q) \<Longrightarrow> Q" by (cases p) simp
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   206
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   207
realizers
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   208
  impI (P, Q): "\<lambda>pq. pq"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   209
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq (h: _). allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h \<cdot> x))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   210
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   211
  impI (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   212
    "\<^bold>\<lambda>(c: _) P Q (h: _). allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h \<cdot> x))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   213
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   214
  impI (Q): "\<lambda>q. q" "\<^bold>\<lambda>(c: _) P Q q. impI \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   215
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   216
  impI: "Null" "impI"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   217
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   218
  mp (P, Q): "\<lambda>pq. pq"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   219
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq (h: _) p. mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> p \<bullet> c \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   220
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   221
  mp (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   222
    "\<^bold>\<lambda>(c: _) P Q (h: _) p. mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> p \<bullet> c \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   223
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   224
  mp (Q): "\<lambda>q. q" "\<^bold>\<lambda>(c: _) P Q q. mp \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   225
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   226
  mp: "Null" "mp"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   227
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   228
  allI (P): "\<lambda>p. p" "\<^bold>\<lambda>(c: _) P (d: _) p. allI \<cdot> _ \<bullet> d"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   229
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   230
  allI: "Null" "allI"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   231
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   232
  spec (P): "\<lambda>x p. p x" "\<^bold>\<lambda>(c: _) P x (d: _) p. spec \<cdot> _ \<cdot> x \<bullet> d"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   233
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   234
  spec: "Null" "spec"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   235
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   236
  exI (P): "\<lambda>x p. (x, p)" "\<^bold>\<lambda>(c: _) P x (d: _) p. exI_realizer \<cdot> P \<cdot> p \<cdot> x \<bullet> c \<bullet> d"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   237
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   238
  exI: "\<lambda>x. x" "\<^bold>\<lambda>P x (c: _) (h: _). h"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   239
15393
2e6a9146caca Realizer for exE now uses let instead of case.
berghofe
parents: 15140
diff changeset
   240
  exE (P, Q): "\<lambda>p pq. let (x, y) = p in pq x y"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   241
    "\<^bold>\<lambda>(c: _) (d: _) P Q (e: _) p (h: _) pq. exE_realizer \<cdot> P \<cdot> p \<cdot> Q \<cdot> pq \<bullet> c \<bullet> e \<bullet> d \<bullet> h"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   242
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   243
  exE (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   244
    "\<^bold>\<lambda>(c: _) P Q (d: _) p. exE_realizer' \<cdot> _ \<cdot> _ \<cdot> _ \<bullet> c \<bullet> d"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   245
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   246
  exE (Q): "\<lambda>x pq. pq x"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   247
    "\<^bold>\<lambda>(c: _) P Q (d: _) x (h1: _) pq (h2: _). h2 \<cdot> x \<bullet> h1"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   248
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   249
  exE: "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   250
    "\<^bold>\<lambda>P Q (c: _) x (h1: _) (h2: _). h2 \<cdot> x \<bullet> h1"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   251
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   252
  conjI (P, Q): "Pair"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   253
    "\<^bold>\<lambda>(c: _) (d: _) P Q p (h: _) q. conjI_realizer \<cdot> P \<cdot> p \<cdot> Q \<cdot> q \<bullet> c \<bullet> d \<bullet> h"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   254
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   255
  conjI (P): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   256
    "\<^bold>\<lambda>(c: _) P Q p. conjI \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   257
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   258
  conjI (Q): "\<lambda>q. q"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   259
    "\<^bold>\<lambda>(c: _) P Q (h: _) q. conjI \<cdot> _ \<cdot> _ \<bullet> h"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   260
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   261
  conjI: "Null" "conjI"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   262
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   263
  conjunct1 (P, Q): "fst"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   264
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq. conjunct1 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   265
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   266
  conjunct1 (P): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   267
    "\<^bold>\<lambda>(c: _) P Q p. conjunct1 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   268
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   269
  conjunct1 (Q): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   270
    "\<^bold>\<lambda>(c: _) P Q q. conjunct1 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   271
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   272
  conjunct1: "Null" "conjunct1"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   273
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   274
  conjunct2 (P, Q): "snd"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   275
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq. conjunct2 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   276
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   277
  conjunct2 (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   278
    "\<^bold>\<lambda>(c: _) P Q p. conjunct2 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   279
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   280
  conjunct2 (Q): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   281
    "\<^bold>\<lambda>(c: _) P Q p. conjunct2 \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   282
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   283
  conjunct2: "Null" "conjunct2"
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   284
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   285
  disjI1 (P, Q): "Inl"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   286
    "\<^bold>\<lambda>(c: _) (d: _) P Q p. iffD2 \<cdot> _ \<cdot> _ \<bullet> (sum.case_1 \<cdot> P \<cdot> _ \<cdot> p \<bullet> arity_type_bool \<bullet> c \<bullet> d)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   287
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   288
  disjI1 (P): "Some"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   289
    "\<^bold>\<lambda>(c: _) P Q p. iffD2 \<cdot> _ \<cdot> _ \<bullet> (option.case_2 \<cdot> _ \<cdot> P \<cdot> p \<bullet> arity_type_bool \<bullet> c)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   290
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   291
  disjI1 (Q): "None"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   292
    "\<^bold>\<lambda>(c: _) P Q. iffD2 \<cdot> _ \<cdot> _ \<bullet> (option.case_1 \<cdot> _ \<cdot> _ \<bullet> arity_type_bool \<bullet> c)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   293
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   294
  disjI1: "Left"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   295
    "\<^bold>\<lambda>P Q. iffD2 \<cdot> _ \<cdot> _ \<bullet> (sumbool.case_1 \<cdot> _ \<cdot> _ \<bullet> arity_type_bool)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   296
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   297
  disjI2 (P, Q): "Inr"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   298
    "\<^bold>\<lambda>(d: _) (c: _) Q P q. iffD2 \<cdot> _ \<cdot> _ \<bullet> (sum.case_2 \<cdot> _ \<cdot> Q \<cdot> q \<bullet> arity_type_bool \<bullet> c \<bullet> d)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   299
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   300
  disjI2 (P): "None"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   301
    "\<^bold>\<lambda>(c: _) Q P. iffD2 \<cdot> _ \<cdot> _ \<bullet> (option.case_1 \<cdot> _ \<cdot> _ \<bullet> arity_type_bool \<bullet> c)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   302
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   303
  disjI2 (Q): "Some"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   304
    "\<^bold>\<lambda>(c: _) Q P q. iffD2 \<cdot> _ \<cdot> _ \<bullet> (option.case_2 \<cdot> _ \<cdot> Q \<cdot> q \<bullet> arity_type_bool \<bullet> c)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   305
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   306
  disjI2: "Right"
55642
63beb38e9258 adapted to renaming of datatype 'cases' and 'recs' to 'case' and 'rec'
blanchet
parents: 55404
diff changeset
   307
    "\<^bold>\<lambda>Q P. iffD2 \<cdot> _ \<cdot> _ \<bullet> (sumbool.case_2 \<cdot> _ \<cdot> _ \<bullet> arity_type_bool)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   308
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   309
  disjE (P, Q, R): "\<lambda>pq pr qr.
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   310
     (case pq of Inl p \<Rightarrow> pr p | Inr q \<Rightarrow> qr q)"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   311
    "\<^bold>\<lambda>(c: _) (d: _) (e: _) P Q R pq (h1: _) pr (h2: _) qr.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   312
       disjE_realizer \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> R \<cdot> pr \<cdot> qr \<bullet> c \<bullet> d \<bullet> e \<bullet> h1 \<bullet> h2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   313
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   314
  disjE (Q, R): "\<lambda>pq pr qr.
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   315
     (case pq of None \<Rightarrow> pr | Some q \<Rightarrow> qr q)"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   316
    "\<^bold>\<lambda>(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   317
       disjE_realizer2 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> R \<cdot> pr \<cdot> qr \<bullet> c \<bullet> d \<bullet> h1 \<bullet> h2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   318
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   319
  disjE (P, R): "\<lambda>pq pr qr.
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   320
     (case pq of None \<Rightarrow> qr | Some p \<Rightarrow> pr p)"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   321
    "\<^bold>\<lambda>(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr (h3: _).
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   322
       disjE_realizer2 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> R \<cdot> qr \<cdot> pr \<bullet> c \<bullet> d \<bullet> h1 \<bullet> h3 \<bullet> h2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   323
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   324
  disjE (R): "\<lambda>pq pr qr.
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   325
     (case pq of Left \<Rightarrow> pr | Right \<Rightarrow> qr)"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   326
    "\<^bold>\<lambda>(c: _) P Q R pq (h1: _) pr (h2: _) qr.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   327
       disjE_realizer3 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> R \<cdot> pr \<cdot> qr \<bullet> c \<bullet> h1 \<bullet> h2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   328
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   329
  disjE (P, Q): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   330
    "\<^bold>\<lambda>(c: _) (d: _) P Q R pq. disjE_realizer \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> (\<lambda>x. R) \<cdot> _ \<cdot> _ \<bullet> c \<bullet> d \<bullet> arity_type_bool"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   331
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   332
  disjE (Q): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   333
    "\<^bold>\<lambda>(c: _) P Q R pq. disjE_realizer2 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> (\<lambda>x. R) \<cdot> _ \<cdot> _ \<bullet> c \<bullet> arity_type_bool"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   334
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   335
  disjE (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   336
    "\<^bold>\<lambda>(c: _) P Q R pq (h1: _) (h2: _) (h3: _).
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   337
       disjE_realizer2 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> (\<lambda>x. R) \<cdot> _ \<cdot> _ \<bullet> c \<bullet> arity_type_bool \<bullet> h1 \<bullet> h3 \<bullet> h2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   338
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   339
  disjE: "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   340
    "\<^bold>\<lambda>P Q R pq. disjE_realizer3 \<cdot> _ \<cdot> _ \<cdot> pq \<cdot> (\<lambda>x. R) \<cdot> _ \<cdot> _ \<bullet> arity_type_bool"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   341
27982
2aaa4a5569a6 default replaces arbitrary
haftmann
parents: 25424
diff changeset
   342
  FalseE (P): "default"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   343
    "\<^bold>\<lambda>(c: _) P. FalseE \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   344
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   345
  FalseE: "Null" "FalseE"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   346
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   347
  notI (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   348
    "\<^bold>\<lambda>(c: _) P (h: _). allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. notI \<cdot> _ \<bullet> (h \<cdot> x))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   349
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   350
  notI: "Null" "notI"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   351
27982
2aaa4a5569a6 default replaces arbitrary
haftmann
parents: 25424
diff changeset
   352
  notE (P, R): "\<lambda>p. default"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   353
    "\<^bold>\<lambda>(c: _) (d: _) P R (h: _) p. notE \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> p \<bullet> c \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   354
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   355
  notE (P): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   356
    "\<^bold>\<lambda>(c: _) P R (h: _) p. notE \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> p \<bullet> c \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   357
27982
2aaa4a5569a6 default replaces arbitrary
haftmann
parents: 25424
diff changeset
   358
  notE (R): "default"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   359
    "\<^bold>\<lambda>(c: _) P R. notE \<cdot> _ \<cdot> _"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   360
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   361
  notE: "Null" "notE"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   362
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   363
  subst (P): "\<lambda>s t ps. ps"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   364
    "\<^bold>\<lambda>(c: _) s t P (d: _) (h: _) ps. subst \<cdot> s \<cdot> t \<cdot> P ps \<bullet> d \<bullet> h"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   365
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   366
  subst: "Null" "subst"
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   367
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   368
  iffD1 (P, Q): "fst"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   369
    "\<^bold>\<lambda>(d: _) (c: _) Q P pq (h: _) p.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   370
       mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> p \<bullet> d \<bullet> (conjunct1 \<cdot> _ \<cdot> _ \<bullet> h))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   371
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   372
  iffD1 (P): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   373
    "\<^bold>\<lambda>(c: _) Q P p (h: _). mp \<cdot> _ \<cdot> _ \<bullet> (conjunct1 \<cdot> _ \<cdot> _ \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   374
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   375
  iffD1 (Q): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   376
    "\<^bold>\<lambda>(c: _) Q P q1 (h: _) q2.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   377
       mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> q2 \<bullet> c \<bullet> (conjunct1 \<cdot> _ \<cdot> _ \<bullet> h))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   378
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   379
  iffD1: "Null" "iffD1"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   380
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   381
  iffD2 (P, Q): "snd"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   382
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq (h: _) q.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   383
       mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> q \<bullet> d \<bullet> (conjunct2 \<cdot> _ \<cdot> _ \<bullet> h))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   384
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   385
  iffD2 (P): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   386
    "\<^bold>\<lambda>(c: _) P Q p (h: _). mp \<cdot> _ \<cdot> _ \<bullet> (conjunct2 \<cdot> _ \<cdot> _ \<bullet> h)"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   387
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   388
  iffD2 (Q): "Null"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   389
    "\<^bold>\<lambda>(c: _) P Q q1 (h: _) q2.
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   390
       mp \<cdot> _ \<cdot> _ \<bullet> (spec \<cdot> _ \<cdot> q2 \<bullet> c \<bullet> (conjunct2 \<cdot> _ \<cdot> _ \<bullet> h))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   391
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   392
  iffD2: "Null" "iffD2"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   393
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   394
  iffI (P, Q): "Pair"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   395
    "\<^bold>\<lambda>(c: _) (d: _) P Q pq (h1 : _) qp (h2 : _). conjI_realizer \<cdot>
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   396
       (\<lambda>pq. \<forall>x. P x \<longrightarrow> Q (pq x)) \<cdot> pq \<cdot>
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   397
       (\<lambda>qp. \<forall>x. Q x \<longrightarrow> P (qp x)) \<cdot> qp \<bullet>
37233
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   398
       (arity_type_fun \<bullet> c \<bullet> d) \<bullet>
b78f31ca4675 Adapted to new format of proof terms containing explicit proofs of class membership.
berghofe
parents: 34913
diff changeset
   399
       (arity_type_fun \<bullet> d \<bullet> c) \<bullet>
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   400
       (allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h1 \<cdot> x))) \<bullet>
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   401
       (allI \<cdot> _ \<bullet> d \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h2 \<cdot> x)))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   402
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   403
  iffI (P): "\<lambda>p. p"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   404
    "\<^bold>\<lambda>(c: _) P Q (h1 : _) p (h2 : _). conjI \<cdot> _ \<cdot> _ \<bullet>
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   405
       (allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h1 \<cdot> x))) \<bullet>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   406
       (impI \<cdot> _ \<cdot> _ \<bullet> h2)"
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   407
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   408
  iffI (Q): "\<lambda>q. q"
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   409
    "\<^bold>\<lambda>(c: _) P Q q (h1 : _) (h2 : _). conjI \<cdot> _ \<cdot> _ \<bullet>
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   410
       (impI \<cdot> _ \<cdot> _ \<bullet> h1) \<bullet>
52486
b1565e37678b just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip;
wenzelm
parents: 48891
diff changeset
   411
       (allI \<cdot> _ \<bullet> c \<bullet> (\<^bold>\<lambda>x. impI \<cdot> _ \<cdot> _ \<bullet> (h2 \<cdot> x)))"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   412
13725
12404b452034 Changed format of realizers / correctness proofs.
berghofe
parents: 13599
diff changeset
   413
  iffI: "Null" "iffI"
13403
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   414
bc2b32ee62fd Added theory for setting up program extraction.
berghofe
parents:
diff changeset
   415
end