Definition undefx i t := 
  if t is Var n then 
    if onth (varx i) n is Some x then undefb x else false
  else false.Definition isundef i ts := ~~ uniq (getkeys ts) || has (undefx i) ts.

(* Specifications: *)
Lemma isundef_sound i ts : all (wf i) ts -> isundef i ts -> ~~ valid (interp i ts).