Term Rewriting System R: [y, x] le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) pred(s(x)) -> x minus(x, 0) -> x minus(x, s(y)) -> pred(minus(x, y)) gcd(0, y) -> y gcd(s(x), 0) -> s(x) gcd(s(x), s(y)) -> if_gcd(le(y, x), s(x), s(y)) if_gcd(true, s(x), s(y)) -> gcd(minus(x, y), s(y)) if_gcd(false, s(x), s(y)) -> gcd(minus(y, x), 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: LE(s(x), s(y)) -> LE(x, y) GCD(s(x), s(y)) -> IF_GCD(le(y, x), s(x), s(y)) GCD(s(x), s(y)) -> LE(y, x) IF_GCD(true, s(x), s(y)) -> GCD(minus(x, y), s(y)) IF_GCD(true, s(x), s(y)) -> MINUS(x, y) IF_GCD(false, s(x), s(y)) -> GCD(minus(y, x), s(x)) IF_GCD(false, s(x), s(y)) -> MINUS(y, x) MINUS(x, s(y)) -> PRED(minus(x, y)) MINUS(x, s(y)) -> MINUS(x, y) Furthermore, R contains three SCCs. SCC1: LE(s(x), s(y)) -> LE(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(LE(x_1, x_2)) = 1 + x_1 + x_2 POL(s(x_1)) = 1 + x_1 The following Dependency Pairs can be deleted: LE(s(x), s(y)) -> LE(x, y) This transformation is resulting in no new subcycles. SCC2: MINUS(x, s(y)) -> MINUS(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(MINUS(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: MINUS(x, s(y)) -> MINUS(x, y) This transformation is resulting in no new subcycles. SCC3: IF_GCD(false, s(x), s(y)) -> GCD(minus(y, x), s(x)) IF_GCD(true, s(x), s(y)) -> GCD(minus(x, y), s(y)) GCD(s(x), s(y)) -> IF_GCD(le(y, x), s(x), 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: minus(x, 0) -> x minus(x, s(y)) -> pred(minus(x, y)) pred(s(x)) -> x Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(le(x_1, x_2)) = 0 POL(minus(x_1, x_2)) = x_1 POL(pred(x_1)) = x_1 POL(true) = 0 POL(IF_GCD(x_1, x_2, x_3)) = x_2 + x_3 POL(GCD(x_1, x_2)) = x_1 + x_2 POL(0) = 0 POL(false) = 0 resulting in no subcycles. Termination of R successfully shown. Duration: 0.953 seconds.