Term Rewriting System R: [x, y, z] p(s(x)) -> x plus(x, 0) -> x plus(0, y) -> y plus(s(x), y) -> s(plus(x, y)) plus(s(x), y) -> s(plus(p(s(x)), y)) plus(x, s(y)) -> s(plus(x, p(s(y)))) times(0, y) -> 0 times(s(0), y) -> y times(s(x), y) -> plus(y, times(x, y)) div(0, y) -> 0 div(x, y) -> quot(x, y, y) div(div(x, y), z) -> div(x, times(y, z)) quot(0, s(y), z) -> 0 quot(s(x), s(y), z) -> quot(x, y, z) quot(x, 0, s(z)) -> s(div(x, s(z))) eq(0, 0) -> true eq(s(x), 0) -> false eq(0, s(y)) -> false eq(s(x), s(y)) -> eq(x, y) divides(y, x) -> eq(x, times(div(x, y), y)) prime(s(s(x))) -> pr(s(s(x)), s(x)) pr(x, s(0)) -> true pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y)) if(true, x, y) -> false if(false, x, y) -> pr(x, y) Termination of R to be shown. R contains the following Dependency Pairs: PR(x, s(s(y))) -> IF(divides(s(s(y)), x), x, s(y)) PR(x, s(s(y))) -> DIVIDES(s(s(y)), x) PLUS(s(x), y) -> PLUS(x, y) PLUS(x, s(y)) -> PLUS(x, p(s(y))) PLUS(x, s(y)) -> P(s(y)) PLUS(s(x), y) -> PLUS(p(s(x)), y) PLUS(s(x), y) -> P(s(x)) QUOT(s(x), s(y), z) -> QUOT(x, y, z) QUOT(x, 0, s(z)) -> DIV(x, s(z)) EQ(s(x), s(y)) -> EQ(x, y) TIMES(s(x), y) -> PLUS(y, times(x, y)) TIMES(s(x), y) -> TIMES(x, y) DIV(x, y) -> QUOT(x, y, y) DIV(div(x, y), z) -> DIV(x, times(y, z)) DIV(div(x, y), z) -> TIMES(y, z) PRIME(s(s(x))) -> PR(s(s(x)), s(x)) IF(false, x, y) -> PR(x, y) DIVIDES(y, x) -> EQ(x, times(div(x, y), y)) DIVIDES(y, x) -> TIMES(div(x, y), y) DIVIDES(y, x) -> DIV(x, y) Furthermore, R contains five SCCs. SCC1: EQ(s(x), s(y)) -> EQ(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(EQ(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: EQ(s(x), s(y)) -> EQ(x, y) This transformation is resulting in no new subcycles. SCC2: PLUS(s(x), y) -> PLUS(p(s(x)), y) PLUS(x, s(y)) -> PLUS(x, p(s(y))) PLUS(s(x), y) -> PLUS(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(PLUS(x_1, x_2)) = 1 + x_1 + x_2 POL(s(x_1)) = x_1 POL(p(x_1)) = x_1 No Dependency Pairs can be deleted. The following rules of R can be deleted: pr(x, s(0)) -> true pr(x, s(s(y))) -> if(divides(s(s(y)), x), x, s(y)) plus(s(x), y) -> s(plus(x, y)) plus(x, s(y)) -> s(plus(x, p(s(y)))) plus(s(x), y) -> s(plus(p(s(x)), y)) plus(x, 0) -> x plus(0, y) -> y quot(0, s(y), z) -> 0 quot(s(x), s(y), z) -> quot(x, y, z) quot(x, 0, s(z)) -> s(div(x, s(z))) eq(0, 0) -> true eq(s(x), s(y)) -> eq(x, y) eq(s(x), 0) -> false eq(0, s(y)) -> false times(s(x), y) -> plus(y, times(x, y)) times(0, y) -> 0 times(s(0), y) -> y div(0, y) -> 0 div(x, y) -> quot(x, y, y) div(div(x, y), z) -> div(x, times(y, z)) prime(s(s(x))) -> pr(s(s(x)), s(x)) if(true, x, y) -> false if(false, x, y) -> pr(x, y) divides(y, x) -> eq(x, times(div(x, y), y)) This transformation is resulting in one new subcycle: SCC2.MRR1: PLUS(x, s(y)) -> PLUS(x, p(s(y))) PLUS(s(x), y) -> PLUS(x, y) PLUS(s(x), y) -> PLUS(p(s(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(PLUS(x_1, x_2)) = 1 + x_1 + x_2 POL(s(x_1)) = 1 + x_1 POL(p(x_1)) = x_1 The following Dependency Pairs can be deleted: PLUS(s(x), y) -> PLUS(x, y) The following rules of R can be deleted: p(s(x)) -> x This transformation is resulting in one new subcycle: SCC2.MRR1.MRR1: PLUS(s(x), y) -> PLUS(p(s(x)), y) PLUS(x, s(y)) -> PLUS(x, p(s(y))) Applying the non-overlappingness check to the DPs. The transformation is resulting in one subcycle: SCC2.MRR1.MRR1.NOC1: PLUS(x, s(y)) -> PLUS(x, p(s(y))) PLUS(s(x), y) -> PLUS(p(s(x)), y) On this Scc, a Instantiation SCC transformation can be performed. As a result of transforming the rule PLUS(s(x), y) -> PLUS(p(s(x)), y) one new Dependency Pair is created: PLUS(s(x''), p(s(y''))) -> PLUS(p(s(x'')), p(s(y''))) The transformation is resulting in no subcycles. SCC3: TIMES(s(x), y) -> TIMES(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(TIMES(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: TIMES(s(x), y) -> TIMES(x, y) This transformation is resulting in no new subcycles. SCC4: DIV(div(x, y), z) -> DIV(x, times(y, z)) QUOT(x, 0, s(z)) -> DIV(x, s(z)) QUOT(s(x), s(y), z) -> QUOT(x, y, z) DIV(x, y) -> QUOT(x, y, y) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. No rules need to be oriented. Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = x_1 POL(plus(x_1, x_2)) = 0 POL(DIV(x_1, x_2)) = x_1 POL(div(x_1, x_2)) = 1 + x_1 POL(QUOT(x_1, x_2, x_3)) = x_1 POL(times(x_1, x_2)) = 0 POL(0) = 0 POL(p(x_1)) = 0 resulting in one subcycle. SCC4.Polo1: QUOT(s(x), s(y), z) -> QUOT(x, y, z) DIV(x, y) -> QUOT(x, y, y) QUOT(x, 0, s(z)) -> DIV(x, s(z)) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. No rules need to be oriented. Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(DIV(x_1, x_2)) = x_1 POL(QUOT(x_1, x_2, x_3)) = x_1 POL(0) = 0 resulting in one subcycle. SCC4.Polo1.Polo1: QUOT(x, 0, s(z)) -> DIV(x, s(z)) DIV(x, y) -> QUOT(x, y, y) On this Scc, a Instantiation SCC transformation can be performed. As a result of transforming the rule DIV(x, y) -> QUOT(x, y, y) one new Dependency Pair is created: DIV(x'', s(z'')) -> QUOT(x'', s(z''), s(z'')) The transformation is resulting in no subcycles. SCC5: IF(false, x, y) -> PR(x, y) PR(x, s(s(y))) -> IF(divides(s(s(y)), x), x, s(y)) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. No rules need to be oriented. Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(plus(x_1, x_2)) = 0 POL(eq(x_1, x_2)) = 0 POL(0) = 0 POL(p(x_1)) = 0 POL(IF(x_1, x_2, x_3)) = 1 + x_3 POL(divides(x_1, x_2)) = 0 POL(quot(x_1, x_2, x_3)) = 0 POL(div(x_1, x_2)) = 0 POL(true) = 0 POL(times(x_1, x_2)) = 0 POL(PR(x_1, x_2)) = x_2 POL(false) = 0 resulting in no subcycles. Termination of R successfully shown. Duration: 1.717 seconds.