Skip to content

Commit

Permalink
always' fixup (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-erbsen committed Apr 3, 2024
1 parent 88b1403 commit de47a67
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/coqutil/Semantics/OmniSmallstepCombinators.v
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,21 @@ Section Combinators.
(Preserve: forall s, invariant s -> step s invariant)
(Use: forall s, invariant s -> P s).

CoInductive always' (P : State -> Prop) (s : State) : Prop :=
always'_step { hd_always' : P s; tl_always' : step s (always P) }.
CoInductive always' (P : State -> Prop) s : Prop := always'_step {
hd_always' : P s; Q ; _ : step s Q; _ s' : Q s' -> always' P s' }.

CoFixpoint always'_always P s : always P s -> always' P s.
Proof. inversion 1; esplit; eauto using mk_always. Qed.

Context (step_weaken: forall s P Q, (forall x, P x -> Q s) -> step s P -> step s Q).

Lemma always_always' P s (H : always' P s) : always P s.
Proof. esplit; try eapply H; inversion 1; eauto. Qed.
Lemma tl_always' P s : always' P s -> step s (always' P).
Proof. inversion 1; eauto. Qed.

Lemma always_always' P s : always' P s -> always P s.
Proof. exists (always' P); try inversion 1; eauto. Qed.

CoFixpoint always'_always P s (H : always P s) : always' P s.
Proof. split; inversion H; eauto. Defined.
Lemma always_elim: forall P initial,
always P initial -> P initial /\ step initial (always P).
Proof. inversion 1; eauto. Qed.
End Combinators.

0 comments on commit de47a67

Please sign in to comment.