fact: Fixpoint calls (t : term) : list term := match t with | Var v => nil | Fun f ts => let fix vcalls n (ts : terms n) : list term := match ts with | Vnil => nil | Vcons u ts' => calls u ++ vcalls _ ts' end in match defined f R with | true => t :: vcalls (arity f) ts | false => vcalls (arity f) ts end end.
imports: CoLoR(LogicUtil ATrs ListUtil VecUtil EqUtil BoolUtil) Coq(Sumbool)