src/Sequents/LK0.thy
author wenzelm
Sun Sep 18 15:20:08 2005 +0200 (2005-09-18)
changeset 17481 75166ebb619b
parent 16019 0e1405402d53
child 21426 87ac12bed1ab
permissions -rw-r--r--
converted to Isar theory format;
wenzelm@17481
     1
(*  Title:      LK/LK0.thy
paulson@7093
     2
    ID:         $Id$
paulson@7093
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@7093
     4
    Copyright   1993  University of Cambridge
paulson@7093
     5
paulson@7093
     6
There may be printing problems if a seqent is in expanded normal form
wenzelm@17481
     7
        (eta-expanded, beta-contracted)
paulson@7093
     8
*)
paulson@7093
     9
wenzelm@17481
    10
header {* Classical First-Order Sequent Calculus *}
wenzelm@17481
    11
wenzelm@17481
    12
theory LK0
wenzelm@17481
    13
imports Sequents
wenzelm@17481
    14
begin
paulson@7093
    15
paulson@7093
    16
global
paulson@7093
    17
wenzelm@17481
    18
classes "term"
wenzelm@17481
    19
defaultsort "term"
paulson@7093
    20
paulson@7093
    21
consts
paulson@7093
    22
wenzelm@17481
    23
 Trueprop       :: "two_seqi"
paulson@7093
    24
wenzelm@17481
    25
  True         :: o
wenzelm@17481
    26
  False        :: o
wenzelm@17481
    27
  "="          :: "['a,'a] => o"     (infixl 50)
wenzelm@17481
    28
  Not          :: "o => o"           ("~ _" [40] 40)
wenzelm@17481
    29
  "&"          :: "[o,o] => o"       (infixr 35)
wenzelm@17481
    30
  "|"          :: "[o,o] => o"       (infixr 30)
wenzelm@17481
    31
  "-->"        :: "[o,o] => o"       (infixr 25)
wenzelm@17481
    32
  "<->"        :: "[o,o] => o"       (infixr 25)
wenzelm@17481
    33
  The          :: "('a => o) => 'a"  (binder "THE " 10)
wenzelm@17481
    34
  All          :: "('a => o) => o"   (binder "ALL " 10)
wenzelm@17481
    35
  Ex           :: "('a => o) => o"   (binder "EX " 10)
paulson@7093
    36
paulson@7093
    37
syntax
wenzelm@17481
    38
 "@Trueprop"    :: "two_seqe" ("((_)/ |- (_))" [6,6] 5)
wenzelm@17481
    39
  "_not_equal" :: "['a, 'a] => o"              (infixl "~=" 50)
wenzelm@17481
    40
wenzelm@17481
    41
parse_translation {* [("@Trueprop", two_seq_tr "Trueprop")] *}
wenzelm@17481
    42
print_translation {* [("Trueprop", two_seq_tr' "@Trueprop")] *}
paulson@7093
    43
paulson@7093
    44
translations
paulson@7093
    45
  "x ~= y"      == "~ (x = y)"
paulson@7093
    46
wenzelm@12116
    47
syntax (xsymbols)
wenzelm@17481
    48
  Not           :: "o => o"               ("\<not> _" [40] 40)
wenzelm@17481
    49
  "op &"        :: "[o, o] => o"          (infixr "\<and>" 35)
wenzelm@17481
    50
  "op |"        :: "[o, o] => o"          (infixr "\<or>" 30)
wenzelm@17481
    51
  "op -->"      :: "[o, o] => o"          (infixr "\<longrightarrow>" 25)
wenzelm@17481
    52
  "op <->"      :: "[o, o] => o"          (infixr "\<longleftrightarrow>" 25)
wenzelm@17481
    53
  "ALL "        :: "[idts, o] => o"       ("(3\<forall>_./ _)" [0, 10] 10)
wenzelm@17481
    54
  "EX "         :: "[idts, o] => o"       ("(3\<exists>_./ _)" [0, 10] 10)
wenzelm@17481
    55
  "EX! "        :: "[idts, o] => o"       ("(3\<exists>!_./ _)" [0, 10] 10)
wenzelm@17481
    56
  "_not_equal"  :: "['a, 'a] => o"        (infixl "\<noteq>" 50)
paulson@7093
    57
paulson@7093
    58
syntax (HTML output)
wenzelm@17481
    59
  Not           :: "o => o"               ("\<not> _" [40] 40)
wenzelm@17481
    60
  "op &"        :: "[o, o] => o"          (infixr "\<and>" 35)
wenzelm@17481
    61
  "op |"        :: "[o, o] => o"          (infixr "\<or>" 30)
wenzelm@17481
    62
  "ALL "        :: "[idts, o] => o"       ("(3\<forall>_./ _)" [0, 10] 10)
wenzelm@17481
    63
  "EX "         :: "[idts, o] => o"       ("(3\<exists>_./ _)" [0, 10] 10)
wenzelm@17481
    64
  "EX! "        :: "[idts, o] => o"       ("(3\<exists>!_./ _)" [0, 10] 10)
wenzelm@17481
    65
  "_not_equal"  :: "['a, 'a] => o"        (infixl "\<noteq>" 50)
paulson@7093
    66
paulson@7093
    67
local
wenzelm@17481
    68
wenzelm@17481
    69
axioms
paulson@7093
    70
paulson@7093
    71
  (*Structural rules: contraction, thinning, exchange [Soren Heilmann] *)
paulson@7093
    72
wenzelm@17481
    73
  contRS: "$H |- $E, $S, $S, $F ==> $H |- $E, $S, $F"
wenzelm@17481
    74
  contLS: "$H, $S, $S, $G |- $E ==> $H, $S, $G |- $E"
paulson@7093
    75
wenzelm@17481
    76
  thinRS: "$H |- $E, $F ==> $H |- $E, $S, $F"
wenzelm@17481
    77
  thinLS: "$H, $G |- $E ==> $H, $S, $G |- $E"
paulson@7093
    78
wenzelm@17481
    79
  exchRS: "$H |- $E, $R, $S, $F ==> $H |- $E, $S, $R, $F"
wenzelm@17481
    80
  exchLS: "$H, $R, $S, $G |- $E ==> $H, $S, $R, $G |- $E"
paulson@7093
    81
wenzelm@17481
    82
  cut:   "[| $H |- $E, P;  $H, P |- $E |] ==> $H |- $E"
paulson@7093
    83
paulson@7093
    84
  (*Propositional rules*)
paulson@7093
    85
wenzelm@17481
    86
  basic: "$H, P, $G |- $E, P, $F"
paulson@7093
    87
wenzelm@17481
    88
  conjR: "[| $H|- $E, P, $F;  $H|- $E, Q, $F |] ==> $H|- $E, P&Q, $F"
wenzelm@17481
    89
  conjL: "$H, P, Q, $G |- $E ==> $H, P & Q, $G |- $E"
paulson@7093
    90
wenzelm@17481
    91
  disjR: "$H |- $E, P, Q, $F ==> $H |- $E, P|Q, $F"
wenzelm@17481
    92
  disjL: "[| $H, P, $G |- $E;  $H, Q, $G |- $E |] ==> $H, P|Q, $G |- $E"
paulson@7093
    93
wenzelm@17481
    94
  impR:  "$H, P |- $E, Q, $F ==> $H |- $E, P-->Q, $F"
wenzelm@17481
    95
  impL:  "[| $H,$G |- $E,P;  $H, Q, $G |- $E |] ==> $H, P-->Q, $G |- $E"
paulson@7093
    96
wenzelm@17481
    97
  notR:  "$H, P |- $E, $F ==> $H |- $E, ~P, $F"
wenzelm@17481
    98
  notL:  "$H, $G |- $E, P ==> $H, ~P, $G |- $E"
paulson@7093
    99
wenzelm@17481
   100
  FalseL: "$H, False, $G |- $E"
paulson@7093
   101
wenzelm@17481
   102
  True_def: "True == False-->False"
wenzelm@17481
   103
  iff_def:  "P<->Q == (P-->Q) & (Q-->P)"
paulson@7093
   104
paulson@7093
   105
  (*Quantifiers*)
paulson@7093
   106
wenzelm@17481
   107
  allR:  "(!!x.$H |- $E, P(x), $F) ==> $H |- $E, ALL x. P(x), $F"
wenzelm@17481
   108
  allL:  "$H, P(x), $G, ALL x. P(x) |- $E ==> $H, ALL x. P(x), $G |- $E"
paulson@7093
   109
wenzelm@17481
   110
  exR:   "$H |- $E, P(x), $F, EX x. P(x) ==> $H |- $E, EX x. P(x), $F"
wenzelm@17481
   111
  exL:   "(!!x.$H, P(x), $G |- $E) ==> $H, EX x. P(x), $G |- $E"
paulson@7093
   112
paulson@7093
   113
  (*Equality*)
paulson@7093
   114
wenzelm@17481
   115
  refl:  "$H |- $E, a=a, $F"
wenzelm@17481
   116
  subst: "$H(a), $G(a) |- $E(a) ==> $H(b), a=b, $G(b) |- $E(b)"
paulson@7093
   117
paulson@7093
   118
  (* Reflection *)
paulson@7093
   119
wenzelm@17481
   120
  eq_reflection:  "|- x=y ==> (x==y)"
wenzelm@17481
   121
  iff_reflection: "|- P<->Q ==> (P==Q)"
paulson@7093
   122
paulson@7093
   123
  (*Descriptions*)
paulson@7093
   124
wenzelm@17481
   125
  The: "[| $H |- $E, P(a), $F;  !!x.$H, P(x) |- $E, x=a, $F |] ==>
paulson@7093
   126
          $H |- $E, P(THE x. P(x)), $F"
paulson@7093
   127
paulson@7093
   128
constdefs
wenzelm@17481
   129
  If :: "[o, 'a, 'a] => 'a"   ("(if (_)/ then (_)/ else (_))" 10)
paulson@7093
   130
   "If(P,x,y) == THE z::'a. (P --> z=x) & (~P --> z=y)"
paulson@7093
   131
paulson@7093
   132
setup
paulson@7093
   133
  prover_setup
paulson@7093
   134
wenzelm@17481
   135
ML {* use_legacy_bindings (the_context ()) *}
wenzelm@17481
   136
paulson@7093
   137
end
paulson@7093
   138
paulson@7118
   139