Definition node_OK (bs : BDDstate) (node : ad) :=
node = BDDzero \/ node = BDDone \/ in_dom _ node bs = true.

Lemma BDDalloc_preserves_nodes :
forall (cfg : BDDconfig) (l r : ad) (x : BDDvar),
BDDconfig_OK cfg ->
forall (a l1 r1 : ad) (x1 : BDDvar),
MapGet _ (fst cfg) a = Some (x1, (l1, r1)) ->
MapGet _ (fst (fst (BDDalloc cfg x l r))) a = Some (x1, (l1, r1)).