src/Sequents/S4.thy
author haftmann
Fri Jun 19 21:08:07 2009 +0200 (2009-06-19)
changeset 31726 ffd2dc631d88
parent 30549 d2d7874648bd
child 35762 af3ff2ba4c54
permissions -rw-r--r--
merged
wenzelm@17481
     1
(*  Title:      Modal/S4.thy
paulson@2073
     2
    ID:         $Id$
paulson@2073
     3
    Author:     Martin Coen
paulson@2073
     4
    Copyright   1991  University of Cambridge
paulson@2073
     5
*)
paulson@2073
     6
wenzelm@17481
     7
theory S4
wenzelm@17481
     8
imports Modal0
wenzelm@17481
     9
begin
wenzelm@17481
    10
wenzelm@17481
    11
axioms
paulson@2073
    12
(* Definition of the star operation using a set of Horn clauses *)
paulson@2073
    13
(* For system S4:  gamma * == {[]P | []P : gamma}               *)
paulson@2073
    14
(*                 delta * == {<>P | <>P : delta}               *)
paulson@2073
    15
wenzelm@17481
    16
  lstar0:         "|L>"
wenzelm@17481
    17
  lstar1:         "$G |L> $H ==> []P, $G |L> []P, $H"
wenzelm@17481
    18
  lstar2:         "$G |L> $H ==>   P, $G |L>      $H"
wenzelm@17481
    19
  rstar0:         "|R>"
wenzelm@17481
    20
  rstar1:         "$G |R> $H ==> <>P, $G |R> <>P, $H"
wenzelm@17481
    21
  rstar2:         "$G |R> $H ==>   P, $G |R>      $H"
paulson@2073
    22
paulson@2073
    23
(* Rules for [] and <> *)
paulson@2073
    24
wenzelm@17481
    25
  boxR:
wenzelm@17481
    26
   "[| $E |L> $E';  $F |R> $F';  $G |R> $G';
paulson@2073
    27
           $E'         |- $F', P, $G'|] ==> $E          |- $F, []P, $G"
wenzelm@17481
    28
  boxL:     "$E,P,$F,[]P |-         $G    ==> $E, []P, $F |-          $G"
paulson@2073
    29
wenzelm@17481
    30
  diaR:     "$E          |- $F,P,$G,<>P   ==> $E          |- $F, <>P, $G"
wenzelm@17481
    31
  diaL:
wenzelm@17481
    32
   "[| $E |L> $E';  $F |L> $F';  $G |R> $G';
paulson@2073
    33
           $E', P, $F' |-         $G'|] ==> $E, <>P, $F |- $G"
wenzelm@17481
    34
wenzelm@21426
    35
ML {*
wenzelm@21426
    36
structure S4_Prover = Modal_ProverFun
wenzelm@21426
    37
(
wenzelm@21426
    38
  val rewrite_rls = thms "rewrite_rls"
wenzelm@21426
    39
  val safe_rls = thms "safe_rls"
wenzelm@21426
    40
  val unsafe_rls = thms "unsafe_rls" @ [thm "boxR", thm "diaL"]
wenzelm@21426
    41
  val bound_rls = thms "bound_rls" @ [thm "boxL", thm "diaR"]
wenzelm@21426
    42
  val aside_rls = [thm "lstar0", thm "lstar1", thm "lstar2", thm "rstar0",
wenzelm@21426
    43
    thm "rstar1", thm "rstar2"]
wenzelm@21426
    44
)
wenzelm@21426
    45
*}
wenzelm@21426
    46
wenzelm@21426
    47
method_setup S4_solve =
wenzelm@30549
    48
  {* Scan.succeed (K (SIMPLE_METHOD (S4_Prover.solve_tac 2))) *} "S4 solver"
wenzelm@21426
    49
wenzelm@21426
    50
wenzelm@21426
    51
(* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
wenzelm@21426
    52
wenzelm@21426
    53
lemma "|- []P --> P" by S4_solve
wenzelm@21426
    54
lemma "|- [](P-->Q) --> ([]P-->[]Q)" by S4_solve   (* normality*)
wenzelm@21426
    55
lemma "|- (P--<Q) --> []P --> []Q" by S4_solve
wenzelm@21426
    56
lemma "|- P --> <>P" by S4_solve
wenzelm@21426
    57
wenzelm@21426
    58
lemma "|-  [](P & Q) <-> []P & []Q" by S4_solve
wenzelm@21426
    59
lemma "|-  <>(P | Q) <-> <>P | <>Q" by S4_solve
wenzelm@21426
    60
lemma "|-  [](P<->Q) <-> (P>-<Q)" by S4_solve
wenzelm@21426
    61
lemma "|-  <>(P-->Q) <-> ([]P--><>Q)" by S4_solve
wenzelm@21426
    62
lemma "|-        []P <-> ~<>(~P)" by S4_solve
wenzelm@21426
    63
lemma "|-     [](~P) <-> ~<>P" by S4_solve
wenzelm@21426
    64
lemma "|-       ~[]P <-> <>(~P)" by S4_solve
wenzelm@21426
    65
lemma "|-      [][]P <-> ~<><>(~P)" by S4_solve
wenzelm@21426
    66
lemma "|- ~<>(P | Q) <-> ~<>P & ~<>Q" by S4_solve
wenzelm@21426
    67
wenzelm@21426
    68
lemma "|- []P | []Q --> [](P | Q)" by S4_solve
wenzelm@21426
    69
lemma "|- <>(P & Q) --> <>P & <>Q" by S4_solve
wenzelm@21426
    70
lemma "|- [](P | Q) --> []P | <>Q" by S4_solve
wenzelm@21426
    71
lemma "|- <>P & []Q --> <>(P & Q)" by S4_solve
wenzelm@21426
    72
lemma "|- [](P | Q) --> <>P | []Q" by S4_solve
wenzelm@21426
    73
lemma "|- <>(P-->(Q & R)) --> ([]P --> <>Q) & ([]P--><>R)" by S4_solve
wenzelm@21426
    74
lemma "|- (P--<Q) & (Q--<R) --> (P--<R)" by S4_solve
wenzelm@21426
    75
lemma "|- []P --> <>Q --> <>(P & Q)" by S4_solve
wenzelm@21426
    76
wenzelm@21426
    77
wenzelm@21426
    78
(* Theorems of system S4 from Hughes and Cresswell, p.46 *)
wenzelm@21426
    79
wenzelm@21426
    80
lemma "|- []A --> A" by S4_solve             (* refexivity *)
wenzelm@21426
    81
lemma "|- []A --> [][]A" by S4_solve         (* transitivity *)
wenzelm@21426
    82
lemma "|- []A --> <>A" by S4_solve           (* seriality *)
wenzelm@21426
    83
lemma "|- <>[](<>A --> []<>A)" by S4_solve
wenzelm@21426
    84
lemma "|- <>[](<>[]A --> []A)" by S4_solve
wenzelm@21426
    85
lemma "|- []P <-> [][]P" by S4_solve
wenzelm@21426
    86
lemma "|- <>P <-> <><>P" by S4_solve
wenzelm@21426
    87
lemma "|- <>[]<>P --> <>P" by S4_solve
wenzelm@21426
    88
lemma "|- []<>P <-> []<>[]<>P" by S4_solve
wenzelm@21426
    89
lemma "|- <>[]P <-> <>[]<>[]P" by S4_solve
wenzelm@21426
    90
wenzelm@21426
    91
(* Theorems for system S4 from Hughes and Cresswell, p.60 *)
wenzelm@21426
    92
wenzelm@21426
    93
lemma "|- []P | []Q <-> []([]P | []Q)" by S4_solve
wenzelm@21426
    94
lemma "|- ((P>-<Q) --< R) --> ((P>-<Q) --< []R)" by S4_solve
wenzelm@21426
    95
wenzelm@21426
    96
(* These are from Hailpern, LNCS 129 *)
wenzelm@21426
    97
wenzelm@21426
    98
lemma "|- [](P & Q) <-> []P & []Q" by S4_solve
wenzelm@21426
    99
lemma "|- <>(P | Q) <-> <>P | <>Q" by S4_solve
wenzelm@21426
   100
lemma "|- <>(P --> Q) <-> ([]P --> <>Q)" by S4_solve
wenzelm@21426
   101
wenzelm@21426
   102
lemma "|- [](P --> Q) --> (<>P --> <>Q)" by S4_solve
wenzelm@21426
   103
lemma "|- []P --> []<>P" by S4_solve
wenzelm@21426
   104
lemma "|- <>[]P --> <>P" by S4_solve
wenzelm@21426
   105
wenzelm@21426
   106
lemma "|- []P | []Q --> [](P | Q)" by S4_solve
wenzelm@21426
   107
lemma "|- <>(P & Q) --> <>P & <>Q" by S4_solve
wenzelm@21426
   108
lemma "|- [](P | Q) --> []P | <>Q" by S4_solve
wenzelm@21426
   109
lemma "|- <>P & []Q --> <>(P & Q)" by S4_solve
wenzelm@21426
   110
lemma "|- [](P | Q) --> <>P | []Q" by S4_solve
wenzelm@17481
   111
paulson@2073
   112
end