Term Rewriting System R: [Y, X] minus(0, Y) -> 0 minus(s(X), s(Y)) -> minus(X, Y) geq(X, 0) -> true geq(0, s(Y)) -> false geq(s(X), s(Y)) -> geq(X, Y) div(0, s(Y)) -> 0 div(s(X), s(Y)) -> if(geq(X, Y), s(div(minus(X, Y), s(Y))), 0) if(true, X, Y) -> X if(false, X, Y) -> Y 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: GEQ(s(X), s(Y)) -> GEQ(X, Y) DIV(s(X), s(Y)) -> IF(geq(X, Y), s(div(minus(X, Y), s(Y))), 0) DIV(s(X), s(Y)) -> GEQ(X, Y) DIV(s(X), s(Y)) -> DIV(minus(X, Y), s(Y)) DIV(s(X), s(Y)) -> MINUS(X, Y) MINUS(s(X), s(Y)) -> MINUS(X, Y) Furthermore, R contains three SCCs. SCC1: GEQ(s(X), s(Y)) -> GEQ(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(GEQ(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: GEQ(s(X), s(Y)) -> GEQ(X, Y) This transformation is resulting in no new subcycles. SCC2: MINUS(s(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(s(X), s(Y)) -> MINUS(X, Y) This transformation is resulting in no new subcycles. SCC3: DIV(s(X), s(Y)) -> DIV(minus(X, Y), s(Y)) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule DIV(s(X), s(Y)) -> DIV(minus(X, Y), s(Y)) two new Dependency Pairs are created: DIV(s(0), s(Y'')) -> DIV(0, s(Y'')) DIV(s(s(X'')), s(s(Y''))) -> DIV(minus(X'', Y''), s(s(Y''))) The transformation is resulting in no subcycles. Termination of R successfully shown. Duration: 0.644 seconds.