Skip to content

Commit ea7fc2d

Browse files
committed
more lemmas for release, modernized Arguments, weak_until equivalence
1 parent 379ff04 commit ea7fc2d

5 files changed

Lines changed: 235 additions & 72 deletions

File tree

classical.v

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ Section sec_classical.
55

66
Variable T : Type.
77

8+
Lemma weak_until_until_or_always :
9+
forall (J P : infseq T -> Prop) (s : infseq T),
10+
weak_until J P s -> until J P s \/ always J s.
11+
Proof.
12+
intros J P s.
13+
case (classic (eventually P s)).
14+
intros evP wu.
15+
left.
16+
induction evP.
17+
apply U0. assumption.
18+
apply weak_until_Cons in wu.
19+
case wu.
20+
intros PC.
21+
apply U0. assumption.
22+
intros [Js wu'].
23+
apply U_next; trivial.
24+
apply IHevP.
25+
assumption.
26+
intros evP wu.
27+
right.
28+
apply not_eventually_always_not in evP.
29+
apply weak_until_always_not_always in wu; trivial.
30+
Qed.
31+
832
Lemma not_eventually_not_always :
933
forall (P : infseq T -> Prop) (s : infseq T),
1034
~ eventually (~_ P) s -> always P s.
@@ -85,8 +109,9 @@ Qed.
85109

86110
End sec_classical.
87111

88-
Implicit Arguments not_eventually_not_always [T P s].
89-
Implicit Arguments not_always_eventually_not [T P s].
90-
Implicit Arguments not_inf_often_continuously_not [T P s].
91-
Implicit Arguments not_continously_inf_often_not [T P s].
92-
Implicit Arguments not_tl_and_tl_or_tl [T P Q s].
112+
Arguments weak_until_until_or_always [T J P s] _.
113+
Arguments not_eventually_not_always [T P s] _.
114+
Arguments not_always_eventually_not [T P s] _.
115+
Arguments not_inf_often_continuously_not [T P s] _.
116+
Arguments not_continously_inf_often_not [T P s] _.
117+
Arguments not_tl_and_tl_or_tl [T P Q s] _.

exteq.v

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ Qed.
4242

4343
End sec_exteq.
4444

45-
Implicit Arguments exteq [T].
46-
Implicit Arguments exteq_inversion [T x1 s1 x2 s2].
47-
Implicit Arguments exteq_refl [T].
48-
Implicit Arguments exteq_sym [T].
49-
Implicit Arguments exteq_trans [T].
45+
Arguments exteq [T] _ _.
46+
Arguments exteq_inversion [T x1 s1 x2 s2] _.
47+
Arguments exteq_refl [T] _.
48+
Arguments exteq_sym [T] _ _ _.
49+
Arguments exteq_trans [T] _ _ _ _ _.
5050

5151
(* --------------------------------------------------------------------------- *)
5252
(* Extensional equality and temporal logic *)
@@ -158,6 +158,20 @@ apply IHun1.
158158
case (exteq_inversion e). trivial.
159159
Qed.
160160

161+
Lemma extensional_release :
162+
forall (P Q: infseq T -> Prop),
163+
extensional P -> extensional Q -> extensional (release P Q).
164+
Proof.
165+
intros P Q eP eQ. cofix cf.
166+
intros (x1, s1) (x2, s2) e rl1. case (release_Cons rl1). intros Qx orR. case orR; intro orRx.
167+
apply R0.
168+
eapply eQ; eassumption.
169+
eapply eP; eassumption.
170+
apply R_tl.
171+
eapply eQ; eassumption.
172+
simpl. apply cf with s1; trivial. case (exteq_inversion e); trivial.
173+
Qed.
174+
161175
Lemma extensional_eventually :
162176
forall (P: infseq T -> Prop),
163177
extensional P -> extensional (eventually P).
@@ -185,4 +199,18 @@ Qed.
185199

186200
End sec_exteq_congruence.
187201

188-
Implicit Arguments extensional [T].
202+
Arguments extensional [T] _.
203+
Arguments extensional_and_tl [T P Q] _ _ _ _ _ _.
204+
Arguments extensional_or_tl [T P Q] _ _ _ _ _ _.
205+
Arguments extensional_impl_tl [T P Q] _ _ _ _ _ _ _.
206+
Arguments extensional_not_tl [T P] _ _ _ _ _ _.
207+
Arguments extensional_now [T P] _ _ _ _.
208+
Arguments extensional_next [T P] _ _ _ _ _.
209+
Arguments extensional_consecutive [T P] _ _ _ _.
210+
Arguments extensional_always [T P] _ _ _ _ _.
211+
Arguments extensional_weak_until [T P Q] _ _ _ _ _ _.
212+
Arguments extensional_until [T P Q] _ _ _ _ _ _.
213+
Arguments extensional_release [T P Q] _ _ _ _ _ _.
214+
Arguments extensional_eventually [T P] _ _ _ _ _.
215+
Arguments extensional_inf_often [T P] _ _ _ _ _.
216+
Arguments extensional_continuously [T P] _ _ _ _ _.

infseq.v

Lines changed: 99 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,32 @@ change (P (Cons x s) \/ (J (Cons x s) /\ weak_until J P (tl (Cons x s)))).
211211
destruct un; intuition.
212212
Qed.
213213

214+
Lemma always_weak_until :
215+
forall (J P : infseq T -> Prop) (s : infseq T),
216+
always J s -> weak_until J P s.
217+
Proof.
218+
intros J P.
219+
cofix c.
220+
intros [x s] alJ.
221+
apply W_tl.
222+
apply always_now in alJ.
223+
assumption.
224+
simpl.
225+
apply c.
226+
apply always_invar in alJ.
227+
assumption.
228+
Qed.
229+
230+
Lemma until_weak_until :
231+
forall (J P : infseq T -> Prop) (s : infseq T),
232+
until J P s -> weak_until J P s.
233+
Proof.
234+
intros J P s un.
235+
induction un.
236+
apply W0. assumption.
237+
apply W_tl; trivial.
238+
Qed.
239+
214240
Lemma eventually_Cons :
215241
forall (x: T) (s: infseq T) P,
216242
eventually P (Cons x s) -> P (Cons x s) \/ eventually P s.
@@ -298,7 +324,7 @@ change (P (Cons x s) \/ (J (Cons x s) /\ until J P (tl (Cons x s)))). case ul; a
298324
Qed.
299325

300326
Lemma until_eventually :
301-
forall (P J: infseq T -> Prop),
327+
forall (J P : infseq T -> Prop),
302328
forall s, until J P s -> eventually P s.
303329
Proof.
304330
intros P J s unP.
@@ -413,6 +439,25 @@ apply U_next.
413439
assumption.
414440
Qed.
415441

442+
Lemma release_monotonic :
443+
forall (P Q J K: infseq T -> Prop),
444+
(forall s, P s -> Q s) -> (forall s, J s -> K s) ->
445+
forall s, release J P s -> release K Q s.
446+
Proof.
447+
intros P Q J K PQ JK.
448+
cofix cf. intros [x s] rl.
449+
generalize (release_Cons x s J P rl); simpl.
450+
intros [Pxs rlCJP].
451+
case rlCJP; intros rlJP.
452+
apply R0.
453+
apply PQ; assumption.
454+
apply JK; assumption.
455+
apply R_tl.
456+
apply PQ; assumption.
457+
simpl.
458+
apply cf. assumption.
459+
Qed.
460+
416461
Lemma eventually_monotonic :
417462
forall (P Q J: infseq T -> Prop),
418463
(forall x s, J (Cons x s) -> J s) ->
@@ -640,58 +685,58 @@ Qed.
640685

641686
End sec_modal_op_lemmas.
642687

643-
Implicit Arguments always_inv [T s inv].
644-
Implicit Arguments always_Cons [T x s P].
645-
Implicit Arguments always_now [T x s P].
646-
Implicit Arguments always_invar [T x s P].
647-
Implicit Arguments always_tl [T s P].
648-
Implicit Arguments always_and_tl [T s P Q].
649-
Implicit Arguments always_always1 [T s P].
650-
Implicit Arguments always_inf_often [T s P].
651-
Implicit Arguments always_continuously [T s P].
652-
653-
Implicit Arguments weak_until_Cons [T x s J P].
654-
Implicit Arguments eventually_Cons [T x s P].
655-
Implicit Arguments eventually_trans [T P Q inv s].
656-
Implicit Arguments not_eventually [T P x s].
657-
Implicit Arguments eventually_next [T P s].
658-
Implicit Arguments eventually_always_cumul [T s P Q].
659-
Implicit Arguments eventually_weak_until_cumul [T s P J].
660-
Implicit Arguments weak_until_eventually [T P Q s J].
661-
662-
Implicit Arguments until_Cons [T x s J P].
663-
Implicit Arguments until_eventually [T s J P].
664-
665-
Implicit Arguments release_Cons [T x s J P].
666-
667-
Implicit Arguments inf_often_invar [T x s P].
668-
Implicit Arguments continuously_invar [T x s P].
669-
Implicit Arguments continuously_and_tl [T P Q s].
670-
671-
Implicit Arguments now_monotonic [T P Q s].
672-
Implicit Arguments next_monotonic [T P Q s].
673-
Implicit Arguments consecutive_monotonic [T P Q s].
674-
Implicit Arguments always_monotonic [T P Q s].
675-
Implicit Arguments weak_until_monotonic [T P Q J K s].
676-
Implicit Arguments until_monotonic [T P Q J K s].
677-
Implicit Arguments eventually_monotonic [T P Q s].
678-
Implicit Arguments eventually_monotonic_simple [T P Q s].
679-
Implicit Arguments inf_often_monotonic [T P Q s].
680-
Implicit Arguments continuously_monotonic [T P Q s].
681-
682-
Implicit Arguments not_eventually_always_not [T P s].
683-
Implicit Arguments eventually_not_always [T P s].
684-
Implicit Arguments weak_until_always_not_always [T J P s].
685-
Implicit Arguments always_not_eventually_not [T P s].
686-
Implicit Arguments continuously_not_inf_often [T P s].
687-
Implicit Arguments inf_often_not_continuously [T P s].
688-
689-
Implicit Arguments and_tl_comm [T P Q s].
690-
Implicit Arguments and_tl_assoc [T P Q R s].
691-
Implicit Arguments or_tl_comm [T P Q s].
692-
Implicit Arguments or_tl_assoc [T P Q R s].
693-
Implicit Arguments not_tl_or_tl [T P Q s].
694-
Implicit Arguments not_tl_or_tl_and_tl [T P Q s].
688+
Arguments always_inv [T inv] _ [s] _.
689+
Arguments always_Cons [T x s P] _.
690+
Arguments always_now [T x s P] _.
691+
Arguments always_invar [T x s P] _.
692+
Arguments always_tl [T s P] _.
693+
Arguments always_and_tl [T P Q s] _ _.
694+
Arguments always_always1 [T P s].
695+
Arguments always_inf_often [T P s] _.
696+
Arguments always_continuously [T P s] _.
697+
698+
Arguments weak_until_Cons [T x s J P] _.
699+
Arguments always_weak_until [T J P s] _.
700+
Arguments until_weak_until [T J P s] _.
701+
Arguments eventually_Cons [T x s P] _.
702+
Arguments eventually_trans [T P Q inv] _ _ [s] _ _.
703+
Arguments not_eventually [T P x s] _ _.
704+
Arguments eventually_next [T s P] _.
705+
Arguments eventually_always_cumul [T s P Q] _ _.
706+
Arguments eventually_weak_until_cumul [T s P J] _ _.
707+
Arguments weak_until_eventually [T P Q J] _ [s] _ _ _.
708+
Arguments until_Cons [T x s J P] _.
709+
Arguments until_eventually [T J P s] _.
710+
Arguments release_Cons [T x s J P] _.
711+
Arguments inf_often_invar [T x s P] _.
712+
Arguments continuously_invar [T x s P] _.
713+
Arguments continuously_and_tl [T P Q s] _ _.
714+
715+
Arguments now_monotonic [T P Q] _ [s] _.
716+
Arguments next_monotonic [T P Q] _ [s] _.
717+
Arguments consecutive_monotonic [T P Q] _ [s] _.
718+
Arguments always_monotonic [T P Q] _ [s] _.
719+
Arguments weak_until_monotonic [T P Q J K] _ _ [s] _.
720+
Arguments until_monotonic [T P Q J K] _ _ [s] _.
721+
Arguments release_monotonic [T P Q J K] _ _ [s] _.
722+
Arguments eventually_monotonic [T P Q] _ _ _ [s] _ _.
723+
Arguments eventually_monotonic_simple [T P Q] _ [s] _.
724+
Arguments inf_often_monotonic [T P Q] _ [s] _.
725+
Arguments continuously_monotonic [T P Q] _ [s] _.
726+
727+
Arguments not_eventually_always_not [T P s].
728+
Arguments eventually_not_always [T P s] _ _.
729+
Arguments weak_until_always_not_always [T J P s] _ _.
730+
Arguments always_not_eventually_not [T P s] _ _.
731+
Arguments continuously_not_inf_often [T P s] _ _.
732+
Arguments inf_often_not_continuously [T P s] _ _.
733+
734+
Arguments and_tl_comm [T P Q s].
735+
Arguments and_tl_assoc [T P Q R s].
736+
Arguments or_tl_comm [T P Q s].
737+
Arguments or_tl_assoc [T P Q R s].
738+
Arguments not_tl_or_tl [T P Q s].
739+
Arguments not_tl_or_tl_and_tl [T P Q s] _ _.
695740

696741
Ltac monotony :=
697742
match goal with
@@ -702,6 +747,7 @@ Ltac monotony :=
702747
| [ |- always ?P ?s -> always ?Q ?s ] => apply always_monotonic
703748
| [ |- weak_until ?J ?P ?s -> weak_until ?K ?Q ?s ] => apply weak_until_monotonic
704749
| [ |- until ?J ?P ?s -> until ?K ?Q ?s ] => apply until_monotonic
750+
| [ |- release ?J ?P ?s -> release ?K ?Q ?s ] => apply release_monotonic
705751
| [ |- ?J ?s -> eventually ?P ?s -> eventually ?Q ?s ] =>
706752
apply eventually_monotonic
707753
| [ |- continuously ?P ?s -> continuously ?Q ?s ] =>

0 commit comments

Comments
 (0)