(* returns the proposition generated by a fact *)
Definition eval_fact i f :=
  match f with
  | eqH h1 h2 => interp i h1 = interp i h2
  | eqD d1 d2 => d1 = d2
  | eqX x1 x2 => plook i x1 = plook i x2
  end.Notation pread' x t := (odflt (dyn tt) (pread x t)).Definition pfree x t := filter (predC (ptreq x)) t.Definition hfree h t := filter (predC (vareq h)) t.

Lemma count1_hfree v t : count (pred1 v) (vars t) = 1 -> perm (Var v :: hfree v t) t.