src/Sequents/S43.thy
author wenzelm
Mon Mar 19 21:10:33 2012 +0100 (2012-03-19)
changeset 47022 8eac39af4ec0
parent 42814 5af15f1e2ef6
child 51309 473303ef6e34
permissions -rw-r--r--
moved some legacy stuff;
wenzelm@41959
     1
(*  Title:      Sequents/S43.thy
paulson@2073
     2
    Author:     Martin Coen
paulson@2073
     3
    Copyright   1991  University of Cambridge
paulson@2073
     4
paulson@2073
     5
This implements Rajeev Gore's sequent calculus for S43.
paulson@2073
     6
*)
paulson@2073
     7
wenzelm@17481
     8
theory S43
wenzelm@17481
     9
imports Modal0
wenzelm@17481
    10
begin
paulson@2073
    11
paulson@2073
    12
consts
paulson@2073
    13
  S43pi :: "[seq'=>seq', seq'=>seq', seq'=>seq',
paulson@2073
    14
             seq'=>seq', seq'=>seq', seq'=>seq'] => prop"
wenzelm@14765
    15
syntax
wenzelm@35113
    16
  "_S43pi" :: "[seq, seq, seq, seq, seq, seq] => prop"
paulson@2073
    17
                         ("S43pi((_);(_);(_);(_);(_);(_))" [] 5)
paulson@2073
    18
wenzelm@35113
    19
parse_translation {*
wenzelm@35113
    20
  let
wenzelm@35113
    21
    val tr  = seq_tr;
wenzelm@35113
    22
    fun s43pi_tr [s1, s2, s3, s4, s5, s6] =
wenzelm@35113
    23
      Const (@{const_syntax S43pi}, dummyT) $ tr s1 $ tr s2 $ tr s3 $ tr s4 $ tr s5 $ tr s6;
wenzelm@35113
    24
  in [(@{syntax_const "_S43pi"}, s43pi_tr)] end
wenzelm@17481
    25
*}
wenzelm@17481
    26
wenzelm@35113
    27
print_translation {*
wenzelm@35113
    28
let
wenzelm@35113
    29
  val tr' = seq_tr';
wenzelm@35113
    30
  fun s43pi_tr' [s1, s2, s3, s4, s5, s6] =
wenzelm@35113
    31
    Const(@{syntax_const "_S43pi"}, dummyT) $ tr' s1 $ tr' s2 $ tr' s3 $ tr' s4 $ tr' s5 $ tr' s6;
wenzelm@35113
    32
in [(@{const_syntax S43pi}, s43pi_tr')] end
wenzelm@35113
    33
*}
wenzelm@17481
    34
wenzelm@17481
    35
axioms
paulson@2073
    36
(* Definition of the star operation using a set of Horn clauses  *)
paulson@2073
    37
(* For system S43: gamma * == {[]P | []P : gamma}                *)
paulson@2073
    38
(*                 delta * == {<>P | <>P : delta}                *)
paulson@2073
    39
wenzelm@17481
    40
  lstar0:         "|L>"
wenzelm@17481
    41
  lstar1:         "$G |L> $H ==> []P, $G |L> []P, $H"
wenzelm@17481
    42
  lstar2:         "$G |L> $H ==>   P, $G |L>      $H"
wenzelm@17481
    43
  rstar0:         "|R>"
wenzelm@17481
    44
  rstar1:         "$G |R> $H ==> <>P, $G |R> <>P, $H"
wenzelm@17481
    45
  rstar2:         "$G |R> $H ==>   P, $G |R>      $H"
paulson@2073
    46
paulson@2073
    47
(* Set of Horn clauses to generate the antecedents for the S43 pi rule       *)
paulson@2073
    48
(* ie                                                                        *)
paulson@2073
    49
(*           S1...Sk,Sk+1...Sk+m                                             *)
paulson@2073
    50
(*     ----------------------------------                                    *)
paulson@2073
    51
(*     <>P1...<>Pk, $G |- $H, []Q1...[]Qm                                    *)
paulson@2073
    52
(*                                                                           *)
paulson@2073
    53
(*  where Si == <>P1...<>Pi-1,<>Pi+1,..<>Pk,Pi, $G * |- $H *, []Q1...[]Qm    *)
paulson@2073
    54
(*    and Sj == <>P1...<>Pk, $G * |- $H *, []Q1...[]Qj-1,[]Qj+1...[]Qm,Qj    *)
paulson@2073
    55
(*    and 1<=i<=k and k<j<=k+m                                               *)
paulson@2073
    56
wenzelm@17481
    57
  S43pi0:         "S43pi $L;; $R;; $Lbox; $Rdia"
wenzelm@17481
    58
  S43pi1:
wenzelm@17481
    59
   "[| (S43pi <>P,$L';     $L;; $R; $Lbox;$Rdia);   $L',P,$L,$Lbox |- $R,$Rdia |] ==>
paulson@2073
    60
       S43pi     $L'; <>P,$L;; $R; $Lbox;$Rdia"
wenzelm@17481
    61
  S43pi2:
wenzelm@17481
    62
   "[| (S43pi $L';; []P,$R';     $R; $Lbox;$Rdia);  $L',$Lbox |- $R',P,$R,$Rdia |] ==>
paulson@2073
    63
       S43pi $L';;     $R'; []P,$R; $Lbox;$Rdia"
paulson@2073
    64
paulson@2073
    65
(* Rules for [] and <> for S43 *)
paulson@2073
    66
wenzelm@17481
    67
  boxL:           "$E, P, $F, []P |- $G ==> $E, []P, $F |- $G"
wenzelm@17481
    68
  diaR:           "$E |- $F, P, $G, <>P ==> $E |- $F, <>P, $G"
wenzelm@17481
    69
  pi1:
wenzelm@17481
    70
   "[| $L1,<>P,$L2 |L> $Lbox;  $L1,<>P,$L2 |R> $Ldia;  $R |L> $Rbox;  $R |R> $Rdia;
wenzelm@17481
    71
      S43pi ; $Ldia;; $Rbox; $Lbox; $Rdia |] ==>
paulson@2073
    72
   $L1, <>P, $L2 |- $R"
wenzelm@17481
    73
  pi2:
wenzelm@17481
    74
   "[| $L |L> $Lbox;  $L |R> $Ldia;  $R1,[]P,$R2 |L> $Rbox;  $R1,[]P,$R2 |R> $Rdia;
wenzelm@17481
    75
      S43pi ; $Ldia;; $Rbox; $Lbox; $Rdia |] ==>
paulson@2073
    76
   $L |- $R1, []P, $R2"
paulson@2073
    77
wenzelm@21426
    78
wenzelm@21426
    79
ML {*
wenzelm@21426
    80
structure S43_Prover = Modal_ProverFun
wenzelm@21426
    81
(
wenzelm@39159
    82
  val rewrite_rls = @{thms rewrite_rls}
wenzelm@39159
    83
  val safe_rls = @{thms safe_rls}
wenzelm@39159
    84
  val unsafe_rls = @{thms unsafe_rls} @ [@{thm pi1}, @{thm pi2}]
wenzelm@39159
    85
  val bound_rls = @{thms bound_rls} @ [@{thm boxL}, @{thm diaR}]
wenzelm@39159
    86
  val aside_rls = [@{thm lstar0}, @{thm lstar1}, @{thm lstar2}, @{thm rstar0},
wenzelm@39159
    87
    @{thm rstar1}, @{thm rstar2}, @{thm S43pi0}, @{thm S43pi1}, @{thm S43pi2}]
wenzelm@21426
    88
)
wenzelm@21426
    89
*}
wenzelm@21426
    90
wenzelm@21426
    91
wenzelm@21426
    92
method_setup S43_solve = {*
wenzelm@30549
    93
  Scan.succeed (K (SIMPLE_METHOD
wenzelm@30549
    94
    (S43_Prover.solve_tac 2 ORELSE S43_Prover.solve_tac 3)))
wenzelm@42814
    95
*}
wenzelm@21426
    96
wenzelm@21426
    97
wenzelm@21426
    98
(* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
wenzelm@21426
    99
wenzelm@21426
   100
lemma "|- []P --> P" by S43_solve
wenzelm@21426
   101
lemma "|- [](P-->Q) --> ([]P-->[]Q)" by S43_solve   (* normality*)
wenzelm@21426
   102
lemma "|- (P--<Q) --> []P --> []Q" by S43_solve
wenzelm@21426
   103
lemma "|- P --> <>P" by S43_solve
wenzelm@21426
   104
wenzelm@21426
   105
lemma "|-  [](P & Q) <-> []P & []Q" by S43_solve
wenzelm@21426
   106
lemma "|-  <>(P | Q) <-> <>P | <>Q" by S43_solve
wenzelm@21426
   107
lemma "|-  [](P<->Q) <-> (P>-<Q)" by S43_solve
wenzelm@21426
   108
lemma "|-  <>(P-->Q) <-> ([]P--><>Q)" by S43_solve
wenzelm@21426
   109
lemma "|-        []P <-> ~<>(~P)" by S43_solve
wenzelm@21426
   110
lemma "|-     [](~P) <-> ~<>P" by S43_solve
wenzelm@21426
   111
lemma "|-       ~[]P <-> <>(~P)" by S43_solve
wenzelm@21426
   112
lemma "|-      [][]P <-> ~<><>(~P)" by S43_solve
wenzelm@21426
   113
lemma "|- ~<>(P | Q) <-> ~<>P & ~<>Q" by S43_solve
wenzelm@21426
   114
wenzelm@21426
   115
lemma "|- []P | []Q --> [](P | Q)" by S43_solve
wenzelm@21426
   116
lemma "|- <>(P & Q) --> <>P & <>Q" by S43_solve
wenzelm@21426
   117
lemma "|- [](P | Q) --> []P | <>Q" by S43_solve
wenzelm@21426
   118
lemma "|- <>P & []Q --> <>(P & Q)" by S43_solve
wenzelm@21426
   119
lemma "|- [](P | Q) --> <>P | []Q" by S43_solve
wenzelm@21426
   120
lemma "|- <>(P-->(Q & R)) --> ([]P --> <>Q) & ([]P--><>R)" by S43_solve
wenzelm@21426
   121
lemma "|- (P--<Q) & (Q--<R) --> (P--<R)" by S43_solve
wenzelm@21426
   122
lemma "|- []P --> <>Q --> <>(P & Q)" by S43_solve
wenzelm@21426
   123
wenzelm@21426
   124
wenzelm@21426
   125
(* Theorems of system S4 from Hughes and Cresswell, p.46 *)
wenzelm@21426
   126
wenzelm@21426
   127
lemma "|- []A --> A" by S43_solve             (* refexivity *)
wenzelm@21426
   128
lemma "|- []A --> [][]A" by S43_solve         (* transitivity *)
wenzelm@21426
   129
lemma "|- []A --> <>A" by S43_solve           (* seriality *)
wenzelm@21426
   130
lemma "|- <>[](<>A --> []<>A)" by S43_solve
wenzelm@21426
   131
lemma "|- <>[](<>[]A --> []A)" by S43_solve
wenzelm@21426
   132
lemma "|- []P <-> [][]P" by S43_solve
wenzelm@21426
   133
lemma "|- <>P <-> <><>P" by S43_solve
wenzelm@21426
   134
lemma "|- <>[]<>P --> <>P" by S43_solve
wenzelm@21426
   135
lemma "|- []<>P <-> []<>[]<>P" by S43_solve
wenzelm@21426
   136
lemma "|- <>[]P <-> <>[]<>[]P" by S43_solve
wenzelm@21426
   137
wenzelm@21426
   138
(* Theorems for system S4 from Hughes and Cresswell, p.60 *)
wenzelm@21426
   139
wenzelm@21426
   140
lemma "|- []P | []Q <-> []([]P | []Q)" by S43_solve
wenzelm@21426
   141
lemma "|- ((P>-<Q) --< R) --> ((P>-<Q) --< []R)" by S43_solve
wenzelm@21426
   142
wenzelm@21426
   143
(* These are from Hailpern, LNCS 129 *)
wenzelm@21426
   144
wenzelm@21426
   145
lemma "|- [](P & Q) <-> []P & []Q" by S43_solve
wenzelm@21426
   146
lemma "|- <>(P | Q) <-> <>P | <>Q" by S43_solve
wenzelm@21426
   147
lemma "|- <>(P --> Q) <-> ([]P --> <>Q)" by S43_solve
wenzelm@21426
   148
wenzelm@21426
   149
lemma "|- [](P --> Q) --> (<>P --> <>Q)" by S43_solve
wenzelm@21426
   150
lemma "|- []P --> []<>P" by S43_solve
wenzelm@21426
   151
lemma "|- <>[]P --> <>P" by S43_solve
wenzelm@21426
   152
wenzelm@21426
   153
lemma "|- []P | []Q --> [](P | Q)" by S43_solve
wenzelm@21426
   154
lemma "|- <>(P & Q) --> <>P & <>Q" by S43_solve
wenzelm@21426
   155
lemma "|- [](P | Q) --> []P | <>Q" by S43_solve
wenzelm@21426
   156
lemma "|- <>P & []Q --> <>(P & Q)" by S43_solve
wenzelm@21426
   157
lemma "|- [](P | Q) --> <>P | []Q" by S43_solve
wenzelm@21426
   158
wenzelm@21426
   159
wenzelm@21426
   160
(* Theorems of system S43 *)
wenzelm@21426
   161
wenzelm@21426
   162
lemma "|- <>[]P --> []<>P" by S43_solve
wenzelm@21426
   163
lemma "|- <>[]P --> [][]<>P" by S43_solve
wenzelm@21426
   164
lemma "|- [](<>P | <>Q) --> []<>P | []<>Q" by S43_solve
wenzelm@21426
   165
lemma "|- <>[]P & <>[]Q --> <>([]P & []Q)" by S43_solve
wenzelm@21426
   166
lemma "|- []([]P --> []Q) | []([]Q --> []P)" by S43_solve
wenzelm@21426
   167
lemma "|- [](<>P --> <>Q) | [](<>Q --> <>P)" by S43_solve
wenzelm@21426
   168
lemma "|- []([]P --> Q) | []([]Q --> P)" by S43_solve
wenzelm@21426
   169
lemma "|- [](P --> <>Q) | [](Q --> <>P)" by S43_solve
wenzelm@21426
   170
lemma "|- [](P --> []Q-->R) | [](P | ([]R --> Q))" by S43_solve
wenzelm@21426
   171
lemma "|- [](P | (Q --> <>C)) | [](P --> C --> <>Q)" by S43_solve
wenzelm@21426
   172
lemma "|- []([]P | Q) & [](P | []Q) --> []P | []Q" by S43_solve
wenzelm@21426
   173
lemma "|- <>P & <>Q --> <>(<>P & Q) | <>(P & <>Q)" by S43_solve
wenzelm@21426
   174
lemma "|- [](P | Q) & []([]P | Q) & [](P | []Q) --> []P | []Q" by S43_solve
wenzelm@21426
   175
lemma "|- <>P & <>Q --> <>(P & Q) | <>(<>P & Q) | <>(P & <>Q)" by S43_solve
wenzelm@21426
   176
lemma "|- <>[]<>P <-> []<>P" by S43_solve
wenzelm@21426
   177
lemma "|- []<>[]P <-> <>[]P" by S43_solve
wenzelm@21426
   178
wenzelm@21426
   179
(* These are from Hailpern, LNCS 129 *)
wenzelm@21426
   180
wenzelm@21426
   181
lemma "|- [](P & Q) <-> []P & []Q" by S43_solve
wenzelm@21426
   182
lemma "|- <>(P | Q) <-> <>P | <>Q" by S43_solve
wenzelm@21426
   183
lemma "|- <>(P --> Q) <-> []P --> <>Q" by S43_solve
wenzelm@21426
   184
wenzelm@21426
   185
lemma "|- [](P --> Q) --> <>P --> <>Q" by S43_solve
wenzelm@21426
   186
lemma "|- []P --> []<>P" by S43_solve
wenzelm@21426
   187
lemma "|- <>[]P --> <>P" by S43_solve
wenzelm@21426
   188
lemma "|- []<>[]P --> []<>P" by S43_solve
wenzelm@21426
   189
lemma "|- <>[]P --> <>[]<>P" by S43_solve
wenzelm@21426
   190
lemma "|- <>[]P --> []<>P" by S43_solve
wenzelm@21426
   191
lemma "|- []<>[]P <-> <>[]P" by S43_solve
wenzelm@21426
   192
lemma "|- <>[]<>P <-> []<>P" by S43_solve
wenzelm@21426
   193
wenzelm@21426
   194
lemma "|- []P | []Q --> [](P | Q)" by S43_solve
wenzelm@21426
   195
lemma "|- <>(P & Q) --> <>P & <>Q" by S43_solve
wenzelm@21426
   196
lemma "|- [](P | Q) --> []P | <>Q" by S43_solve
wenzelm@21426
   197
lemma "|- <>P & []Q --> <>(P & Q)" by S43_solve
wenzelm@21426
   198
lemma "|- [](P | Q) --> <>P | []Q" by S43_solve
wenzelm@21426
   199
lemma "|- [](P | Q) --> []<>P | []<>Q" by S43_solve
wenzelm@21426
   200
lemma "|- <>[]P & <>[]Q --> <>(P & Q)" by S43_solve
wenzelm@21426
   201
lemma "|- <>[](P & Q) <-> <>[]P & <>[]Q" by S43_solve
wenzelm@21426
   202
lemma "|- []<>(P | Q) <-> []<>P | []<>Q" by S43_solve
paulson@2073
   203
paulson@2073
   204
end