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