src/Sequents/LK0.thy
changeset 17481 75166ebb619b
parent 16019 0e1405402d53
child 21426 87ac12bed1ab
     1.1 --- a/src/Sequents/LK0.thy	Sun Sep 18 14:25:48 2005 +0200
     1.2 +++ b/src/Sequents/LK0.thy	Sun Sep 18 15:20:08 2005 +0200
     1.3 @@ -1,136 +1,139 @@
     1.4 -(*  Title:      LK/LK0
     1.5 +(*  Title:      LK/LK0.thy
     1.6      ID:         $Id$
     1.7      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.8      Copyright   1993  University of Cambridge
     1.9  
    1.10 -Classical First-Order Sequent Calculus
    1.11 -
    1.12  There may be printing problems if a seqent is in expanded normal form
    1.13 -	(eta-expanded, beta-contracted)
    1.14 +        (eta-expanded, beta-contracted)
    1.15  *)
    1.16  
    1.17 -LK0 = Sequents +
    1.18 +header {* Classical First-Order Sequent Calculus *}
    1.19 +
    1.20 +theory LK0
    1.21 +imports Sequents
    1.22 +begin
    1.23  
    1.24  global
    1.25  
    1.26 -classes term
    1.27 -default term
    1.28 +classes "term"
    1.29 +defaultsort "term"
    1.30  
    1.31  consts
    1.32  
    1.33 - Trueprop	:: "two_seqi"
    1.34 + Trueprop       :: "two_seqi"
    1.35  
    1.36 -  True,False   :: o
    1.37 -  "="          :: ['a,'a] => o       (infixl 50)
    1.38 -  Not          :: o => o             ("~ _" [40] 40)
    1.39 -  "&"          :: [o,o] => o         (infixr 35)
    1.40 -  "|"          :: [o,o] => o         (infixr 30)
    1.41 -  "-->","<->"  :: [o,o] => o         (infixr 25)
    1.42 -  The          :: ('a => o) => 'a    (binder "THE " 10)
    1.43 -  All          :: ('a => o) => o     (binder "ALL " 10)
    1.44 -  Ex           :: ('a => o) => o     (binder "EX " 10)
    1.45 +  True         :: o
    1.46 +  False        :: o
    1.47 +  "="          :: "['a,'a] => o"     (infixl 50)
    1.48 +  Not          :: "o => o"           ("~ _" [40] 40)
    1.49 +  "&"          :: "[o,o] => o"       (infixr 35)
    1.50 +  "|"          :: "[o,o] => o"       (infixr 30)
    1.51 +  "-->"        :: "[o,o] => o"       (infixr 25)
    1.52 +  "<->"        :: "[o,o] => o"       (infixr 25)
    1.53 +  The          :: "('a => o) => 'a"  (binder "THE " 10)
    1.54 +  All          :: "('a => o) => o"   (binder "ALL " 10)
    1.55 +  Ex           :: "('a => o) => o"   (binder "EX " 10)
    1.56  
    1.57  syntax
    1.58 - "@Trueprop"	:: "two_seqe" ("((_)/ |- (_))" [6,6] 5)
    1.59 -  "_not_equal" :: ['a, 'a] => o                (infixl "~=" 50)
    1.60 + "@Trueprop"    :: "two_seqe" ("((_)/ |- (_))" [6,6] 5)
    1.61 +  "_not_equal" :: "['a, 'a] => o"              (infixl "~=" 50)
    1.62 +
    1.63 +parse_translation {* [("@Trueprop", two_seq_tr "Trueprop")] *}
    1.64 +print_translation {* [("Trueprop", two_seq_tr' "@Trueprop")] *}
    1.65  
    1.66  translations
    1.67    "x ~= y"      == "~ (x = y)"
    1.68  
    1.69  syntax (xsymbols)
    1.70 -  Not           :: o => o               ("\\<not> _" [40] 40)
    1.71 -  "op &"        :: [o, o] => o          (infixr "\\<and>" 35)
    1.72 -  "op |"        :: [o, o] => o          (infixr "\\<or>" 30)
    1.73 -  "op -->"      :: [o, o] => o          (infixr "\\<longrightarrow>" 25)
    1.74 -  "op <->"      :: [o, o] => o          (infixr "\\<longleftrightarrow>" 25)
    1.75 -  "ALL "        :: [idts, o] => o       ("(3\\<forall>_./ _)" [0, 10] 10)
    1.76 -  "EX "         :: [idts, o] => o       ("(3\\<exists>_./ _)" [0, 10] 10)
    1.77 -  "EX! "        :: [idts, o] => o       ("(3\\<exists>!_./ _)" [0, 10] 10)
    1.78 -  "_not_equal"  :: ['a, 'a] => o        (infixl "\\<noteq>" 50)
    1.79 +  Not           :: "o => o"               ("\<not> _" [40] 40)
    1.80 +  "op &"        :: "[o, o] => o"          (infixr "\<and>" 35)
    1.81 +  "op |"        :: "[o, o] => o"          (infixr "\<or>" 30)
    1.82 +  "op -->"      :: "[o, o] => o"          (infixr "\<longrightarrow>" 25)
    1.83 +  "op <->"      :: "[o, o] => o"          (infixr "\<longleftrightarrow>" 25)
    1.84 +  "ALL "        :: "[idts, o] => o"       ("(3\<forall>_./ _)" [0, 10] 10)
    1.85 +  "EX "         :: "[idts, o] => o"       ("(3\<exists>_./ _)" [0, 10] 10)
    1.86 +  "EX! "        :: "[idts, o] => o"       ("(3\<exists>!_./ _)" [0, 10] 10)
    1.87 +  "_not_equal"  :: "['a, 'a] => o"        (infixl "\<noteq>" 50)
    1.88  
    1.89  syntax (HTML output)
    1.90 -  Not           :: o => o               ("\\<not> _" [40] 40)
    1.91 -  "op &"        :: [o, o] => o          (infixr "\\<and>" 35)
    1.92 -  "op |"        :: [o, o] => o          (infixr "\\<or>" 30)
    1.93 -  "ALL "        :: [idts, o] => o       ("(3\\<forall>_./ _)" [0, 10] 10)
    1.94 -  "EX "         :: [idts, o] => o       ("(3\\<exists>_./ _)" [0, 10] 10)
    1.95 -  "EX! "        :: [idts, o] => o       ("(3\\<exists>!_./ _)" [0, 10] 10)
    1.96 -  "_not_equal"  :: ['a, 'a] => o        (infixl "\\<noteq>" 50)
    1.97 -
    1.98 +  Not           :: "o => o"               ("\<not> _" [40] 40)
    1.99 +  "op &"        :: "[o, o] => o"          (infixr "\<and>" 35)
   1.100 +  "op |"        :: "[o, o] => o"          (infixr "\<or>" 30)
   1.101 +  "ALL "        :: "[idts, o] => o"       ("(3\<forall>_./ _)" [0, 10] 10)
   1.102 +  "EX "         :: "[idts, o] => o"       ("(3\<exists>_./ _)" [0, 10] 10)
   1.103 +  "EX! "        :: "[idts, o] => o"       ("(3\<exists>!_./ _)" [0, 10] 10)
   1.104 +  "_not_equal"  :: "['a, 'a] => o"        (infixl "\<noteq>" 50)
   1.105  
   1.106  local
   1.107 -  
   1.108 -rules
   1.109 +
   1.110 +axioms
   1.111  
   1.112    (*Structural rules: contraction, thinning, exchange [Soren Heilmann] *)
   1.113  
   1.114 -  contRS "$H |- $E, $S, $S, $F ==> $H |- $E, $S, $F"
   1.115 -  contLS "$H, $S, $S, $G |- $E ==> $H, $S, $G |- $E"
   1.116 +  contRS: "$H |- $E, $S, $S, $F ==> $H |- $E, $S, $F"
   1.117 +  contLS: "$H, $S, $S, $G |- $E ==> $H, $S, $G |- $E"
   1.118  
   1.119 -  thinRS "$H |- $E, $F ==> $H |- $E, $S, $F"
   1.120 -  thinLS "$H, $G |- $E ==> $H, $S, $G |- $E"
   1.121 +  thinRS: "$H |- $E, $F ==> $H |- $E, $S, $F"
   1.122 +  thinLS: "$H, $G |- $E ==> $H, $S, $G |- $E"
   1.123  
   1.124 -  exchRS "$H |- $E, $R, $S, $F ==> $H |- $E, $S, $R, $F"
   1.125 -  exchLS "$H, $R, $S, $G |- $E ==> $H, $S, $R, $G |- $E"
   1.126 +  exchRS: "$H |- $E, $R, $S, $F ==> $H |- $E, $S, $R, $F"
   1.127 +  exchLS: "$H, $R, $S, $G |- $E ==> $H, $S, $R, $G |- $E"
   1.128  
   1.129 -  cut   "[| $H |- $E, P;  $H, P |- $E |] ==> $H |- $E"
   1.130 +  cut:   "[| $H |- $E, P;  $H, P |- $E |] ==> $H |- $E"
   1.131  
   1.132    (*Propositional rules*)
   1.133  
   1.134 -  basic "$H, P, $G |- $E, P, $F"
   1.135 +  basic: "$H, P, $G |- $E, P, $F"
   1.136  
   1.137 -  conjR "[| $H|- $E, P, $F;  $H|- $E, Q, $F |] ==> $H|- $E, P&Q, $F"
   1.138 -  conjL "$H, P, Q, $G |- $E ==> $H, P & Q, $G |- $E"
   1.139 +  conjR: "[| $H|- $E, P, $F;  $H|- $E, Q, $F |] ==> $H|- $E, P&Q, $F"
   1.140 +  conjL: "$H, P, Q, $G |- $E ==> $H, P & Q, $G |- $E"
   1.141  
   1.142 -  disjR "$H |- $E, P, Q, $F ==> $H |- $E, P|Q, $F"
   1.143 -  disjL "[| $H, P, $G |- $E;  $H, Q, $G |- $E |] ==> $H, P|Q, $G |- $E"
   1.144 +  disjR: "$H |- $E, P, Q, $F ==> $H |- $E, P|Q, $F"
   1.145 +  disjL: "[| $H, P, $G |- $E;  $H, Q, $G |- $E |] ==> $H, P|Q, $G |- $E"
   1.146  
   1.147 -  impR  "$H, P |- $E, Q, $F ==> $H |- $E, P-->Q, $F"
   1.148 -  impL  "[| $H,$G |- $E,P;  $H, Q, $G |- $E |] ==> $H, P-->Q, $G |- $E"
   1.149 +  impR:  "$H, P |- $E, Q, $F ==> $H |- $E, P-->Q, $F"
   1.150 +  impL:  "[| $H,$G |- $E,P;  $H, Q, $G |- $E |] ==> $H, P-->Q, $G |- $E"
   1.151  
   1.152 -  notR  "$H, P |- $E, $F ==> $H |- $E, ~P, $F"
   1.153 -  notL  "$H, $G |- $E, P ==> $H, ~P, $G |- $E"
   1.154 +  notR:  "$H, P |- $E, $F ==> $H |- $E, ~P, $F"
   1.155 +  notL:  "$H, $G |- $E, P ==> $H, ~P, $G |- $E"
   1.156  
   1.157 -  FalseL "$H, False, $G |- $E"
   1.158 +  FalseL: "$H, False, $G |- $E"
   1.159  
   1.160 -  True_def "True == False-->False"
   1.161 -  iff_def  "P<->Q == (P-->Q) & (Q-->P)"
   1.162 +  True_def: "True == False-->False"
   1.163 +  iff_def:  "P<->Q == (P-->Q) & (Q-->P)"
   1.164  
   1.165    (*Quantifiers*)
   1.166  
   1.167 -  allR  "(!!x.$H |- $E, P(x), $F) ==> $H |- $E, ALL x. P(x), $F"
   1.168 -  allL  "$H, P(x), $G, ALL x. P(x) |- $E ==> $H, ALL x. P(x), $G |- $E"
   1.169 +  allR:  "(!!x.$H |- $E, P(x), $F) ==> $H |- $E, ALL x. P(x), $F"
   1.170 +  allL:  "$H, P(x), $G, ALL x. P(x) |- $E ==> $H, ALL x. P(x), $G |- $E"
   1.171  
   1.172 -  exR   "$H |- $E, P(x), $F, EX x. P(x) ==> $H |- $E, EX x. P(x), $F"
   1.173 -  exL   "(!!x.$H, P(x), $G |- $E) ==> $H, EX x. P(x), $G |- $E"
   1.174 +  exR:   "$H |- $E, P(x), $F, EX x. P(x) ==> $H |- $E, EX x. P(x), $F"
   1.175 +  exL:   "(!!x.$H, P(x), $G |- $E) ==> $H, EX x. P(x), $G |- $E"
   1.176  
   1.177    (*Equality*)
   1.178  
   1.179 -  refl  "$H |- $E, a=a, $F"
   1.180 -  subst "$H(a), $G(a) |- $E(a) ==> $H(b), a=b, $G(b) |- $E(b)"
   1.181 +  refl:  "$H |- $E, a=a, $F"
   1.182 +  subst: "$H(a), $G(a) |- $E(a) ==> $H(b), a=b, $G(b) |- $E(b)"
   1.183  
   1.184    (* Reflection *)
   1.185  
   1.186 -  eq_reflection  "|- x=y ==> (x==y)"
   1.187 -  iff_reflection "|- P<->Q ==> (P==Q)"
   1.188 +  eq_reflection:  "|- x=y ==> (x==y)"
   1.189 +  iff_reflection: "|- P<->Q ==> (P==Q)"
   1.190  
   1.191    (*Descriptions*)
   1.192  
   1.193 -  The "[| $H |- $E, P(a), $F;  !!x.$H, P(x) |- $E, x=a, $F |] ==> 
   1.194 +  The: "[| $H |- $E, P(a), $F;  !!x.$H, P(x) |- $E, x=a, $F |] ==>
   1.195            $H |- $E, P(THE x. P(x)), $F"
   1.196  
   1.197  constdefs
   1.198 -  If :: [o, 'a, 'a] => 'a   ("(if (_)/ then (_)/ else (_))" 10)
   1.199 +  If :: "[o, 'a, 'a] => 'a"   ("(if (_)/ then (_)/ else (_))" 10)
   1.200     "If(P,x,y) == THE z::'a. (P --> z=x) & (~P --> z=y)"
   1.201  
   1.202  setup
   1.203    prover_setup
   1.204  
   1.205 +ML {* use_legacy_bindings (the_context ()) *}
   1.206 +
   1.207  end
   1.208  
   1.209 -ML
   1.210  
   1.211 -
   1.212 -val parse_translation = [("@Trueprop",Sequents.two_seq_tr "Trueprop")];
   1.213 -val print_translation = [("Trueprop",Sequents.two_seq_tr' "@Trueprop")];
   1.214 -