YES (VAR x y u z) (RULES perfectp(0) -> false perfectp(s(x)) -> f(x,s(0),s(x),s(x)) f(0,y,0,u) -> true f(0,y,s(z),u) -> false f(s(x),0,z,u) -> f(x,u,minus(z,s(x)),u) f(s(x),s(y),z,u) -> if(le(x,y),f(s(x),minus(y,x),z,u),f(x,u,z,u)) ) The TRS is an overlay system and all critical pairs are trivial, thus termination of innermost rewriting is equivalent to termination of rewriting. Proving termination of innermost rewriting for perfect: -> Dependency pairs: nF_perfectp(s(x)) -> nF_f(x,s(0),s(x),s(x)) nF_f(s(x),0,z,u) -> nF_f(x,u,minus(z,s(x)),u) nF_f(s(x),s(y),z,u) -> nF_f(s(x),minus(y,x),z,u) nF_f(s(x),s(y),z,u) -> nF_f(x,u,z,u) -> Proof of termination for perfect_1: -> -> Dependency pairs in cycle: nF_f(s(x),s(y),z,u) -> nF_f(x,u,z,u) nF_f(s(x),0,z,u) -> nF_f(x,u,minus(z,s(x)),u) Termination proved: Cycles verify subterm criterion. SETTINGS: Base ordering: Polynomial ordering Proof mode: SCCs in DG + base ordering Upper bound for coeffs: 1 Rationals below 1 for all non-replacing args: No Polynomial interpretation: Linear Coeffs in polynomials: No rationals Delta: automatic Termination was proved succesfully.