Definition weight_typenv (e: typenv) : nat :=
  weight_constraints e.(te_typ) e.(te_sub).Definition typassign := positive -> T.t.

Lemma solve_rec_complete: forall te q e changed, satisf te e -> (forall r1 r2, In (r1, r2) q -> T.sub (te r1) (te r2)) -> exists e' changed', solve_rec e changed q = OK(e', changed') /\ satisf te e'.