Term Rewriting System R: [X, Y] fact(X) -> if(zero(X), s(0), 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)) if(true, X, Y) -> X if(false, X, Y) -> Y zero(0) -> true zero(s(X)) -> false p(s(X)) -> 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: ADD(s(X), Y) -> ADD(X, Y) FACT(X) -> IF(zero(X), s(0), prod(X, fact(p(X)))) FACT(X) -> ZERO(X) FACT(X) -> PROD(X, fact(p(X))) FACT(X) -> FACT(p(X)) FACT(X) -> P(X) PROD(s(X), Y) -> ADD(Y, prod(X, Y)) PROD(s(X), Y) -> PROD(X, Y) 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: p(s(X)) -> X This transformation is resulting in one new subcycle: SCC3.MRR1: 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.659 seconds.