fact: Fixpoint replace_pos (t : term) (ps : position) (u : term) : option term := match t, ps with | _, nil => Some u | Var x, _ :: _ => None | Fun f ts, p :: ps' => match lt_ge_dec p (arity f) with | left h => match replace_pos (Vnth ts h) ps' u with | None => None | Some v => Some (Fun f (Vreplace ts h v)) end | right _ => None end end.
imports: CoLoR(ATrs ListUtil NatUtil VecUtil LogicUtil OptUtil)