src/Sequents/S4.thy
author wenzelm
Fri Oct 27 13:50:08 2017 +0200 (22 months ago)
changeset 66924 b4d4027f743b
parent 61386 0a29a984a91b
permissions -rw-r--r--
more permissive;
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@51309
    10
axiomatization where
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@51309
    15
  lstar0:         "|L>" and
wenzelm@61385
    16
  lstar1:         "$G |L> $H \<Longrightarrow> []P, $G |L> []P, $H" and
wenzelm@61385
    17
  lstar2:         "$G |L> $H \<Longrightarrow>   P, $G |L>      $H" and
wenzelm@51309
    18
  rstar0:         "|R>" and
wenzelm@61385
    19
  rstar1:         "$G |R> $H \<Longrightarrow> <>P, $G |R> <>P, $H" and
wenzelm@61385
    20
  rstar2:         "$G |R> $H \<Longrightarrow>   P, $G |R>      $H" and
paulson@2073
    21
paulson@2073
    22
(* Rules for [] and <> *)
paulson@2073
    23
wenzelm@17481
    24
  boxR:
wenzelm@61385
    25
   "\<lbrakk>$E |L> $E';  $F |R> $F';  $G |R> $G';
wenzelm@61386
    26
           $E'         \<turnstile> $F', P, $G'\<rbrakk> \<Longrightarrow> $E          \<turnstile> $F, []P, $G" and
wenzelm@61386
    27
  boxL:     "$E,P,$F,[]P \<turnstile>         $G    \<Longrightarrow> $E, []P, $F \<turnstile>          $G" and
paulson@2073
    28
wenzelm@61386
    29
  diaR:     "$E          \<turnstile> $F,P,$G,<>P   \<Longrightarrow> $E          \<turnstile> $F, <>P, $G" and
wenzelm@17481
    30
  diaL:
wenzelm@61385
    31
   "\<lbrakk>$E |L> $E';  $F |L> $F';  $G |R> $G';
wenzelm@61386
    32
           $E', P, $F' \<turnstile>         $G'\<rbrakk> \<Longrightarrow> $E, <>P, $F \<turnstile> $G"
wenzelm@17481
    33
wenzelm@60770
    34
ML \<open>
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@60770
    44
\<close>
wenzelm@21426
    45
wenzelm@54742
    46
method_setup S4_solve =
wenzelm@60770
    47
  \<open>Scan.succeed (fn ctxt => SIMPLE_METHOD (S4_Prover.solve_tac ctxt 2))\<close>
wenzelm@21426
    48
wenzelm@21426
    49
wenzelm@21426
    50
(* Theorems of system T from Hughes and Cresswell and Hailpern, LNCS 129 *)
wenzelm@21426
    51
wenzelm@61386
    52
lemma "\<turnstile> []P \<longrightarrow> P" by S4_solve
wenzelm@61386
    53
lemma "\<turnstile> [](P \<longrightarrow> Q) \<longrightarrow> ([]P \<longrightarrow> []Q)" by S4_solve   (* normality*)
wenzelm@61386
    54
lemma "\<turnstile> (P --< Q) \<longrightarrow> []P \<longrightarrow> []Q" by S4_solve
wenzelm@61386
    55
lemma "\<turnstile> P \<longrightarrow> <>P" by S4_solve
wenzelm@21426
    56
wenzelm@61386
    57
lemma "\<turnstile>  [](P \<and> Q) \<longleftrightarrow> []P \<and> []Q" by S4_solve
wenzelm@61386
    58
lemma "\<turnstile>  <>(P \<or> Q) \<longleftrightarrow> <>P \<or> <>Q" by S4_solve
wenzelm@61386
    59
lemma "\<turnstile>  [](P \<longleftrightarrow> Q) \<longleftrightarrow> (P >-< Q)" by S4_solve
wenzelm@61386
    60
lemma "\<turnstile>  <>(P \<longrightarrow> Q) \<longleftrightarrow> ([]P \<longrightarrow> <>Q)" by S4_solve
wenzelm@61386
    61
lemma "\<turnstile>        []P \<longleftrightarrow> \<not> <>(\<not> P)" by S4_solve
wenzelm@61386
    62
lemma "\<turnstile>     [](\<not> P) \<longleftrightarrow> \<not> <>P" by S4_solve
wenzelm@61386
    63
lemma "\<turnstile>       \<not> []P \<longleftrightarrow> <>(\<not> P)" by S4_solve
wenzelm@61386
    64
lemma "\<turnstile>      [][]P \<longleftrightarrow> \<not> <><>(\<not> P)" by S4_solve
wenzelm@61386
    65
lemma "\<turnstile> \<not> <>(P \<or> Q) \<longleftrightarrow> \<not> <>P \<and> \<not> <>Q" by S4_solve
wenzelm@21426
    66
wenzelm@61386
    67
lemma "\<turnstile> []P \<or> []Q \<longrightarrow> [](P \<or> Q)" by S4_solve
wenzelm@61386
    68
lemma "\<turnstile> <>(P \<and> Q) \<longrightarrow> <>P \<and> <>Q" by S4_solve
wenzelm@61386
    69
lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> []P \<or> <>Q" by S4_solve
wenzelm@61386
    70
lemma "\<turnstile> <>P \<and> []Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
wenzelm@61386
    71
lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> <>P \<or> []Q" by S4_solve
wenzelm@61386
    72
lemma "\<turnstile> <>(P \<longrightarrow> (Q \<and> R)) \<longrightarrow> ([]P \<longrightarrow> <>Q) \<and> ([]P \<longrightarrow> <>R)" by S4_solve
wenzelm@61386
    73
lemma "\<turnstile> (P --< Q) \<and> (Q --< R) \<longrightarrow> (P --< R)" by S4_solve
wenzelm@61386
    74
lemma "\<turnstile> []P \<longrightarrow> <>Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
wenzelm@21426
    75
wenzelm@21426
    76
wenzelm@21426
    77
(* Theorems of system S4 from Hughes and Cresswell, p.46 *)
wenzelm@21426
    78
wenzelm@61386
    79
lemma "\<turnstile> []A \<longrightarrow> A" by S4_solve             (* refexivity *)
wenzelm@61386
    80
lemma "\<turnstile> []A \<longrightarrow> [][]A" by S4_solve         (* transitivity *)
wenzelm@61386
    81
lemma "\<turnstile> []A \<longrightarrow> <>A" by S4_solve           (* seriality *)
wenzelm@61386
    82
lemma "\<turnstile> <>[](<>A \<longrightarrow> []<>A)" by S4_solve
wenzelm@61386
    83
lemma "\<turnstile> <>[](<>[]A \<longrightarrow> []A)" by S4_solve
wenzelm@61386
    84
lemma "\<turnstile> []P \<longleftrightarrow> [][]P" by S4_solve
wenzelm@61386
    85
lemma "\<turnstile> <>P \<longleftrightarrow> <><>P" by S4_solve
wenzelm@61386
    86
lemma "\<turnstile> <>[]<>P \<longrightarrow> <>P" by S4_solve
wenzelm@61386
    87
lemma "\<turnstile> []<>P \<longleftrightarrow> []<>[]<>P" by S4_solve
wenzelm@61386
    88
lemma "\<turnstile> <>[]P \<longleftrightarrow> <>[]<>[]P" by S4_solve
wenzelm@21426
    89
wenzelm@21426
    90
(* Theorems for system S4 from Hughes and Cresswell, p.60 *)
wenzelm@21426
    91
wenzelm@61386
    92
lemma "\<turnstile> []P \<or> []Q \<longleftrightarrow> []([]P \<or> []Q)" by S4_solve
wenzelm@61386
    93
lemma "\<turnstile> ((P >-< Q) --< R) \<longrightarrow> ((P >-< Q) --< []R)" by S4_solve
wenzelm@21426
    94
wenzelm@21426
    95
(* These are from Hailpern, LNCS 129 *)
wenzelm@21426
    96
wenzelm@61386
    97
lemma "\<turnstile> [](P \<and> Q) \<longleftrightarrow> []P \<and> []Q" by S4_solve
wenzelm@61386
    98
lemma "\<turnstile> <>(P \<or> Q) \<longleftrightarrow> <>P \<or> <>Q" by S4_solve
wenzelm@61386
    99
lemma "\<turnstile> <>(P \<longrightarrow> Q) \<longleftrightarrow> ([]P \<longrightarrow> <>Q)" by S4_solve
wenzelm@21426
   100
wenzelm@61386
   101
lemma "\<turnstile> [](P \<longrightarrow> Q) \<longrightarrow> (<>P \<longrightarrow> <>Q)" by S4_solve
wenzelm@61386
   102
lemma "\<turnstile> []P \<longrightarrow> []<>P" by S4_solve
wenzelm@61386
   103
lemma "\<turnstile> <>[]P \<longrightarrow> <>P" by S4_solve
wenzelm@21426
   104
wenzelm@61386
   105
lemma "\<turnstile> []P \<or> []Q \<longrightarrow> [](P \<or> Q)" by S4_solve
wenzelm@61386
   106
lemma "\<turnstile> <>(P \<and> Q) \<longrightarrow> <>P \<and> <>Q" by S4_solve
wenzelm@61386
   107
lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> []P \<or> <>Q" by S4_solve
wenzelm@61386
   108
lemma "\<turnstile> <>P \<and> []Q \<longrightarrow> <>(P \<and> Q)" by S4_solve
wenzelm@61386
   109
lemma "\<turnstile> [](P \<or> Q) \<longrightarrow> <>P \<or> []Q" by S4_solve
wenzelm@17481
   110
paulson@2073
   111
end