Term Rewriting System R: [y, x] leq(0, y) -> true leq(s(x), 0) -> false leq(s(x), s(y)) -> leq(x, y) if(true, x, y) -> x if(false, x, y) -> y -(x, 0) -> x -(s(x), s(y)) -> -(x, y) mod(0, y) -> 0 mod(s(x), 0) -> 0 mod(s(x), s(y)) -> if(leq(y, x), mod(-(s(x), s(y)), s(y)), s(x)) Termination of R to be shown. This program has no overlaps, so it is sufficient to show innermost termination. R contains the following Dependency Pairs: MOD(s(x), s(y)) -> IF(leq(y, x), mod(-(s(x), s(y)), s(y)), s(x)) MOD(s(x), s(y)) -> LEQ(y, x) MOD(s(x), s(y)) -> MOD(-(s(x), s(y)), s(y)) MOD(s(x), s(y)) -> -'(s(x), s(y)) -'(s(x), s(y)) -> -'(x, y) LEQ(s(x), s(y)) -> LEQ(x, y) Furthermore, R contains three SCCs. SCC1: LEQ(s(x), s(y)) -> LEQ(x, y) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(LEQ(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: LEQ(s(x), s(y)) -> LEQ(x, y) This transformation is resulting in no new subcycles. SCC2: -'(s(x), s(y)) -> -'(x, y) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(-'(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: -'(s(x), s(y)) -> -'(x, y) This transformation is resulting in no new subcycles. SCC3: MOD(s(x), s(y)) -> MOD(-(s(x), s(y)), s(y)) On this Scc, a Rewriting SCC transformation can be performed. As a result of transforming the rule MOD(s(x), s(y)) -> MOD(-(s(x), s(y)), s(y)) one new Dependency Pair is created: MOD(s(x), s(y)) -> MOD(-(x, y), s(y)) The transformation is resulting in one subcycle: SCC3.Rewr1: MOD(s(x), s(y)) -> MOD(-(x, y), s(y)) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. Additionally, the following rules can be oriented: -(s(x), s(y)) -> -(x, y) -(x, 0) -> x Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(-(x_1, x_2)) = x_1 POL(MOD(x_1, x_2)) = x_1 + x_2 POL(0) = 1 resulting in no subcycles. Termination of R successfully shown. Duration: 0.731 seconds.