diff --git a/wp.v b/wp.v index 0a9bf47..7ce386a 100644 --- a/wp.v +++ b/wp.v @@ -233,8 +233,27 @@ Proof. - intros p infN. assert (p <= n). omega. rewrite (before_n_useless_guard beforeN p H ). apply beforeN; trivial. - - admit. -Admitted. + - assert (n <= n). omega. rewrite (before_n_useless_guard beforeN n H). + destruct mem as [mem0|] eqn:memRel. + { simpl in notError. exfalso; apply notError; trivial. } + remember (fun n => interp (nth_iterate (ifonly guard body) n) mem) + as chain eqn:chainRel. + assert (chain (S n) = MemError) as nLastValid. + { + rewrite chainRel. rewrite memRel. fold MemElem; fold MemElem in atN. + rewrite (unfold_one_iter (ifonly guard body) m n). + remember (interp (nth_iterate (ifonly guard body) n) (MemElem m)) + as memN. + simpl. + destruct memN; trivial. + simpl in atN. unfold expr_neg in atN. + destruct (guard m0); simpl; trivial. + * exfalso. apply atN. congruence. + assert (forall n, chain n cpo<= chain (S n)) as incrChainRel. + * intros n0. rewrite chainRel. unfold cpo_leq. + destruct (n0 <=? n). + assert (find_lub_correct +Qed. (***** Validite, prouvabilite pour Hoare *************************************)