src/Sequents/ILL.thy
author wenzelm
Fri May 21 21:14:18 2004 +0200 (2004-05-21)
changeset 14765 bafb24c150c1
parent 2073 fb0655539d05
child 17481 75166ebb619b
permissions -rw-r--r--
proper use of 'syntax';
     1 (*  Title:      ILL.thy
     2     ID:         $Id$
     3     Author:     Sara Kalvala and Valeria de Paiva
     4     Copyright   1995  University of Cambridge
     5 *)
     6 
     7 
     8 ILL = Sequents +
     9 
    10 consts
    11   Trueprop       :: "two_seqi"
    12 
    13 "><"    ::"[o, o] => o"        (infixr 35)
    14 "-o"    ::"[o, o] => o"        (infixr 45)
    15 "o-o"   ::"[o, o] => o"        (infixr 45)
    16 FShriek ::"o => o"             ("! _" [100] 1000)
    17 "&&"    ::"[o, o] => o"        (infixr 35)
    18 "++"    ::"[o, o] => o"        (infixr 35)
    19 zero    ::"o"                  ("0")
    20 top     ::"o"                  ("1")
    21 eye     ::"o"                  ("I")
    22 aneg    ::"o=>o"               ("~_")
    23 
    24 
    25   (* context manipulation *)
    26 
    27  Context      :: "two_seqi"
    28 
    29   (* promotion rule *)
    30 
    31   PromAux :: "three_seqi"
    32 
    33 syntax
    34   "@Trueprop" :: "single_seqe" ("((_)/ |- (_))" [6,6] 5)
    35   "@Context"  :: "two_seqe"   ("((_)/ :=: (_))" [6,6] 5)
    36   "@PromAux"  :: "three_seqe" ("promaux {_||_||_}")
    37 
    38 defs
    39 
    40 liff_def        "P o-o Q == (P -o Q) >< (Q -o P)"
    41 
    42 aneg_def        "~A == A -o 0"
    43 
    44 
    45 
    46 
    47 rules
    48 
    49 identity        "P |- P"
    50 
    51 zerol           "$G, 0, $H |- A"
    52 
    53   (* RULES THAT DO NOT DIVIDE CONTEXT *)
    54 
    55 derelict   "$F, A, $G |- C ==> $F, !A, $G |- C"
    56   (* unfortunately, this one removes !A  *)
    57 
    58 contract  "$F, !A, !A, $G |- C ==> $F, !A, $G |- C"
    59 
    60 weaken     "$F, $G |- C ==> $G, !A, $F |- C"
    61   (* weak form of weakening, in practice just to clean context *)
    62   (* weaken and contract not needed (CHECK)  *)
    63 
    64 promote2        "promaux{ || $H || B} ==> $H |- !B"
    65 promote1        "promaux{!A, $G || $H || B}
    66                  ==> promaux {$G || $H, !A || B}"
    67 promote0        "$G |- A ==> promaux {$G || || A}"
    68 
    69 
    70 
    71 tensl     "$H, A, B, $G |- C ==> $H, A >< B, $G |- C"
    72 
    73 impr      "A, $F |- B ==> $F |- A -o B"
    74 
    75 conjr           "[| $F |- A ;
    76                  $F |- B |]
    77                 ==> $F |- (A && B)"
    78 
    79 conjll          "$G, A, $H |- C ==> $G, A && B, $H |- C"
    80 
    81 conjlr          "$G, B, $H |- C ==> $G, A && B, $H |- C"
    82 
    83 disjrl          "$G |- A ==> $G |- A ++ B"
    84 disjrr          "$G |- B ==> $G |- A ++ B"
    85 disjl           "[| $G, A, $H |- C ;
    86                     $G, B, $H |- C |]
    87                 ==> $G, A ++ B, $H |- C"
    88 
    89 
    90       (* RULES THAT DIVIDE CONTEXT *)
    91 
    92 tensr           "[| $F, $J :=: $G;
    93                     $F |- A ;
    94                     $J |- B     |]
    95                     ==> $G |- A >< B"
    96 
    97 impl            "[| $G, $F :=: $J, $H ;
    98                     B, $F |- C ;
    99                        $G |- A |]
   100                     ==> $J, A -o B, $H |- C"
   101 
   102 
   103 cut " [| $J1, $H1, $J2, $H3, $J3, $H2, $J4, $H4 :=: $F ;
   104          $H1, $H2, $H3, $H4 |- A ;
   105          $J1, $J2, A, $J3, $J4 |- B |]  ==> $F |- B"
   106 
   107 
   108   (* CONTEXT RULES *)
   109 
   110 context1     "$G :=: $G"
   111 context2     "$F, $G :=: $H, !A, $G ==> $F, A, $G :=: $H, !A, $G"
   112 context3     "$F, $G :=: $H, $J ==> $F, A, $G :=: $H, A, $J"
   113 context4a    "$F :=: $H, $G ==> $F :=: $H, !A, $G"
   114 context4b    "$F, $H :=: $G ==> $F, !A, $H :=: $G"
   115 context5     "$F, $G :=: $H ==> $G, $F :=: $H"
   116 
   117 
   118 
   119 
   120 end
   121 
   122 ML
   123 
   124 val parse_translation = [("@Trueprop",Sequents.single_tr "Trueprop"),
   125                          ("@Context",Sequents.two_seq_tr "Context"),
   126                          ("@PromAux", Sequents.three_seq_tr "PromAux")];
   127 
   128 val print_translation = [("Trueprop",Sequents.single_tr' "@Trueprop"),
   129                          ("Context",Sequents.two_seq_tr'"@Context"),
   130                          ("PromAux", Sequents.three_seq_tr'"@PromAux")];
   131 
   132