Advertisement
Guest User

obligation 2

a guest
May 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Next Obligation.
  2. unfold mmap_to_equation in Heq_anonymous.
  3. destruct (
  4. mmap
  5. (to_equation
  6. (Env.adds' (L.n_vars n)
  7. (Env.adds' (L.n_in n)
  8. (Env.from_list (L.n_out n))))
  9. (fun x : Env.key =>
  10. if
  11. Env.mem x (Env.from_list (L.n_out n))
  12. then
  13. Error
  14. (msg
  15. "output variable defined as a fby")
  16. else OK tt)) (L.n_eqs n)
  17. ) eqn:?; try discriminate.
  18. monadInv Heq_anonymous. revert out0 H.
  19. intros xo Hin.
  20. monadInv Heqr. induction H as [| eq leq eq' leq' Htoeq ].
  21. intro Hbad. inv Hbad.
  22. assert (Hmmap := Heqr).
  23. apply mmap_cons2 in Heqr.
  24. destruct Heqr as (eq'' & leq'' & Heqs' & Htoeq' & Hmmap').
  25. inv Heqs'.
  26. simpl. destruct (NL.is_fby eq') eqn:?.
  27. - unfold NL.vars_defined, flat_map. simpl. rewrite in_app.
  28. intro Hi. destruct Hi.
  29. + unfold to_equation in Htoeq. destruct eq''.
  30. cases_eqn E; monadInv1 Htoeq; inv Heqb.
  31. simpl in H0. destruct H0; auto. subst. inv EQ.
  32. apply Env.Props.P.F.not_mem_in_iff in E8. apply E8.
  33. rewrite in_map_iff in Hin.
  34. destruct Hin as ((x & ?) & Hfst & Hin). inv Hfst.
  35. eapply Env.find_In. eapply Env.In_find_adds'; simpl; eauto.
  36. destruct n. simpl. assert (Hnodup := n_nodup).
  37. now repeat apply NoDupMembers_app_r in Hnodup.
  38. + apply IHlist_forall2; auto.
  39. - apply IHlist_forall2; eauto.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement