mirror of
https://github.com/achlipala/frap.git
synced 2024-11-10 00:07:51 +00:00
SharedMemory: prove that our running-time bound relation is not total
This commit is contained in:
parent
9de4dbdebe
commit
8d250037e7
1 changed files with 26 additions and 0 deletions
|
@ -656,6 +656,32 @@ Inductive boundRunningTime : cmd -> nat -> Prop :=
|
|||
-> boundRunningTime c2 n2
|
||||
-> boundRunningTime (Par c1 c2) (pow2 (n1 + n2)).
|
||||
|
||||
Theorem boundRunningTime_not_total : exists c, forall n, ~boundRunningTime c n.
|
||||
Proof.
|
||||
Fixpoint scribbly (n : nat) : cmd :=
|
||||
match n with
|
||||
| O => Return 0
|
||||
| S n' => _ <- Write n' 0; scribbly n'
|
||||
end.
|
||||
|
||||
Lemma scribbly_time : forall n m,
|
||||
boundRunningTime (scribbly n) m
|
||||
-> m >= n.
|
||||
Proof.
|
||||
induct n; invert 1; auto.
|
||||
invert H2.
|
||||
specialize (H4 n0).
|
||||
apply IHn in H4.
|
||||
linear_arithmetic.
|
||||
Qed.
|
||||
|
||||
exists (n <- Read 0; scribbly n); propositional.
|
||||
invert H.
|
||||
specialize (H4 (S n2)).
|
||||
apply scribbly_time in H4.
|
||||
linear_arithmetic.
|
||||
Qed.
|
||||
|
||||
Lemma pow2_pos : forall n,
|
||||
pow2 n > 0.
|
||||
Proof.
|
||||
|
|
Loading…
Reference in a new issue