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