isStartTerm (BasicTerms ds cs) t = case t of
  (R.Var _)    -> True
  (R.Fun f ts) -> f `S.member` ds && all (`S.member` cs) (concatMap R.funs ts)
isStartTerm (BasicTerms ds cs) t = case t of
  (R.Var _)    -> True
  (R.Fun f ts) -> f `S.member` ds && all (`S.member` cs) (concatMap R.funs ts)
isStartTerm (BasicTerms ds cs) t = case t of
  (R.Var _)    -> True
  (R.Fun f ts) -> f `S.member` ds && all (`S.member` cs) (concatMap R.funs ts)