mirror of
https://github.com/achlipala/frap.git
synced 2024-11-10 00:07:51 +00:00
30 lines
571 B
Coq
30 lines
571 B
Coq
Require Import Relations.
|
|
|
|
Set Implicit Arguments.
|
|
|
|
|
|
Section Invariant.
|
|
Variable state : Type.
|
|
Variable step : state -> state -> Prop.
|
|
Variable invariant : state -> Prop.
|
|
|
|
Hint Constructors trc.
|
|
|
|
Definition safe (s : state) :=
|
|
forall s', step^* s s' -> invariant s'.
|
|
|
|
Variable s0 : state.
|
|
|
|
Hypothesis Hinitial : invariant s0.
|
|
|
|
Hypothesis Hstep : forall s s', invariant s -> step s s' -> invariant s'.
|
|
|
|
Lemma safety : safe s0.
|
|
Proof.
|
|
generalize dependent s0.
|
|
unfold safe.
|
|
induction 2; eauto.
|
|
Qed.
|
|
End Invariant.
|
|
|
|
Hint Resolve safety.
|