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