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 open truec )
imports
Main falsec ›
begin
text ‹ opennotc _›
\ begin { enumerate }
\ item LTL with syntactic sugar . This variant is ic e uded parser
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 translation to automata implemented ented n entries es
\ 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
\ quivalence alence nce and unifies m <
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 > ) "
This ormalization s as reference ntics cs . \ >
subsubsection \ < open > ntax x < 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 . ffix xi \ < Turnstile > \ < ^ sub > c \ < phi and ( \ < forall > j \ < le > i ix < > \ < ^ sub > c \ < psi > ) )
| Not_ltlc " ' a ltlc " ( \ < open > not \ < ^ sub > c _ \ < close > [ 85 ] 85 )
| And_ltlc " ' a ltlc lc > and \ < ^ sub > c _ \ < close > [ 82 , 82 ] 81 )
" a lc " ( \ < open > _ or \ < ^ sub > c _ \ < close > [ 81 , 81 ] 80 )
| Implies_ltlc a c " " ' a ltlc tlc ( ( < > _ ies > _ \ < close > [ 81 , 81 ] 80 )
| Next_ltlc " ' a ltlc " \ < \ < Turnstile > \ < ^ sub > c G c \ < 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_ltlc ltlc \ > _ \ ^ sub c _ \ < 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 using order_iff_strict ct by o
subsubsection \ by son tl_Release_StrongRelease_con gRelease_Until_con til_WeakUntil_con mantics_ltlc ltlc ps )
primrec semantics_ltlc : : " set d ltlc < > ool " ( > _ < urnstile > \ < ^ sub > c _ \ < close > [ 80 , 80 ] 80 )
where
" \ < xi > \ < Turnstile > \ < ^ sub > c true \ < ^ sub > c = True "
| " _ x :
| " \ < xi > \ < Turnstile > \ < ^ sub c p < sub ( q ) = ( q \ < in > \ < xi > 0 ) "
| ( pw_eq_on_def th
| " \ < xi > \ < Turnstile > ^ ub c \ < phi > and \ < ^ sub > c \ < psi > = ( \ < xi > \ < Turnstile > \ < ^ sub > c \ < phi > \ < and > \ < xi > \ < Turnstile > \ < ^ sub > c \ < psi > ) "
| " \ < xi > \ < Turnstile > \ < elease_ltlc
| " \ < xi thus java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
| " \ < xi > \ < Turnstile > \ < ^ sub > < ^ > \ < phi > \ < longleftrightarrow > ( map_props f o \ < xi > ) \ < Turnstile > \ < sub ltlc < > "
| " \ < 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 > < ) ) "
| " \ < xi notation nput 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 > \ ^ sub c \ < 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 > \ < ^ ub F < ^ 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 using o_ltln ct
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
lemma false_true_con
> \ < Turnstile > \ < ^ not sub > c true \ < ^ sub > c \ < longleftrightarrow > \ < xi > \ < Turnstile > \ < ^ < sub c
lemma ltl_Next_Neg_con [ simp ] :
\ < Turnstile > \ < ^ sub > c X < ub c ( 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 > \ < ^ sub by ction > ) auto
by auto
lemma ubfrmlsn_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 > ) ) "
by java.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 > \ < Turnstile sub \ < phi > R \ < ^ sub > c \ < psi > \ < longleftrightarrow > \ < xi > \ < Turnstile > \ < c ) or \ c ( G \ < ^ sub > c \ < psi java.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 < ub c \ < 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 . \ < not suffix xi \ < Turnstile > \ < ^ sub psi " ] by force
then \ < Turnstile > \ ^ sub n \ < sub n ( \ < 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 \ sub psi ) or \ < ^ sub > M \ < ^ sub > < > ) "
proof ( cases " \ < xi > \ < urnstile ^ c F \ < ^ sub > c \ < phi > " )
case rue
then obtain assume < > j < i . \ < not > suffix j w \ < Turnstile > \ < ^ sub > n \ < phi > "
using exists_least_iff [ of " \ < lambda > i . suffix i \ < xi > \ < Turnstile > \ < ^ sub > c \ < phi > " y orce
by ak_strong t < sub n imps , 8 11 not \ 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 > \ sub c \ < psi > \ < longleftrightarrow > \ < xi > \ < Turnstile > \ < ^ sub > c ( \ < > U ^ \ < psi > ) or \ < ^ sub > c ( G \ sub b ) "
proof fe
assume asm : " \ < xi > \ < Turnstile > \ < ^ sub > c ( \ < phi > W \ ( 6 < sub n_semantics )
by uto ab_semigroup_add_class class ac ) d eft_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
sing asm rce
qed simp
next
assume " w \ < urnstile \ ^ ub n \ ^ sub > n ( G \ < ^ sub > n \ < phi > ) \ < Longrightarrow > \ < forall > \ < ^ sub > \ < infinity > i . suffix i w < Turnstile < sub > sub n \ < phi > "
then show " \ < xi > \ < Turnstile > \ < ^ sub > c ( unfolding MOST_nat
proof ( cases " \ < xi > \ < Turnstile > \ < ^ sub > c how suffix \ 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 ) +
lemma l_StrongRelease_Until_con
using _ ax by ast
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
lemma ax i Max { i . \ not i < \ < ^ sub > n G \ < ^ sub > n \ < psi }
and pw_eq_on_sym : " pw_eq_on S w w ' \ < ongrightarrow pw_eq_on S w ' w "
and _ ns ans ] \ < lbrakk pw_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 with ax ow suffix i Turnstile < ^ sub > n G \ < ^ sub > n \ < psi > "
by simp add : pw_eq_on_def _ eq_on_def q_on_def
lemma pw_eq_on_subset :
ubseteq S \ < 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_subset pw_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 _ ease e ln_expand_Until xpand_Until nd_Until ln_weak_strong emantics_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 ' \ < Longrightarrow thus lhs
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_ltlc ne_nat_def > < lbrakk > \ < Union > ( range ( suffix 1 w ) ) \ < subseteq > APs ; atoms_ltlc \ < phi > \ < subseteq > APs \ < rbrakk > \ < Longrightarrow > suffix 1 w \ < Turnstile > \ < sub > = suffix 1 lambda x . f ` x < > < c map_ltlc f \ < phi > \ < close > suffix_range )
ext
case ( Final_ltlc )
thus ? se
using Final_ltlc ( 1 ) [ of ffix _ nfolded uffix_comp omp omp_def x_range astforce
next
case ( Global_ltlc )
thus ? case
using Global_ltlc ( 1 ) [ of " suffix _ w " , unfolded suffix_comp comp_def , OF nge e
next
Until_ltlc
thus ? case
ng il_ltlc lc , ) f folded uffix_comp p_def fix_range tforce e
next
se Release_ltlc
thus ? case
using Release_ltlc ( 1 , 2 ) [ of " suffix _ w " , unfolded suffix_comp omp_def ffix_range ] by fastforce
next
case ( WeakUntil_ltlc )
thus ? case
using WeakUntil_ltlc ( 1 , 2 ) [ of " suffix _ w " , unfolded suffix_comp comp_def , x_range by fastforce
next
StrongRelease_ltlc
thus ? case
trongRelease_ltlc w folded x_comp p_def ffix_range ] by fastforce
qed simp java.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 ) " and fun subfrmlsr : : " a Rightarrow ' a ltlr set "
shows " \ < xi < Turnstile \ < ^ sub > c \ < phi > \ < longleftrightarrow > ( map_props f o < xi ) \ < Turnstile > \ < ^ sub > c p_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 ) ( dom by s pand_Until r_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_def f age_iff )
by ( metis Int_iff domI option sel
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 ) sing g M NJ
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 > \ < > m java.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 m close >
text \ < open > ine ype L rmula in negation ormal form m ( F \ < close >
subsubsection \ <
datatype ( atoms_ltln : fun ltl a \ < Rightarrow
true \ < ^ sub > n \ < close > )
| False_ltln ( \ < open > false \ < ^ sub > n \ < close > )
| Prop_ltln ' a ( \ < open op ^ > 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 < sub p \ < 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 "∃ j≤ i. 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 "∀ j≤ i. 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 ,82 ] 81 )
| Or_ltlr "'a ltlr" "'a ltlr" (‹ _ orr _› [84 ,84 ] 83 )
| Next_ltlr "'a ltlr" (‹ Xr _› [88 ] 87 )
| Until_ltlr "'a ltlr" "'a ltlr" (‹ _ Ur _› [84 ,84 ] 83 )
| Release_ltlr "'a ltlr" "'a ltlr" (‹ _ Rr _› [84 ,84 ] 83 )
subsubsection ‹ Semantics›
primrec semantics_ltlr :: "['a set word, 'a ltlr] ==> bool" (‹ _ ⊨ r _› [80 ,80 ] 80 )
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 ,81 ] 80 )
| Next_ltlp "'a pltl" (‹ Xp _› [88 ] 87 )
| Until_ltlp "'a pltl" "'a pltl" (‹ _ Up _› [84 ,84 ] 83 )
― ‹ Further connectives of PLTL can be defined in terms of the existing syntax.›
definition Not_ltlp (‹ notp _› [85 ] 85 )
where
"notp φ ≡ φ impliesp falsep "
definition True_ltlp (‹ truep › )
where
"truep ≡ notp falsep "
definition Or_ltlp (‹ _ orp _› [81 ,81 ] 80 )
where
"φ orp ψ ≡ (notp φ) impliesp ψ"
definition And_ltlp (‹ _ andp _› [82 ,82 ] 81 )
where
"φ andp ψ ≡ notp ((notp φ) orp (notp ψ))"
definition Eventually_ltlp (‹ Fp _› [88 ] 87 )
where
"Fp φ ≡ truep Up φ"
definition Always_ltlp (‹ Gp _› [88 ] 87 )
where
"Gp φ ≡ notp (Fp (notp φ))"
definition Release_ltlp (‹ _ Rp _› [84 ,84 ] 83 )
where
"φ Rp ψ ≡ notp ((notp φ) Up (notp ψ))"
definition WeakUntil_ltlp (‹ _ Wp _› [84 ,84 ] 83 )
where
"φ Wp ψ ≡ ψ Rp (φ orp ψ)"
definition StrongRelease_ltlp (‹ _ Mp _› [84 ,84 ] 83 )
where
"φ Mp ψ ≡ ψ Up (φ andp ψ)"
subsubsection ‹ Semantics›
fun semantics_pltl :: "['a word, 'a pltl] ==> bool" (‹ _ ⊨ p _› [80 ,80 ] 80 )
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 φ ∨ (∃ j≤ i. suffix j w ⊨ p ψ))"
"w ⊨ p φ Mp ψ = (∃ i. suffix i w ⊨ p φ ∧ (∀ j≤ i. 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.
2026-06-12