Term Rewriting System R: [x, y] ge(x, 0) -> true ge(0, s(x)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) div(x, y) -> ify(ge(y, s(0)), x, y) ify(false, x, y) -> divByZeroError ify(true, x, y) -> if(ge(x, y), x, y) if(false, x, y) -> 0 if(true, x, y) -> s(div(minus(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: IF(true, x, y) -> DIV(minus(x, y), y) IF(true, x, y) -> MINUS(x, y) DIV(x, y) -> IFY(ge(y, s(0)), x, y) DIV(x, y) -> GE(y, s(0)) MINUS(s(x), s(y)) -> MINUS(x, y) GE(s(x), s(y)) -> GE(x, y) IFY(true, x, y) -> IF(ge(x, y), x, y) IFY(true, x, y) -> GE(x, y) Furthermore, R contains three SCCs. SCC1: 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. SCC2: GE(s(x), s(y)) -> GE(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(GE(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: GE(s(x), s(y)) -> GE(x, y) This transformation is resulting in no new subcycles. SCC3: IFY(true, x, y) -> IF(ge(x, y), x, y) DIV(x, y) -> IFY(ge(y, s(0)), x, y) IF(true, x, y) -> DIV(minus(x, y), y) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule DIV(x, y) -> IFY(ge(y, s(0)), x, y) two new Dependency Pairs are created: DIV(x, s(x'')) -> IFY(ge(x'', 0), x, s(x'')) DIV(x, 0) -> IFY(false, x, 0) The transformation is resulting in one subcycle: SCC3.Nar1: DIV(x, s(x'')) -> IFY(ge(x'', 0), x, s(x'')) IF(true, x, y) -> DIV(minus(x, y), y) IFY(true, x, y) -> IF(ge(x, y), x, y) On this Scc, a Rewriting SCC transformation can be performed. As a result of transforming the rule DIV(x, s(x'')) -> IFY(ge(x'', 0), x, s(x'')) one new Dependency Pair is created: DIV(x, s(x'')) -> IFY(true, x, s(x'')) The transformation is resulting in one subcycle: SCC3.Nar1.Rewr1: IFY(true, x, y) -> IF(ge(x, y), x, y) DIV(x, s(x'')) -> IFY(true, x, s(x'')) IF(true, x, y) -> DIV(minus(x, y), y) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule IFY(true, x, y) -> IF(ge(x, y), x, y) three new Dependency Pairs are created: IFY(true, x'', 0) -> IF(true, x'', 0) IFY(true, s(x''), s(y'')) -> IF(ge(x'', y''), s(x''), s(y'')) IFY(true, 0, s(x'')) -> IF(false, 0, s(x'')) The transformation is resulting in one subcycle: SCC3.Nar1.Rewr1.Nar1: IF(true, x, y) -> DIV(minus(x, y), y) IFY(true, s(x''), s(y'')) -> IF(ge(x'', y''), s(x''), s(y'')) DIV(x, s(x'')) -> IFY(true, x, s(x'')) On this Scc, a Instantiation SCC transformation can be performed. As a result of transforming the rule IF(true, x, y) -> DIV(minus(x, y), y) one new Dependency Pair is created: IF(true, s(x'''''), s(y'''')) -> DIV(minus(s(x'''''), s(y'''')), s(y'''')) The transformation is resulting in one subcycle: SCC3.Nar1.Rewr1.Nar1.Inst1: DIV(x, s(x'')) -> IFY(true, x, s(x'')) IF(true, s(x'''''), s(y'''')) -> DIV(minus(s(x'''''), s(y'''')), s(y'''')) IFY(true, s(x''), s(y'')) -> IF(ge(x'', y''), s(x''), s(y'')) On this Scc, a Rewriting SCC transformation can be performed. As a result of transforming the rule IF(true, s(x'''''), s(y'''')) -> DIV(minus(s(x'''''), s(y'''')), s(y'''')) one new Dependency Pair is created: IF(true, s(x'''''), s(y'''')) -> DIV(minus(x''''', y''''), s(y'''')) The transformation is resulting in one subcycle: SCC3.Nar1.Rewr1.Nar1.Inst1.Rewr1: IF(true, s(x'''''), s(y'''')) -> DIV(minus(x''''', y''''), s(y'''')) IFY(true, s(x''), s(y'')) -> IF(ge(x'', y''), s(x''), s(y'')) DIV(x, s(x'')) -> IFY(true, x, s(x'')) 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(s(x), s(y)) -> minus(x, y) minus(x, 0) -> x Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(DIV(x_1, x_2)) = x_1 POL(minus(x_1, x_2)) = x_1 POL(ge(x_1, x_2)) = 0 POL(true) = 0 POL(IFY(x_1, x_2, x_3)) = x_2 POL(0) = 0 POL(false) = 0 POL(IF(x_1, x_2, x_3)) = x_2 resulting in no subcycles. Termination of R successfully shown. Duration: 11.273 seconds.