Term Rewriting System R: [X, Y, X1, X2] fact(X) -> if(zero(X), n__s(0), n__prod(X, fact(p(X)))) add(0, X) -> X add(s(X), Y) -> s(add(X, Y)) prod(0, X) -> 0 prod(s(X), Y) -> add(Y, prod(X, Y)) prod(X1, X2) -> n__prod(X1, X2) if(true, X, Y) -> activate(X) if(false, X, Y) -> activate(Y) zero(0) -> true zero(s(X)) -> false p(s(X)) -> X s(X) -> n__s(X) activate(n__s(X)) -> s(X) activate(n__prod(X1, X2)) -> prod(X1, X2) activate(X) -> X Termination of R to be shown. R contains the following Dependency Pairs: ADD(s(X), Y) -> S(add(X, Y)) ADD(s(X), Y) -> ADD(X, Y) FACT(X) -> IF(zero(X), n__s(0), n__prod(X, fact(p(X)))) FACT(X) -> ZERO(X) FACT(X) -> FACT(p(X)) FACT(X) -> P(X) IF(false, X, Y) -> ACTIVATE(Y) IF(true, X, Y) -> ACTIVATE(X) PROD(s(X), Y) -> ADD(Y, prod(X, Y)) PROD(s(X), Y) -> PROD(X, Y) ACTIVATE(n__s(X)) -> S(X) ACTIVATE(n__prod(X1, X2)) -> PROD(X1, X2) Furthermore, R contains three SCCs. SCC1: ADD(s(X), Y) -> ADD(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(ADD(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: ADD(s(X), Y) -> ADD(X, Y) This transformation is resulting in no new subcycles. SCC2: PROD(s(X), Y) -> PROD(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(PROD(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: PROD(s(X), Y) -> PROD(X, Y) This transformation is resulting in no new subcycles. SCC3: FACT(X) -> FACT(p(X)) 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(FACT(x_1)) = 1 + x_1 POL(p(x_1)) = x_1 No Dependency Pairs can be deleted. The following rules of R can be deleted: add(0, X) -> X add(s(X), Y) -> s(add(X, Y)) fact(X) -> if(zero(X), n__s(0), n__prod(X, fact(p(X)))) if(false, X, Y) -> activate(Y) if(true, X, Y) -> activate(X) zero(s(X)) -> false zero(0) -> true prod(X1, X2) -> n__prod(X1, X2) prod(0, X) -> 0 prod(s(X), Y) -> add(Y, prod(X, Y)) s(X) -> n__s(X) activate(n__s(X)) -> s(X) activate(X) -> X activate(n__prod(X1, X2)) -> prod(X1, X2) p(s(X)) -> X This transformation is resulting in one new subcycle: SCC3.MRR1: FACT(X) -> FACT(p(X)) Applying the non-overlappingness check to the DPs. The transformation is resulting in one subcycle: SCC3.MRR1.NOC1: FACT(X) -> FACT(p(X)) Found an infinite P-chain over R: P = FACT(X) -> FACT(p(X)) R = [] s = FACT(X) evaluates to t = FACT(p(X)) Thus, s starts an infinite reduction as s matches t. Non-Termination of R could be shown. Duration: 0.770 seconds.