Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  LTL.thy

  Sprache: Isabelle
 

java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
    Author:   Salomon Sickert
    Author:   Benedikt
     alization
    Author:   Stephan Merz (original entry: Stuttering_Equivalence.thy
    License
*)

section (atoms_ltlc ') ltlc =

theory                               opentruec)
imports
  Main                              falsec
begin

text opennotc _
    \begin{enumerate}
      \item LTL with syntactic sugar. This variant is iceudedparser
            generates ASTs of this datatype.
      \item LTL in negation normal form without syntactic sugar. This variant is used by the included
            rewriting engine and is used for the translationto automataimplementedentednentrieses
      \item LTL in restricted negation normal form without the rather uncommon operators ``weak until''
            and ``strong release''. It is used by the formalization of Gerth's algorithm.
      \item PLTL. A variant with a reduced set of operators.
    \end{enumerate}
    This theory subsumes (and partly reuses) the existing formalisation found in LTL\_to\_GBA and
    \quivalencealencence andunifiesm<

subsection \<open>LTL with Syntactic Sugar\<close>

text \<open>In this section, we provide  \xi\<Turnstile>\<^sub>c not\<^sub>c \<phi> = (\<not> \<xi> \<Turnstile>\<^sub>c \<phi>)"
    Thisormalizationsasreferencenticscs.\>

subsubsection \<open>ntaxx<close

datatype (atoms_ltlc: 'a) ltlc =
    True_ltlc                               (\<open>true\<^sub>c\<close>)
  alse_ltlc                   false\<^sub>c\<close>)
  | Prop_ltlc 'a                            (\<open>prop\<^"\<xi\>\<c \<phi> M\<^sub>c \<psi> = (\<exists>i.ffixxi \<Turnstile>\<^sub>c \<phiand (\<forall>j\<le>i ix<> \<^sub>c \<psi>))
  | Not_ltlc "'a ltlc"                      (\<open>not\<^sub>c _\<close> [85] 85)
  | And_ltlc "'altlclc      > and\<^sub>c _\<close> [82,82] 81)
  " alc"             (\<open>_ or\<^sub>c _\<close> [81,81] 80)
  | Implies_ltlcac""'altlctlc             ((<>_ies> _\<close> [81,81] 80)
  | Next_ltlc "'a ltlc"                      \< \<Turnstile>\<^sub>c Gc \<psi>")
  | Final_ltlc" tlc                    >\<^sub>c _\<close> [88] 87)
  | Global_ltlc "'a ltlc"                   (\<open>G\<^sub>c _\<close> [88] 87)
  | Until_ltlc "'a ltlc" "'a ltlc"          (\<open>_ U\<^sub>c _\<close> [84,84] 83)
  "<>\<Turnstile>\<^sub>\phi> W\<^sub>c \<psi> \longleftrightarrow \<xi> \<Turnstile>\<^sub>c (\>U\<^sub>c \> or\<^sub>c(c \<phi>)"
   
  StrongRelease_ltlcltlc\>_ \^subc _\<close> [84,84] 83)

definition Iff_ltlc (\<open>_ iff\<^sub>c _\<close> [81,81] 80 ases<i \<Turnstile<sub>c G\<^sub>c \<phi>")
where
  "\<phi  usingorder_iff_strictct by o

subsubsection \bysontl_Release_StrongRelease_congRelease_Until_contil_WeakUntil_conmantics_ltlcltlcps)

primrec semantics_ltlc :: "setd  ltlc<> ool"(>_<urnstile>\<^sub>c _\<close> [80,80] 80)
where
  "\<xi> \<Turnstile>\<^sub>c true\<^sub>c = True"
| "_x:
| "\<xi> \<Turnstile>\<^subcp<sub(q) = (q\<in>\<xi> 0)"
| ( pw_eq_on_defth
| "\<xi> \<Turnstile>^ubc \<phi> and\<^sub>c \<psi> = (\<xi> \<Turnstile>\<^sub>c \<phi> \<and> \<xi> \<Turnstile>\<^sub>c \<psi>)"
| "\<xi> \<Turnstile>\<  elease_ltlc
| "\<xithusjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
| "\<xi> \<Turnstile>\<^sub><^> \<phi> \<longleftrightarrow> (map_props f o \<xi>) \<Turnstile>\<subltlc<>"
| "\<xi> \<Turnstile>\<^sub>c F\>= (\<exists \<Turnstile>^c \<phi>)"
|xi \<Turnstile>\<^sub>c G\<^sub>c\<hi>= (\<forall>i. suffix i \<xi> \<Turnstile>\<^sub>c \<phi>)"
| "\<xi> \<Turnstile>\<^sub>c \<phi> U\<^ub<> =exists. suffix i \<xi> \<Turnstile>\<^sub>c \<psi> \<and> (\<forall>j<i. suffix  \<Turnstile>\<^sub><))"
| "\<xinotationnput finally\sub> (\<open>\<diamondsuit>\<^sub>n _\<close> [88] 87)
| "\<xi> \<Turnstile>\<^sub>c \<phi> W\<^sub>c \<psi> = (\<forall>i. suffix i \<xi> \<Turnstile>\<^sub>c \<phi> \<or> (\<>\<le>i. suffix j \<xi> \<Turnstile>\<^sub>c \<psi>))"
| "\<xi> \<Turnstile><sub>c \<phi> M\<^sub>c \<psi> = (\<exists>i. suffix i <i>\Turnstile>\^subc \<phi> \<and> (\<forall>j\<le>i. suffix j \<i <>\<^sub>c \<psi>))"

lemma semantics_ltlc_sugar [simp]:
 "\<xi> \<Turnstile>\<^sub>c \<phi>c \<psi> = (\<xi<\<^sub>c \<phi> \<longleftrightarrow> \<xi> \<Turnstile>\<^sub>c \<psi>)"
  xi \<Turnstile>\<^ubF<^sub>c \<phi> = \<xi> \<Turnstile>\<^sub>c (true\<^sub>c U\<^sub>c \<phi>)"
  "<xi \<Turnstile>\<^sub>c G\<^sub> phi> = \<xi> \<Turnstile><sub (false\<^sub>c R\<^sub>c \<phi>)"
  by (auto simp add: Iff_ltlc_def)

definition "language_ltlc \<phi> \<equiv"n_to_ltlc> R\<^sub>n \<psi>) = (ltln_to_ltlc<hi R\<^sub>c ltln_to_ltlc \<psi>)"

  <<^sub>n (ltlc_to_ltln' False \<phi>) \<longleftrightarrow> w\Turnstile>c \<phi>"
  "language_ltlc (not\<^sub>c \<phi>) = - language_ltlc \<phi>"
  unfolding usingo_ltlnct

lemma ltl_true_or_con[simp]:
  "\<xi> \<Turnstile>\<^sub>c prop\<^sub>c(p) or\c (not\<^sub>c prop\<^sub>c(p))"
  by auto

lemmafalse_true_con
  >\<Turnstile>\<^notsub>c true\<^sub>c \<longleftrightarrow> \<xi> \<Turnstile>\<^<subc


lemma ltl_Next_Neg_con[simp]:
   \<Turnstile>\<^sub>cX<ubc (not\<^sub>c \<phi>) \<longleftrightarrow> \<xi> \<Turnstile>\<^sub>c not\<^sub>c X\<^sub>c \<phi>"
   to

\<comment> \<open>The connection between dual operators\<close>

lemma ltl_Until_Release_con:
  "\<xi> \<Turnstile>\<^
  "\<xi> \<Turnstile>\<^subbyction>) auto
  by auto

lemmaubfrmlsn_subset
  "\<xi><><^sub>c \<phi> W\<^sub>c psi\<longleftrightarrow> (\<not> \<xi> \<Turnstile>\<^sub>c (not\<^sub>c \<phi< c \<psi>))"
  "\<xi> \<Turnstile>\<^sub>c \<phi> <c \<psi> \<longleftrightarrow> (\<not> \<><\<^sub>c (not\<^sub>c \<phi>) W\<^sub>c (not\<^sub>c \<psi>))"
  byjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

\<comment> \<open>The connection between weak and strong operators\<close>

lemma ltl_Release_StrongRelease_con:
  "\<xi> \<Turnstilesub \<phi> R\<^sub>c \<psi> \<longleftrightarrow> \<xi> \<Turnstile>\<c) or\c (G\<^sub>c \<psijava.lang.StringIndexOutOfBoundsException: Index 159 out of bounds for length 159
  "\<xi> \<Turnstile>\<^sub>c \<phi> M\<^sub>c \<psi> \<longleftrightarrow> \<xi> \<Turnstile>\<^sub>c (\<phi> R\<^sub>c \<psi>) and\<^sub>c (F\<^sub>c \<phi>)"
afe
  assume asm: "\<xi> \<Turnstile<ubc \<phi> R\<^sub>c \<psi>"

 <>><^sub>c (\<phi> M\<^sub>c \<psi>) <c (G\<^sub>c \<psi>)"
  proof (cases "\<xi> \<Turnstile>\<^c \<psi>")
    case False

    then obtain i where "\<not> suffix i \<xi> \<Turnstile>\<^sub>c \<psi>" and "\<forall>j<i. suffix j \<xi> \<Turnstile>\<^sub>c \<psi>"
      using_i. \<notsuffixxi \<Turnstile>\<^sub psi"] by force

    then \<Turnstile>\^subn\<subn (\<phi> R\<^sub>n \<psi>) \<longleftrightarrow\<^sub>n G\<^sub>n"
      using asm by force
  qed simp
next
  w\<Turnstile>\<^sub>n \<phi> R\^> \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (G\subpsi) or\<^sub> M\<^sub><>)"

  
  proof (cases "\<xi> \<urnstile^c F\<^sub>c \<phi>")
    case rue

    then obtainassume<>j<i. \<not> suffix j w \<Turnstile>\<^sub>n \<phi>"
      using exists_least_iff[of "\<lambda>i. suffix i \<xi> \<Turnstile>\<^sub>c \<phi>" yorce

    by ak_strongt<subnimps,811not\sub>n_semantics)+
      using asm by force
  qed simp
qed (unfold semantics_ltlc.simps; insert not_less, blast)+

lemma ltl_Until_WeakUntil_con:
  "\<xi> \<Turnstile>\<^sub>c \<phi> U\^ub <psi \<longleftrightarrow> \<xi> \<Turnstile>\<^sub>c phi W\<^sub>\) and\<^sub>c\sub<>"
  "<>\<Turnstile>\<^sub>c \<phi> \subc \<psi> \<longleftrightarrow> \<xi> \<Turnstile>\<^sub>c (\<>U^ \<psi>) or\<^sub>c (G\subb)"
prooffe
  assume asm: "\<xi> \<Turnstile>\<^sub>c (\<phi> W\(6 <subn_semantics)

  byutoab_semigroup_add_classclassac)deft_commute
  proof (cases "xi> <urnstile\<^sub>c F\<^sub>c \<psi>")
    case True

    then 
      using exists_least_iff[of "i. suffix i \<xi> \Turnstile\<^sub>c \<psi>"] by force

    then show ?thesis
     singasm rce
  qed simp
next
  assume"w \<urnstile\^ubn \^sub>n (G\<^sub>n \<phi>) \<Longrightarrow> \<forall>\<^sub>\<infinity>i. suffix i w <Turnstile<sub> subn \<phi>"

  then show "\<xi> \<Turnstile>\<^sub>c (unfoldingMOST_nat
  proof (cases "\<xi> \<Turnstile>\<^sub>c howsuffix  \Turnstile\<sub>n F\<^sub>n \<psi>"
    case False

    then obtain i where "\<not> suffix i \<xi> \<Turnstile>\
      using exists_least_iff[of "\<lambda>i. \<>suffix \xi> \<Turnstile>\<^sub>c \<phi>"] by force

    then show ?thesis
      using asm by force
  qed simp
qed (unfold semantics_ltlc.simps; insert not_less, blast)+

lemmal_StrongRelease_Until_con
  using_ axbyast
  using order.order_iff_strict by auto

lemma ltl_WeakUntil_Release_con:
  "  fix i : nat
   (meson ltl_Release_StrongRelease_con(1) ltl_StrongRelease_Until_con ltl_Until_WeakUntil_con(2) semantics_ltlc.simps(6))


definition 

lemmaaxi  Max {i. \noti  <\<^sub>n G\<^sub>n \<psi}
  and pw_eq_on_sym: "pw_eq_on Sww'\<ongrightarrow pw_eq_on S w' w"
  and_nsans]\<lbrakkpw_eq_on S w w';pw_eq_on 'w''\> \<Longrightarrow> pw_eq_on S  '"
  unfolding: algebra_simps)

lemma pw_eq_on_suffix:
  "pw_eq_on S w w' \<Longrightarrow> pw_eq_on S (suffix k withaxowsuffixi Turnstile<^sub>n G\<^sub>n \<psi>"
  by simpadd: pw_eq_on_def_eq_on_defq_on_def

lemma pw_eq_on_subset:
  ubseteqS \<Longrightarrow pw_eq_on S' w w' \<Longrightarrow> pw_eq_on S w w'"
  by (auto simp add: pw_eq_on_def)

lemma ltlc_eq_on_aux:
  "pw_eq_on (atoms_ltlc ) w w' \<Longrightarrow> w\<^sub>c \<phi> \<Longrightarrow> w' \\<^sub>c \<phi>"
proof (induction \<phi> arbitrary: w w')
  case Until_ltlc
  thus ?case
    by simp (meson Un_upper1 Un_upper2 pw_eq_on_subset pw_eq_on_suffix)
next
  case Release_ltlc
  thus ?case
    by simp (metis Un_upper1 pw_eq_on_subsetpw_eq_on_suffix sup_commute)
next
  case WeakUntil_ltlc
  thus ?case
    by simp (meson pw_eq_on_subset pw_eq_on_suffix sup.cobounded1 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
next
  case StrongRelease_ltlc
  thus ?case
    by simp (by metis_easeeln_expand_Untilxpand_Untilnd_Untilln_weak_strongemantics_ltln,,)
next
  case (And_ltlc \<phi> \<psi>)
  thus ?case
    by simp (meson Un_upper1 inf_sup_ord(4) pw_eq_on_subset)
next
  case (Or_ltlc \<phi> \<psi>)
  thus ?case
    by simp (meson Un_upper2 pw_eq_on_subset sup_ge1)
next
  case (Implies_ltlc \<phi> \<psi>)
  thus ?case
    by simp (meson Un_upper1 Un_upper2 pw_eq_on_subset[of "atoms_ltlc)o
qed (auto simp add: pw_eq_on_def; metis suffix_nth)+

lemma ltlc_eq_on:
  "pw_eq_on (atoms_ltlc \<phi>) w w' \<Longrightarrowthuslhs
  using ltlc_eq_on_aux pw_eq_on_sym by blast

lemma suffix_comp: "(\<lambda>i. f (suffix k w i)) =w\<Turnstile^n \<phi> R\<^sub>n \<psi> \<longleftrightarrow>  Turnstile\<^sub>n (G\<^sub>n <) or\<^sub>  U\<^sub>(> and\<^sub>n <))"
  by auto

lemma suffix_range: "\<Union>(range \<xi>) \<subseteq> APs \<Longrightarrow> \<Union>(range (suffix k \<xi>)) \<subseteq> APs"
    by auto

lemma map_semantics_ltlc_aux:
  assumes "inj_on f APs"
  assumes "\<Union>(range w) \<subseteq> APs"
  assumes "atoms_ltlc \<phi> \<subseteq> APs"
  shows "w \<Turnstile>\<^sub>c \<phi> \<longleftrightarrow <i. f ` w i) <>^> map_ltlc f \<phi>"
  using assms(2,3)
proof (induction \<phi> arbitrary: w)
  case (Prop_ltlc x)
    thus ?case   using assms(1)
      by iff)
next| "\<xi>\Turnstile\<sub>r false\<^sub>r = False"
  case (Next_ltlc \<phi>
    show ?case
      using Next_ltlc(1)[of "suffix 1 w", unfolded suffix_comp comp_def] Next_ltlc(2,3) apply
        by ( xt_ltlcne_nat_def><lbrakk>\<Union>(range (suffix 1 w)) \<subseteq> APs; atoms_ltlc \<phi> \<subseteq> APs\<rbrakk> \<Longrightarrow> suffix 1 w \<Turnstile>\<sub> = suffix 1lambdax. f `x<><c map_ltlc f \<phi>\<close> suffix_range)
ext
  case (Final_ltlc )
    thus ?se
       using Final_ltlc(1)[offfix_nfoldeduffix_compompomp_defx_rangeastforce
next
  case (Global_ltlc)
    thus ?case
      using Global_ltlc(1)[of "suffix _ w", unfolded suffix_comp comp_def, OF ngee
next
  Until_ltlc
    thus ?case
      ngil_ltlclc,)f foldeduffix_compp_def fix_range tforcee
next
  seRelease_ltlc
    thus ?case
      using Release_ltlc(1,2)[of "suffix _ w", unfolded suffix_comp omp_defffix_range] by fastforce
next
  case (WeakUntil_ltlc)
    thus ?case
      using WeakUntil_ltlc(1,2)[of "suffix _ w", unfolded suffix_comp comp_def,x_rangebyfastforce
next
   StrongRelease_ltlc
    thus ?case
       trongRelease_ltlcwfoldedx_compp_defffix_range] by fastforce
qed simpjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

definition "map_props f APs

lemma map_semantics_ltlc:
  assumes INJ: "inj_on f (dom f)" andfun  subfrmlsr :: "a Rightarrow'a ltlr set"
  shows "\<xi <Turnstile\<^sub>c \<phi> \<longleftrightarrow> (map_props f o <xi) \<Turnstile>\<^sub>cp_ltlc <"
proof -
  let ?\<xi>r = "\<lambda>i. \<xi> i <inter atoms_ltlc \<phi>"
  let ?\<xi>r' = "\<lambda>i. \<xi> i \<inter> dom f"

  have 1: "\<Union>(range ?\<xi>r) \<subseteq> atoms_ltlc \<phi>" by auto

  have INJ_the_dom: "inj_on (the o f) (dombyspand_Untilr_to_ltln.simps(5 tlr_to_ltln_semantics
    using assms
    by (auto simp: inj_on_def domIff)
  note 2 = inj_on_subset[OF this DOM]

  have 3: "(\<lambda>i. (the o f) ` ?\<xi>text <We define the syntax and semantics of propositional linear-time
    uto p_props_deffage_iff)
    by (metis Int_iff domI optionsel

  have "\<xi> \<Turnstile>\<^sub>c \<phi> \<longleftrightarrow> ?\<xi>r \<Turnstile>\<^sub>c \<phi>"
    apply (rule ltlc_eq_on)
    apply (auto simp:pw_eq_on_def
    done
  also from map_semantics_ltlc_aux[java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  have "\<dots> \<longleftrightarrow>(\lambda>i. (the o f) ` ?\<xi>r  Turnstile\<^sub>c map_ltlc (the o f) \<phi>" .
  also have "\<dots> \<longleftrightarrow> (\<lambda>i. (the o f) ` ?\<xi>r' i) \<Turnstile>\<^sub>c map_ltlc (the o f
    apply (rule ltlc_eq_on) singgMNJ
    apply (auto simp: pw_eq_on_def ltlc.set_map domIff image_iff)
    metis Int_iff contra_subsetD domD domI inj_on_eq_iff option.sel)
  also note 3
  finally show ?thesis where
qed

lemma map_semantics_ltlc_inv:
  assumes INJ: "inj_on f (dom f)" and DOM: "atoms_ltlc \<phi> \<>mjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
  shows "\<xi> \<Turnstile>\<^sub>c map_ltlc (the o f) \<phi> \fun cs_pltl',pltl<> bool" (\<open>_ Turnstile\<^sub>p _\<close> [80,80]
  using map_semantics_ltlc[OF assms]
  apply java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
  apply (intro ltlc_eq_on)
  apply (auto simp add: pw_eq_on_def ltlc.set_map map_props_def)
  by (metis DOM comp_apply contra_subsetD domD option.sel vimage_eq)




subsection \<open>LTL in Negation Normal mclose>

text \<open> ine ypeLrmulain negationormalformm(F\<close>

subsubsection \<

datatype (atoms_ltln: funltla\<Rightarrow
                                     true\<^sub>n\<close>)
  | False_ltln                              (\<open>false\<^sub>n\<close>)
  | Prop_ltln 'a                            (\<openop^>n'(_')\<close>)
  | Nprop_ltln 'a                           (\<open>nprop\<^sub>n'(_')\<close>)
  | And_ltln "'a ltln" "'a ltln"            (\<open>_ and\<^sub>n _\<[,
  | Or_ltln "'a ltln" "'a ltln"             (\<open>_ or\<^sub>n _\<close> (to_pltl)"
  | Next_ltln "'a ltln"                     (\<open>X\<^sub>n _\<close> [88] 87)
  ||"atoms_pltl<subp \<phi>) = atoms_pltl \<phi>"
  | elease_ltln ltln"    open_ R\<^sub>n _\<close> [84,84] 83)
  | WeakUntil_ltln "'a ltln" "'a ltln"      \open_ W\<^sub>n _\<close> [84,84] 83)
  | StrongRelease_ltln "'a ltln" "'a ltln"  (\<open>_ M\<^sub>n _\<close> [84,84] 83)

abbreviation finally\<^sub>n :: "'a ltln \<Rightarrow> 'a ltln" (\<open>F\<^sub>n _\<close> [88] 87)
where
  "F\<^sub>n \<phi> \<equiv> true\<^sub>n U\<^sub>n \<phi>"

notation (input) finally\<^sub>n (\<open>\<diamondsuit>\<^sub>n _\<close> [88] 87)

abbreviation globally\<^sub>n :: "'a ltln \<Rightarrow> 'a ltln" (\<open>G\<^sub>n _\<close> [88] 87)
where
  "G\<^sub>n \<phi> \<equiv> false\<^sub>n R\<^sub>n \<phi>"

notation (input) globally\<^sub>n (\<open>\<box>\<^sub>n _\<close> [88] 87)

subsubsection \<open>Semantics\<close>

primrec semantics_ltln :: "['a set word, 'a ltln] \<Rightarrow> bool" (\<open>_ \<Turnstile>\<^sub>n _\<close> [80,80] 80)
where
  "\<xi> \<Turnstile>\<^sub>n true\<^sub>n = True"
| "\<xi> \<Turnstile>\<^sub>n false\<^sub>n = False"
| "\<xi> \<Turnstile>\<^sub>n prop\<^sub>n(q) = (q \<in> \<xi> 0)"
| "\<xi> \<Turnstile>\<^sub>n nprop\<^sub>n(q) = (q \<notin> \<xi> 0)"
| "\<xi> \<Turnstile>\<^sub>n \<phi> and\<^sub>n \<psi> = (\<xi> \<Turnstile>\<^sub>n \<phi> \<and> \<xi> \<Turnstile>\<^sub>n \<psi>)"
| "\<xi> \<Turnstile>\<^sub>n \<phi> or\<^sub>n \<psi> = (\<xi> \<Turnstile>\<^sub>n \<phi> \<or> \<xi> \<Turnstile>\<^sub>n \<psi>)"
| "\<xi> \<Turnstile>\<^sub>n X\<^sub>n \<phi> = (suffix 1 \<xi> \<Turnstile>\<^sub>n \<phi>)"
| "\<xi> \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi> = (\<exists>i. suffix i \<xi> \<Turnstile>\<^sub>n \<psi> \<and> (\<forall>j<i. suffix j \<xi> \<Turnstile>\<^sub>n \<phi>))"
| "\<xi> \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi> = (\<forall>i. suffix i \<xi> \<Turnstile>\<^sub>n \<psi> \<or> (\<exists>j<i. suffix j \<xi> \<Turnstile>\<^sub>n \<phi>))"
| "\<xi> \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi> = (\<forall>i. suffix i \<xi> \<Turnstile>\<^sub>n \<phi> \<or> (\<exists>j\<le>i. suffix j \<xi> \<Turnstile>\<^sub>n \<psi>))"
| "\<xi> \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi> = (\<exists>i. suffix i \<xi> \<Turnstile>\<^sub>n \<phi> \<and> (\<forall>j\<le>i. suffix j \<xi> \<Turnstile>\<^sub>n \<psi>))"

definition "language_ltln \<phi> \<equiv> {\<xi>. \<xi> \<Turnstile>\<^sub>n \<phi>}"

lemma semantics_ltln_ite_simps[simp]:
  "w \<Turnstile>\<^sub>n (if P then true\<^sub>n else false\<^sub>n) = P"
  "w \<Turnstile>\<^sub>n (if P then false\<^sub>n else true\<^sub>n) = (\<not>P)"
  by simp_all

subsubsection \<open>Conversion\<close>

fun ltlc_to_ltln' :: "bool \<Rightarrow> 'a ltlc \<Rightarrow> 'a ltln"
where
  "ltlc_to_ltln' False true\<^sub>c = true\<^sub>n"
| "ltlc_to_ltln' False false\<^sub>c = false\<^sub>n"
| "ltlc_to_ltln' False prop\<^sub>c(q) = prop\<^sub>n(q)"
| "ltlc_to_ltln' False (\<phi> and\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) and\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (\<phi> or\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) or\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (\<phi> implies\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) or\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (F\<^sub>c \<phi>) = true\<^sub>n U\<^sub>n (ltlc_to_ltln' False \<phi>)"
| "ltlc_to_ltln' False (G\<^sub>c \<phi>) = false\<^sub>n R\<^sub>n (ltlc_to_ltln' False \<phi>)"
| "ltlc_to_ltln' False (\<phi> U\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) U\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (\<phi> R\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) R\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (\<phi> W\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) W\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' False (\<phi> M\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) M\<^sub>n (ltlc_to_ltln' False \<psi>)"
| "ltlc_to_ltln' True true\<^sub>c = false\<^sub>n"
| "ltlc_to_ltln' True false\<^sub>c = true\<^sub>n"
| "ltlc_to_ltln' True prop\<^sub>c(q) = nprop\<^sub>n(q)"
| "ltlc_to_ltln' True (\<phi> and\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) or\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (\<phi> or\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) and\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (\<phi> implies\<^sub>c \<psi>) = (ltlc_to_ltln' False \<phi>) and\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (F\<^sub>c \<phi>) = false\<^sub>n R\<^sub>n (ltlc_to_ltln' True \<phi>)"
| "ltlc_to_ltln' True (G\<^sub>c \<phi>) = true\<^sub>n U\<^sub>n (ltlc_to_ltln' True \<phi>)"
| "ltlc_to_ltln' True (\<phi> U\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) R\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (\<phi> R\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) U\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (\<phi> W\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) M\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' True (\<phi> M\<^sub>c \<psi>) = (ltlc_to_ltln' True \<phi>) W\<^sub>n (ltlc_to_ltln' True \<psi>)"
| "ltlc_to_ltln' b (not\<^sub>c \<phi>) = ltlc_to_ltln' (\<not> b) \<phi>"
| "ltlc_to_ltln' b (X\<^sub>c \<phi>) = X\<^sub>n (ltlc_to_ltln' b \<phi>)"

fun ltlc_to_ltln :: "'a ltlc \<Rightarrow> 'a ltln"
where
  "ltlc_to_ltln \<phi> = ltlc_to_ltln' False \<phi>"

fun ltln_to_ltlc :: "'a ltln \<Rightarrow> 'a ltlc"
where
  "ltln_to_ltlc true\<^sub>n = true\<^sub>c"
| "ltln_to_ltlc false\<^sub>n = false\<^sub>c"
| "ltln_to_ltlc prop\<^sub>n(q) = prop\<^sub>c(q)"
| "ltln_to_ltlc nprop\<^sub>n(q) = not\<^sub>c (prop\<^sub>c(q))"
| "ltln_to_ltlc (\<phi> and\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> and\<^sub>c ltln_to_ltlc \<psi>)"
| "ltln_to_ltlc (\<phi> or\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> or\<^sub>c ltln_to_ltlc \<psi>)"
| "ltln_to_ltlc (X\<^sub>n \<phi>) = (X\<^sub>c ltln_to_ltlc \<phi>)"
| "ltln_to_ltlc (\<phi> U\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> U\<^sub>c ltln_to_ltlc \<psi>)"
| "ltln_to_ltlc (\<phi> R\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> R\<^sub>c ltln_to_ltlc \<psi>)"
| "ltln_to_ltlc (\<phi> W\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> W\<^sub>c ltln_to_ltlc \<psi>)"
| "ltln_to_ltlc (\<phi> M\<^sub>n \<psi>) = (ltln_to_ltlc \<phi> M\<^sub>c ltln_to_ltlc \<psi>)"

lemma ltlc_to_ltln'_correct:
  "w \<Turnstile>\<^sub>n (ltlc_to_ltln' True \<phi>) \<longleftrightarrow> \<not> w \<Turnstile>\<^sub>c \<phi>"
  "w \<Turnstile>\<^sub>n (ltlc_to_ltln' False \<phi>) \<longleftrightarrow> w \<Turnstile>\<^sub>c \<phi>"
  "size (ltlc_to_ltln' True \<phi>) \<le> 2 * size \<phi>"
  "size (ltlc_to_ltln' False \<phi>) \<le> 2 * size \<phi>"
  by (induction \<phi> arbitrary: w) simp+

lemma ltlc_to_ltln_semantics [simp]:
  "w \<Turnstile>\<^sub>n ltlc_to_ltln \<phi> \<longleftrightarrow> w \<Turnstile>\<^sub>c \<phi>"
  using ltlc_to_ltln'_correct by auto

lemma ltlc_to_ltln_size:
  "size (ltlc_to_ltln \<phi>) \<le> 2 * size \<phi>"
  using ltlc_to_ltln'_correct by simp

lemma ltln_to_ltlc_semantics [simp]:
  "w \<Turnstile>\<^sub>c ltln_to_ltlc \<phi> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<phi>"
  by (induction \<phi> arbitrary: w) simp+

lemma ltlc_to_ltln_atoms:
  "atoms_ltln (ltlc_to_ltln \<phi>) = atoms_ltlc \<phi>"
proof -
  have "atoms_ltln (ltlc_to_ltln' True \<phi>) = atoms_ltlc \<phi>"
    "atoms_ltln (ltlc_to_ltln' False \<phi>) = atoms_ltlc \<phi>"
    by (induction \<phi>) simp+
  thus ?thesis
    by simp
qed

subsubsection \<open>Negation\<close>

fun not\<^sub>n
where
  "not\<^sub>n true\<^sub>n = false\<^sub>n"
| "not\<^sub>n false\<^sub>n = true\<^sub>n"
| "not\<^sub>n prop\<^sub>n(a) = nprop\<^sub>n(a)"
| "not\<^sub>n nprop\<^sub>n(a) = prop\<^sub>n(a)"
| "not\<^sub>n (\<phi> and\<^sub>n \<psi>) = (not\<^sub>n \<phi>) or\<^sub>n (not\<^sub>n \<psi>)"
| "not\<^sub>n (\<phi> or\<^sub>n \<psi>) = (not\<^sub>n \<phi>) and\<^sub>n (not\<^sub>n \<psi>)"
| "not\<^sub>n (X\<^sub>n \<phi>) = X\<^sub>n (not\<^sub>n \<phi>)"
| "not\<^sub>n (\<phi> U\<^sub>n \<psi>) = (not\<^sub>n \<phi>) R\<^sub>n (not\<^sub>n \<psi>)"
| "not\<^sub>n (\<phi> R\<^sub>n \<psi>) = (not\<^sub>n \<phi>) U\<^sub>n (not\<^sub>n \<psi>)"
| "not\<^sub>n (\<phi> W\<^sub>n \<psi>) = (not\<^sub>n \<phi>) M\<^sub>n (not\<^sub>n \<psi>)"
| "not\<^sub>n (\<phi> M\<^sub>n \<psi>) = (not\<^sub>n \<phi>) W\<^sub>n (not\<^sub>n \<psi>)"

lemma not\<^sub>n_semantics[simp]:
  "w \<Turnstile>\<^sub>n not\<^sub>n \<phi> \<longleftrightarrow> \<not> w \<Turnstile>\<^sub>n \<phi>"
  by (induction \<phi> arbitrary: w) auto

lemma not\<^sub>n_size:
  "size (not\<^sub>n \<phi>) = size \<phi>"
  by (induction \<phi>) auto


subsubsection \<open>Subformulas\<close>

fun subfrmlsn :: "'a ltln \<Rightarrow> 'a ltln set"
where
  "subfrmlsn (\<phi> and\<^sub>n \<psi>) = {\<phi> and\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn (\<phi> or\<^sub>n \<psi>) = {\<phi> or\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn (X\<^sub>n \<phi>) = {X\<^sub>n \<phi>} \<union> subfrmlsn \<phi>"
| "subfrmlsn (\<phi> U\<^sub>n \<psi>) = {\<phi> U\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn (\<phi> R\<^sub>n \<psi>) = {\<phi> R\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn (\<phi> W\<^sub>n \<psi>) = {\<phi> W\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn (\<phi> M\<^sub>n \<psi>) = {\<phi> M\<^sub>n \<psi>} \<union> subfrmlsn \<phi> \<union> subfrmlsn \<psi>"
| "subfrmlsn \<phi> = {\<phi>}"

lemma subfrmlsn_id[simp]:
  "\<phi> \<in> subfrmlsn \<phi>"
  by (induction \<phi>) auto

lemma subfrmlsn_finite:
  "finite (subfrmlsn \<phi>)"
  by (induction \<phi>) auto

lemma subfrmlsn_card:
  "card (subfrmlsn \<phi>) \<le> size \<phi>"
  by (induction \<phi>) (simp_all add: card_insert_if subfrmlsn_finite, (meson add_le_mono card_Un_le dual_order.trans le_SucI)+)

lemma subfrmlsn_subset:
  "\<psi> \<in> subfrmlsn \<phi> \<Longrightarrow> subfrmlsn \<psi> \<subseteq> subfrmlsn \<phi>"
  by (induction \<phi>) auto

lemma subfrmlsn_size:
  "\<psi> \<in> subfrmlsn \<phi> \<Longrightarrow> size \<psi> < size \<phi> \<or> \<psi> = \<phi>"
  by (induction \<phi>) auto

abbreviation
  "size_set S \<equiv> sum (\<lambda>x. 2 * size x + 1) S"

lemma size_set_diff:
  "finite S \<Longrightarrow> S' \<subseteq> S \<Longrightarrow> size_set (S - S') = size_set S - size_set S'"
  using sum_diff_nat finite_subset by metis


subsubsection \<open>Constant Folding\<close>

lemma U_consts[intro, simp]:
  "w \<Turnstile>\<^sub>n \<phi> U\<^sub>n true\<^sub>n"
  "\<not> (w \<Turnstile>\<^sub>n \<phi> U\<^sub>n false\<^sub>n)"
  "(w \<Turnstile>\<^sub>n false\<^sub>n U\<^sub>n \<phi>) = (w \<Turnstile>\<^sub>n \<phi>)"
  by force+

lemma R_consts[intro, simp]:
  "w \<Turnstile>\<^sub>n \<phi> R\<^sub>n true\<^sub>n"
  "\<not> (w \<Turnstile>\<^sub>n \<phi> R\<^sub>n false\<^sub>n)"
  "(w \<Turnstile>\<^sub>n true\<^sub>n R\<^sub>n \<phi>) = (w \<Turnstile>\<^sub>n \<phi>)"
  by force+

lemma W_consts[intro, simp]:
  "w \<Turnstile>\<^sub>n true\<^sub>n W\<^sub>n \<phi>"
  "w \<Turnstile>\<^sub>n \<phi> W\<^sub>n true\<^sub>n"
  "(w \<Turnstile>\<^sub>n false\<^sub>n W\<^sub>n \<phi>) = (w \<Turnstile>\<^sub>n \<phi>)"
  "(w \<Turnstile>\<^sub>n \<phi> W\<^sub>n false\<^sub>n) = (w \<Turnstile>\<^sub>n G\<^sub>n \<phi>)"
  by force+

lemma M_consts[intro, simp]:
  "\<not> (w \<Turnstile>\<^sub>n false\<^sub>n M\<^sub>n \<phi>)"
  "\<not> (w \<Turnstile>\<^sub>n \<phi> M\<^sub>n false\<^sub>n)"
  "(w \<Turnstile>\<^sub>n true\<^sub>n M\<^sub>n \<phi>) = (w \<Turnstile>\<^sub>n \<phi>)"
  "(w \<Turnstile>\<^sub>n \<phi> M\<^sub>n true\<^sub>n) = (w \<Turnstile>\<^sub>n F\<^sub>n \<phi>)"
  by force+


subsubsection \<open>Distributivity\<close>

lemma until_and_left_distrib:
  "w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2) U\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 U\<^sub>n \<psi>) and\<^sub>n (\<phi>\<^sub>2 U\<^sub>n \<psi>)"
proof
  assume "w \<Turnstile>\<^sub>n \<phi>\<^sub>1 U\<^sub>n \<psi> and\<^sub>n \<phi>\<^sub>2 U\<^sub>n \<psi>"

  then obtain i1 i2 where "suffix i1 w \<Turnstile>\<^sub>n \<psi> \<and> (\<forall>j<i1. suffix j w \<Turnstile>\<^sub>n \<phi>\<^sub>1)" and "suffix i2 w \<Turnstile>\<^sub>n \<psi> \<and> (\<forall>j<i2. suffix j w \<Turnstile>\<^sub>n \<phi>\<^sub>2)"
    by auto

  then have "suffix (min i1 i2) w \<Turnstile>\<^sub>n \<psi> \<and> (\<forall>j<min i1 i2. suffix j w \<Turnstile>\<^sub>n \<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2)"
    by (simp add: min_def)

  then show "w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2) U\<^sub>n \<psi>"
    by force
qed auto

lemma until_or_right_distrib:
  "w \<Turnstile>\<^sub>n \<phi> U\<^sub>n (\<psi>\<^sub>1 or\<^sub>n \<psi>\<^sub>2) \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi> U\<^sub>n \<psi>\<^sub>1) or\<^sub>n (\<phi> U\<^sub>n \<psi>\<^sub>2)"
  by auto

lemma release_and_right_distrib:
  "w \<Turnstile>\<^sub>n \<phi> R\<^sub>n (\<psi>\<^sub>1 and\<^sub>n \<psi>\<^sub>2) \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi> R\<^sub>n \<psi>\<^sub>1) and\<^sub>n (\<phi> R\<^sub>n \<psi>\<^sub>2)"
  by auto

lemma release_or_left_distrib:
  "w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 or\<^sub>n \<phi>\<^sub>2) R\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 R\<^sub>n \<psi>) or\<^sub>n (\<phi>\<^sub>2 R\<^sub>n \<psi>)"
  by (metis not\<^sub>n.simps(6) not\<^sub>n.simps(9) not\<^sub>n_semantics until_and_left_distrib)

lemma strong_release_and_right_distrib:
  "w \<Turnstile>\<^sub>n \<phi> M\<^sub>n (\<psi>\<^sub>1 and\<^sub>n \<psi>\<^sub>2) \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi> M\<^sub>n \<psi>\<^sub>1) and\<^sub>n (\<phi> M\<^sub>n \<psi>\<^sub>2)"
proof
  assume "w \<Turnstile>\<^sub>n (\<phi> M\<^sub>n \<psi>\<^sub>1) and\<^sub>n (\<phi> M\<^sub>n \<psi>\<^sub>2)"

  then obtain i1 i2 where "suffix i1 w \<Turnstile>\<^sub>n \<phi> \<and> (\<forall>j\<le>i1. suffix j w \<Turnstile>\<^sub>n \<psi>\<^sub>1)" and "suffix i2 w \<Turnstile>\<^sub>n \<phi> \<and> (\<forall>j\<le>i2. suffix j w \<Turnstile>\<^sub>n \<psi>\<^sub>2)"
    by auto

  then have "suffix (min i1 i2) w \<Turnstile>\<^sub>n \<phi> \<and> (\<forall>j\<le>min i1 i2. suffix j w \<Turnstile>\<^sub>n \<psi>\<^sub>1 and\<^sub>n \<psi>\<^sub>2)"
    by (simp add: min_def)

  then show "w \<Turnstile>\<^sub>n \<phi> M\<^sub>n (\<psi>\<^sub>1 and\<^sub>n \<psi>\<^sub>2)"
    by force
qed auto

lemma strong_release_or_left_distrib:
  "w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 or\<^sub>n \<phi>\<^sub>2) M\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 M\<^sub>n \<psi>) or\<^sub>n (\<phi>\<^sub>2 M\<^sub>n \<psi>)"
  by auto

lemma weak_until_and_left_distrib:
  "w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 and\<^sub>n \<phi>\<^sub>2) W\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi>\<^sub>1 W\<^sub>n \<psi>) and\<^sub>n (\<phi>\<^sub>2 W\<^sub>n \<psi>)"
  by auto

lemma weak_until_or_right_distrib:
  "w \<Turnstile>\<^sub>n \<phi> W\<^sub>n (\<psi>\<^sub>1 or\<^sub>n \<psi>\<^sub>2) \<longleftrightarrow> w \<Turnstile>\<^sub>n (\<phi> W\<^sub>n \<psi>\<^sub>1) or\<^sub>n (\<phi> W\<^sub>n \<psi>\<^sub>2)"
  by (metis not\<^sub>n.simps(10) not\<^sub>n.simps(6) not\<^sub>n_semantics strong_release_and_right_distrib)


lemma next_until_distrib:
  "w \<Turnstile>\<^sub>n X\<^sub>n (\<phi> U\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n (X\<^sub>n \<phi>) U\<^sub>n (X\<^sub>n \<psi>)"
  by auto

lemma next_release_distrib:
  "w \<Turnstile>\<^sub>n X\<^sub>n (\<phi> R\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n (X\<^sub>n \<phi>) R\<^sub>n (X\<^sub>n \<psi>)"
  by auto

lemma next_weak_until_distrib:
  "w \<Turnstile>\<^sub>n X\<^sub>n (\<phi> W\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n (X\<^sub>n \<phi>) W\<^sub>n (X\<^sub>n \<psi>)"
  by auto

lemma next_strong_release_distrib:
  "w \<Turnstile>\<^sub>n X\<^sub>n (\<phi> M\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n (X\<^sub>n \<phi>) M\<^sub>n (X\<^sub>n \<psi>)"
  by auto


subsubsection \<open>Nested operators\<close>

lemma finally_until[simp]:
  "w \<Turnstile>\<^sub>n F\<^sub>n (\<phi> U\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n F\<^sub>n \<psi>"
  by auto force

lemma globally_release[simp]:
  "w \<Turnstile>\<^sub>n G\<^sub>n (\<phi> R\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n G\<^sub>n \<psi>"
  by auto force

lemma globally_weak_until[simp]:
  "w \<Turnstile>\<^sub>n G\<^sub>n (\<phi> W\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n G\<^sub>n (\<phi> or\<^sub>n \<psi>)"
  by auto force

lemma finally_strong_release[simp]:
  "w \<Turnstile>\<^sub>n F\<^sub>n (\<phi> M\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n F\<^sub>n (\<phi> and\<^sub>n \<psi>)"
  by auto force


subsubsection \<open>Weak and strong operators\<close>

lemma ltln_weak_strong:
  "w \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (G\<^sub>n \<phi>) or\<^sub>n (\<phi> U\<^sub>n \<psi>)"
  "w \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (G\<^sub>n \<psi>) or\<^sub>n (\<phi> M\<^sub>n \<psi>)"
proof auto
  fix i
  assume "\<forall>i. suffix i w \<Turnstile>\<^sub>n \<phi> \<or> (\<exists>j\<le>i. suffix j w \<Turnstile>\<^sub>n \<psi>)"
    and "\<forall>i. suffix i w \<Turnstile>\<^sub>n \<psi> \<longrightarrow> (\<exists>j<i. \<not> suffix j w \<Turnstile>\<^sub>n \<phi>)"

  then show "suffix i w \<Turnstile>\<^sub>n \<phi>"
    by (induction i rule: less_induct) force
next
  fix i k
  assume "\<forall>j\<le>i. \<not> suffix j w \<Turnstile>\<^sub>n \<psi>"
    and "suffix k w \<Turnstile>\<^sub>n \<psi>"
    and "\<forall>j<k. suffix j w \<Turnstile>\<^sub>n \<phi>"

  then show "suffix i w \<Turnstile>\<^sub>n \<phi>"
    by (cases "i < k") simp_all
next
  fix i
  assume "\<forall>i. suffix i w \<Turnstile>\<^sub>n \<psi> \<or> (\<exists>j<i. suffix j w \<Turnstile>\<^sub>n \<phi>)"
    and "\<forall>i. suffix i w \<Turnstile>\<^sub>n \<phi> \<longrightarrow> (\<exists>j\<le>i. \<not> suffix j w \<Turnstile>\<^sub>n \<psi>)"

  then show "suffix i w \<Turnstile>\<^sub>n \<psi>"
    by (induction i rule: less_induct) force
next
  fix i k
  assume "\<forall>j<i. \<not> suffix j w \<Turnstile>\<^sub>n \<phi>"
    and "suffix k w \<Turnstile>\<^sub>n \<phi>"
    and "\<forall>j\<le>k. suffix j w \<Turnstile>\<^sub>n \<psi>"

  then show "suffix i w \<Turnstile>\<^sub>n \<psi>"
    by (cases "i \<le> k") simp_all
qed

lemma ltln_strong_weak:
  "w \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (F\<^sub>n \<psi>) and\<^sub>n (\<phi> W\<^sub>n \<psi>)"
  "w \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n (F\<^sub>n \<phi>) and\<^sub>n (\<phi> R\<^sub>n \<psi>)"
  by (metis ltln_weak_strong not\<^sub>n.simps(1,5,8-11) not\<^sub>n_semantics)+

lemma ltln_strong_to_weak:
  "w \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi>"
  "w \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi>"
  using ltln_weak_strong by simp_all blast+

lemma ltln_weak_to_strong:
  "\<lbrakk>w \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi>; \<not> w \<Turnstile>\<^sub>n G\<^sub>n \<phi>\<rbrakk> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi>"
  "\<lbrakk>w \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi>; w \<Turnstile>\<^sub>n F\<^sub>n \<psi>\<rbrakk> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi>"
  "\<lbrakk>w \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi>; \<not> w \<Turnstile>\<^sub>n G\<^sub>n \<psi>\<rbrakk> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi>"
  "\<lbrakk>w \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi>; w \<Turnstile>\<^sub>n F\<^sub>n \<phi>\<rbrakk> \<Longrightarrow> w \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi>"
  unfolding ltln_weak_strong[of w \<phi> \<psi>] by auto


lemma ltln_StrongRelease_to_Until:
  "w \<Turnstile>\<^sub>n \<phi> M\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<psi> U\<^sub>n (\<phi> and\<^sub>n \<psi>)"
  using order.order_iff_strict by auto

lemma ltln_Release_to_WeakUntil:
  "w \<Turnstile>\<^sub>n \<phi> R\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<psi> W\<^sub>n (\<phi> and\<^sub>n \<psi>)"
  by (meson ltln_StrongRelease_to_Until ltln_weak_strong semantics_ltln.simps(6))

lemma ltln_WeakUntil_to_Release:
  "w \<Turnstile>\<^sub>n \<phi> W\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<psi> R\<^sub>n (\<phi> or\<^sub>n \<psi>)"
  by (metis ltln_StrongRelease_to_Until not\<^sub>n.simps(6,9,10) not\<^sub>n_semantics)

lemma ltln_Until_to_StrongRelease:
  "w \<Turnstile>\<^sub>n \<phi> U\<^sub>n \<psi> \<longleftrightarrow> w \<Turnstile>\<^sub>n \<psi> M\<^sub>n (\<phi> or\<^sub>n \<psi>)"
  by (metis ltln_Release_to_WeakUntil not\<^sub>n.simps(6,8,11) not\<^sub>n_semantics)


subsubsection \<open>GF and FG semantics\<close>

lemma GF_suffix:
  "suffix i w \<Turnstile>\<^sub>n G\<^sub>n (F\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n G\<^sub>n (F\<^sub>n \<psi>)"
  by auto (metis ab_semigroup_add_class.add_ac(1) add.left_commute)

lemma FG_suffix:
  "suffix i w \<Turnstile>\<^sub>n F\<^sub>n (G\<^sub>n \<psi>) \<longleftrightarrow> w \<Turnstile>\<^sub>n F\<^sub>n (G\<^sub>n \<psi>)"
  by (auto simp: algebra_simps) (metis add.commute add.left_commute)

lemma GF_Inf_many:
  "w \<Turnstile>\<^sub>n G\<^sub>n (F\<^sub>n \<phi>) \<longleftrightarrow> (\<exists>\<^sub>\<infinity> i. suffix i w \<Turnstile>\<^sub>n \<phi>)"
  unfolding INFM_nat_le
  by simp (blast dest: le_Suc_ex intro: le_add1)

lemma FG_Alm_all:
  "w \<Turnstile>\<^sub>n F\<^sub>n (G\<^sub>n \<phi>) \<longleftrightarrow> (\<forall>\<^sub>\<infinity> i. suffix i w \<Turnstile>\<^sub>n \<phi>)"
  unfolding MOST_nat_le
  by simp (blast dest: le_Suc_ex intro: le_add1)


(* TODO: move to Infinite_Set.thy ?? *)
lemma MOST_nat_add:
  "(\<infinity>i::nat. P i) (\<infinity>i. P (i + j))"
  by (simp add: cofinite_eq_sequentially)

lemma INFM_nat_add:
  "(\<infinity>i::nat. P i) (\<infinity>i. P (i + j))"
  using MOST_nat_add not_MOST not_INFM by blast


lemma FG_suffix_G:
  "w n Fn (Gn φ) ==> \<infinity>i. suffix i w n Gn φ"
proof -
  assume "w n Fn (Gn φ)"
  then have "w n Fn (Gn (Gn φ))"
    by (meson globally_release semantics_ltln.simps(8))
  then show "\<infinity>i. suffix i w n Gn φ"
    unfolding FG_Alm_all .
qed

lemma Alm_all_GF_F:
  "\<infinity>i. suffix i w n Gn (Fn ψ) suffix i w n Fn ψ"
  unfolding MOST_nat
proof standard+
  fix i :: nat
  assume "suffix i w n Gn (Fn ψ)"
  then show "suffix i w n Fn ψ"
    unfolding GF_Inf_many INFM_nat by fastforce
next
  fix i :: nat
  assume suffix: "suffix i w n Fn ψ"
  assume max: "i > Max {i. suffix i w n ψ}"

  with suffix obtain j where "j i" and j_suffix: "suffix j w n ψ"
    by simp (blast intro: le_add1)

  with max have j_max: "j > Max {i. suffix i w n ψ}"
    by fastforce

  show "suffix i w n Gn (Fn ψ)"
  proof (cases "w n Gn (Fn ψ)")
    case False
    then have "¬ (\<infinity>i. suffix i w n ψ)"
      unfolding GF_Inf_many by simp
    then have "finite {i. suffix i w n ψ}"
      by (simp add: INFM_iff_infinite)
    then have "i>Max {i. suffix i w n ψ}. ¬ suffix i w n ψ"
      using Max_ge not_le by auto
    then show ?thesis
      using j_suffix j_max by blast
  qed force
qed

lemma Alm_all_FG_G:
  "\<infinity>i. suffix i w n Fn (Gn ψ) suffix i w n Gn ψ"
  unfolding MOST_nat
proof standard+
  fix i :: nat
  assume "suffix i w n Gn ψ"
  then show "suffix i w n Fn (Gn ψ)"
    unfolding FG_Alm_all INFM_nat by fastforce
next
  fix i :: nat
  assume suffix: "suffix i w n Fn (Gn ψ)"
  assume max: "i > Max {i. ¬ suffix i w n Gn ψ}"

  with suffix have "\<infinity>j. suffix (i + j) w n Gn ψ"
    using FG_suffix_G[of "suffix i w"] suffix_suffix
    by fastforce
  then have "¬ (\<infinity>j. ¬ suffix j w n Gn ψ)"
    using MOST_nat_add[of "λi. suffix i w n Gn ψ" i]
    by (simp add: algebra_simps)
  then have "finite {i. ¬ suffix i w n Gn ψ}"
    by (simp add: INFM_iff_infinite)

  with max show "suffix i w n Gn ψ"
    using Max_ge leD by blast
qed


subsubsection Expansion

lemma ltln_expand_Until:
  n φ Un ψ n ψ orn (φ andn (Xn (φ Un ψ))))"
  (is "?lhs = ?rhs")
proof
  assume ?lhs
  then obtain i where "suffix i ξ n ψ"
    and "j<i. suffix j ξ n φ"
    by auto
  thus ?rhs
    by (cases i) auto
next
  assume ?rhs
  show ?lhs
  proof (cases n ψ")
    case False
    then have n φ" and n Xn (φ Un ψ)"
      using ?rhs by auto
    thus ?lhs
      using less_Suc_eq_0_disj suffix_singleton_suffix by force
  qed force
qed

lemma ltln_expand_Release:
  n φ Rn ψ n ψ andn (φ orn (Xn (φ Rn ψ))))"
  (is "?lhs = ?rhs")
proof
  assume ?lhs
  thus ?rhs
    using less_Suc_eq_0_disj by force
next
  assume ?rhs

  {
    fix i
    assume "¬ suffix i ξ n ψ"
    then have "j<i. suffix j ξ n φ"
      using ?rhs by (cases i) force+
  }

  thus ?lhs
    by auto
qed

lemma ltln_expand_WeakUntil:
  n φ Wn ψ n ψ orn (φ andn (Xn (φ Wn ψ))))"
  (is "?lhs = ?rhs")
proof
  assume ?lhs
  thus ?rhs
    by (metis ltln_expand_Release ltln_expand_Until ltln_weak_strong(1) semantics_ltln.simps(2,5,6,7))
next
  assume ?rhs

  {
    fix i
    assume "¬ suffix i ξ n φ"
    then have "ji. suffix j ξ n ψ"
      using ?rhs by (cases i) force+
  }

  thus ?lhs
    by auto
qed

lemma ltln_expand_StrongRelease:
  n φ Mn ψ n ψ andn (φ orn (Xn (φ Mn ψ))))"
  (is "?lhs = ?rhs")
proof
  assume ?lhs
  then obtain i where "suffix i ξ n φ"
    and "ji. suffix j ξ n ψ"
    by auto
  thus ?rhs
    by (cases i) auto
next
  assume ?rhs
  show ?lhs
  proof (cases n φ")
    case True
    thus ?lhs
      using ?rhs ltln_expand_WeakUntil by fastforce
  next
    case False
    thus ?lhs
      by (metis ?rhs ltln_expand_WeakUntil notn.simps(5,6,7,11) notn_semantics)
  qed
qed

lemma ltln_Release_alterdef:
  "w n φ Rn ψ w n (Gn ψ) orn (ψ Un (φ andn ψ))"
proof (cases "i. ¬suffix i w n ψ")
  case True
  define i where "i Least (λi. ¬suffix i w n ψ)"
  have "j. j < i ==> suffix j w n ψ" and "¬ suffix i w n ψ"
    using True LeastI not_less_Least unfolding i_def by fast+
  hence *: "i. suffix i w n ψ (j<i. suffix j w n φ) ==> (i. (suffix i w n ψ suffix i w n φ) (j<i. suffix j w n ψ))"
    by fastforce
  hence "i. (suffix i w n ψ suffix i w n φ) (j<i. suffix j w n ψ) ==> (i. suffix i w n ψ (j<i. suffix j w n φ))"
    using linorder_cases by blast
  thus ?thesis
    using True * by auto
qed auto




subsection LTL in restricted Negation Normal Form

text Some algorithms do not handle the operators W and M,
 hence we also provide a datatype without these two operators.


subsubsection Syntax

datatype (atoms_ltlr: 'a) ltlr =
    True_ltlr                               (truer)
  | False_ltlr                              (falser)
  | Prop_ltlr 'a                            (propr'(_'))
  | Nprop_ltlr 'a                           (npropr'(_'))
  | And_ltlr "'a ltlr" "'a ltlr"            (_ andr _ [82,8281)
  | Or_ltlr "'a ltlr" "'a ltlr"             (_ orr _ [84,8483)
  | Next_ltlr "'a ltlr"                     (Xr _ [8887)
  | Until_ltlr "'a ltlr" "'a ltlr"          (_ Ur _ [84,8483)
  | Release_ltlr "'a ltlr" "'a ltlr"        (_ Rr _ [84,8483)


subsubsection Semantics

primrec semantics_ltlr :: "['a set word, 'a ltlr] ==> bool" (_ r _ [80,8080)
where
  r truer = True"
r falser = False"
r propr(q) = (q ξ 0)"
r npropr(q) = (q ξ 0)"
r φ andr ψ = (ξ r φ ξ r ψ)"
r φ orr ψ = (ξ r φ ξ r ψ)"
r Xr φ = (suffix 1 ξ r φ)"
r φ Ur ψ = (i. suffix i ξ r ψ (j<i. suffix j ξ r φ))"
r φ Rr ψ = (i. suffix i ξ r ψ (j<i. suffix j ξ r φ))"


subsubsection Conversion

fun ltln_to_ltlr :: "'a ltln ==> 'a ltlr"
where
  "ltln_to_ltlr truen = truer"
"ltln_to_ltlr falsen = falser"
"ltln_to_ltlr propn(a) = propr(a)"
"ltln_to_ltlr npropn(a) = npropr(a)"
"ltln_to_ltlr (φ andn ψ) = (ltln_to_ltlr φ) andr (ltln_to_ltlr ψ)"
"ltln_to_ltlr (φ orn ψ) = (ltln_to_ltlr φ) orr (ltln_to_ltlr ψ)"
"ltln_to_ltlr (Xn φ) = Xr (ltln_to_ltlr φ)"
"ltln_to_ltlr (φ Un ψ) = (ltln_to_ltlr φ) Ur (ltln_to_ltlr ψ)"
"ltln_to_ltlr (φ Rn ψ) = (ltln_to_ltlr φ) Rr (ltln_to_ltlr ψ)"
"ltln_to_ltlr (φ Wn ψ) = (ltln_to_ltlr ψ) Rr ((ltln_to_ltlr φ) orr (ltln_to_ltlr ψ))"
"ltln_to_ltlr (φ Mn ψ) = (ltln_to_ltlr ψ) Ur ((ltln_to_ltlr φ) andr (ltln_to_ltlr ψ))"

fun ltlr_to_ltln :: "'a ltlr ==> 'a ltln"
where
  "ltlr_to_ltln truer = truen"
"ltlr_to_ltln falser = falsen"
"ltlr_to_ltln propr(a) = propn(a)"
"ltlr_to_ltln npropr(a) = npropn(a)"
"ltlr_to_ltln (φ andr ψ) = (ltlr_to_ltln φ) andn (ltlr_to_ltln ψ)"
"ltlr_to_ltln (φ orr ψ) = (ltlr_to_ltln φ) orn (ltlr_to_ltln ψ)"
"ltlr_to_ltln (Xr φ) = Xn (ltlr_to_ltln φ)"
"ltlr_to_ltln (φ Ur ψ) = (ltlr_to_ltln φ) Un (ltlr_to_ltln ψ)"
"ltlr_to_ltln (φ Rr ψ) = (ltlr_to_ltln φ) Rn (ltlr_to_ltln ψ)"

lemma ltln_to_ltlr_semantics:
  "w r ltln_to_ltlr φ w n φ"
  by (induction φ arbitrary: w) (unfold ltln_WeakUntil_to_Release ltln_StrongRelease_to_Until, simp_all)

lemma ltlr_to_ltln_semantics:
  "w n ltlr_to_ltln φ w r φ"
  by (induction φ arbitrary: w) simp_all


subsubsection Negation

fun notr
where
  "notr truer = falser"
"notr falser = truer"
"notr propr(a) = npropr(a)"
"notr npropr(a) = propr(a)"
"notr (φ andr ψ) = (notr φ) orr (notr ψ)"
"notr (φ orr ψ) = (notr φ) andr (notr ψ)"
"notr (Xr φ) = Xr (notr φ)"
"notr (φ Ur ψ) = (notr φ) Rr (notr ψ)"
"notr (φ Rr ψ) = (notr φ) Ur (notr ψ)"

lemma notr_semantics [simp]:
  "w r notr φ ¬ w r φ"
  by (induction φ arbitrary: w) auto


subsubsection Subformulas

fun subfrmlsr :: "'a ltlr ==> 'a ltlr set"
where
  "subfrmlsr (φ andr ψ) = {φ andr ψ} subfrmlsr φ subfrmlsr ψ"
"subfrmlsr (φ orr ψ) = {φ orr ψ} subfrmlsr φ subfrmlsr ψ"
"subfrmlsr (φ Ur ψ) = {φ Ur ψ} subfrmlsr φ subfrmlsr ψ"
"subfrmlsr (φ Rr ψ) = {φ Rr ψ} subfrmlsr φ subfrmlsr ψ"
"subfrmlsr (Xr φ) = {Xr φ} subfrmlsr φ"
"subfrmlsr x = {x}"

lemma subfrmlsr_id[simp]:
   subfrmlsr φ"
  by (induction φ) auto

lemma subfrmlsr_finite:
  "finite (subfrmlsr φ)"
  by (induction φ) auto

lemma subfrmlsr_subset:
   subfrmlsr φ ==> subfrmlsr ψ subfrmlsr φ"
  by (induction φ) auto

lemma subfrmlsr_size:
   subfrmlsr φ ==> size ψ < size φ ψ = φ"
  by (induction φ) auto


subsubsection Expansion lemmas

lemma ltlr_expand_Until:
  r φ Ur ψ r ψ orr (φ andr (Xr (φ Ur ψ))))"
  by (metis ltln_expand_Until ltlr_to_ltln.simps(5-8) ltlr_to_ltln_semantics)

lemma ltlr_expand_Release:
  r φ Rr ψ r ψ andr (φ orr (Xr (φ Rr ψ))))"
  by (metis ltln_expand_Release ltlr_to_ltln.simps(5-7,9) ltlr_to_ltln_semantics)




subsection Propositional LTL

text We define the syntax and semantics of propositional linear-time
 temporal logic PLTL.
 PLTL formulas are built from atomic formulas, propositional connectives,
 and the temporal operators ``next'' and ``until''. The following data
 type definition is parameterized by the type of states over which
 formulas are evaluated.


subsubsection Syntax

datatype 'a pltl  =
    False_ltlp                       (falsep)
  | Atom_ltlp "'a ==> bool"           (atomp'(_'))
  | Implies_ltlp "'a pltl" "'a pltl" (_ impliesp _ [81,8180)
  | Next_ltlp "'a pltl"              (Xp _ [8887)
  | Until_ltlp "'a pltl" "'a pltl"   (_ Up _ [84,8483)

 Further connectives of PLTL can be defined in terms of the existing syntax.

definition Not_ltlp (notp _ [8585)
where
  "notp φ φ impliesp falsep"

definition True_ltlp (truep)
where
  "truep notp falsep"

definition Or_ltlp (_ orp _ [81,8180)
where
  "φ orp ψ (notp φ) impliesp ψ"

definition And_ltlp (_ andp _ [82,8281)
where
  "φ andp ψ notp ((notp φ) orp (notp ψ))"

definition Eventually_ltlp (Fp _ [8887)
where
  "Fp φ truep Up φ"

definition Always_ltlp (Gp _ [8887)
where
  "Gp φ notp (Fp (notp φ))"

definition Release_ltlp (_ Rp _ [84,8483)
where
  "φ Rp ψ notp ((notp φ) Up (notp ψ))"

definition WeakUntil_ltlp (_ Wp _ [84,8483)
where
  "φ Wp ψ ψ Rp (φ orp ψ)"

definition StrongRelease_ltlp (_ Mp _ [84,8483)
where
  "φ Mp ψ ψ Up (φ andp ψ)"


subsubsection Semantics

fun semantics_pltl :: "['a word, 'a pltl] ==> bool" (_ p _ [80,8080)
where
  "w p falsep = False"
"w p atomp(p) = (p (w 0))"
"w p φ impliesp ψ = (w p φ w p ψ)"
"w p Xp φ = (suffix 1 w p φ)"
"w p φ Up ψ = (i. suffix i w p ψ (j<i. suffix j w p φ))"

lemma semantics_pltl_sugar [simp]:
  "w p notp φ = (¬w p φ)"
  "w p truep = True"
  "w p φ orp ψ = (w p φ w p ψ)"
  "w p φ andp ψ = (w p φ w p ψ)"
  "w p Fp φ = (i. suffix i w p φ)"
  "w p Gp φ = (i. suffix i w p φ)"
  "w p φ Rp ψ = (i. suffix i w p ψ (j<i. suffix j w p φ))"
  "w p φ Wp ψ = (i. suffix i w p φ (ji. suffix j w p ψ))"
  "w p φ Mp ψ = (i. suffix i w p φ (ji. suffix j w p ψ))"
  by (auto simp: Not_ltlp_def True_ltlp_def Or_ltlp_def And_ltlp_def Eventually_ltlp_def Always_ltlp_def Release_ltlp_def WeakUntil_ltlp_def StrongRelease_ltlp_def) (insert le_neq_implies_less, blast)+

definition "language_ltlp φ {ξ. ξ p φ}"


subsubsection Conversion

fun ltlc_to_pltl :: "'a ltlc ==> 'a set pltl"
where
  "ltlc_to_pltl truec = truep"
"ltlc_to_pltl falsec = falsep"
"ltlc_to_pltl (propc(q)) = atomp(() q)"
"ltlc_to_pltl (notc φ) = notp (ltlc_to_pltl φ)"
"ltlc_to_pltl (φ andc ψ) = (ltlc_to_pltl φ) andp (ltlc_to_pltl ψ)"
"ltlc_to_pltl (φ orc ψ) = (ltlc_to_pltl φ) orp (ltlc_to_pltl ψ)"
"ltlc_to_pltl (φ impliesc ψ) = (ltlc_to_pltl φ) impliesp (ltlc_to_pltl ψ)"
"ltlc_to_pltl (Xc φ) = Xp (ltlc_to_pltl φ)"
"ltlc_to_pltl (Fc φ) = Fp (ltlc_to_pltl φ)"
"ltlc_to_pltl (Gc φ) = Gp (ltlc_to_pltl φ)"
"ltlc_to_pltl (φ Uc ψ) = (ltlc_to_pltl φ) Up (ltlc_to_pltl ψ)"
"ltlc_to_pltl (φ Rc ψ) = (ltlc_to_pltl φ) Rp (ltlc_to_pltl ψ)"
"ltlc_to_pltl (φ Wc ψ) = (ltlc_to_pltl φ) Wp (ltlc_to_pltl ψ)"
"ltlc_to_pltl (φ Mc ψ) = (ltlc_to_pltl φ) Mp (ltlc_to_pltl ψ)"

lemma ltlc_to_pltl_semantics [simp]:
  "w p (ltlc_to_pltl φ) w c φ"
  by (induction φ arbitrary: w) simp_all


subsubsection Atoms

fun atoms_pltl :: "'a pltl ==> ('a ==> bool) set"
where
  "atoms_pltl falsep = {}"
"atoms_pltl atomp(p) = {p}"
"atoms_pltl (φ impliesp ψ) = atoms_pltl φ atoms_pltl ψ"
"atoms_pltl (Xp φ) = atoms_pltl φ"
"atoms_pltl (φ Up ψ) = atoms_pltl φ atoms_pltl ψ"

lemma atoms_finite [iff]:
  "finite (atoms_pltl φ)"
  by (induct φ) auto

lemma atoms_pltl_sugar [simp]:
  "atoms_pltl (notp φ) = atoms_pltl φ"
  "atoms_pltl truep = {}"
  "atoms_pltl (φ orp ψ) = atoms_pltl φ atoms_pltl ψ"
  "atoms_pltl (φ andp ψ) = atoms_pltl φ atoms_pltl ψ"
  "atoms_pltl (Fp φ) = atoms_pltl φ"
  "atoms_pltl (Gp φ) = atoms_pltl φ"
  by (auto simp: Not_ltlp_def True_ltlp_def Or_ltlp_def And_ltlp_def Eventually_ltlp_def Always_ltlp_def)

end

Messung V0.5 in Prozent
C=69 H=91 G=80

¤ Dauer der Verarbeitung: 0.195 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen



NIST Cobol Testsuite



Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

      Eigene Quellcodes
      Fremde Quellcodes
     Quellcodebibliothek
      Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge