proposition: Lemma valid_check_flatten : forall s, S.valid interp_var s -> forall cid lf, C.valid interp_var (check_flatten s cid lf).
proof: Proof. unfold check_flatten; intros s Hs cid lf; case_eq (S.get s cid). intros; apply C.interp_true; auto. intros i [ |l q] Heq; try apply C.interp_true; auto; case_eq (check_flatten_aux i lf); intro Heq2; try apply C.interp_true; auto; unfold C.valid; simpl; rewrite <- (check_flatten_aux_correct _ _ Heq2); unfold S.valid in Hs; generalize (Hs cid); rewrite Heq; auto. Qed.
imports: List PArray Bool Int63 ZMicromega ZArith Misc State SMT_terms BVList