method has_var xs =
      not captured && xs <> [] &&
        List.exists
        (function
           | Svalue t -> F.term_has_var xs t
           | Sclosure _ -> false)
        partials