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