(* Automatic conversion of a [value] or [pattern] into a [term] *)

Fixpoint pattern_from_value (v : value) : pattern  :=
  match v with
    | c_capply c lv => p_capply c (map pattern_from_value lv)
  end.Fixpoint term_from_value (v : value) : term :=
  match v with
  | c_capply c lc => capply c (map term_from_value lc)
  end.

(* Specifications: *)
Lemma term_from_value_not_var : forall v x, ~ term_from_value v = var x.
Lemma term_from_value_not_fapply : forall v f lt, ~ term_from_value v = fapply f lt.
Lemma term_from_value_injective (v v': value) : term_from_value v = term_from_value v' -> v = v'.