Term Rewriting System R: [y, x] le(0, y) -> true le(s(x), 0) -> false le(s(x), s(y)) -> le(x, y) minus(x, 0) -> x minus(0, x) -> 0 minus(s(x), s(y)) -> minus(x, y) gcd(0, y) -> y gcd(s(x), 0) -> s(x) gcd(s(x), s(y)) -> if_gcd(le(y, x), s(x), s(y)) if_gcd(true, x, y) -> gcd(minus(x, y), y) if_gcd(false, x, y) -> gcd(minus(y, x), x) Innermost Termination of R to be shown. R contains the following Dependency Pairs: LE(s(x), s(y)) -> LE(x, y) GCD(s(x), s(y)) -> IF_GCD(le(y, x), s(x), s(y)) GCD(s(x), s(y)) -> LE(y, x) IF_GCD(false, x, y) -> GCD(minus(y, x), x) IF_GCD(false, x, y) -> MINUS(y, x) IF_GCD(true, x, y) -> GCD(minus(x, y), y) IF_GCD(true, x, y) -> MINUS(x, y) MINUS(s(x), s(y)) -> MINUS(x, y) Furthermore, R contains three SCCs. SCC1: LE(s(x), s(y)) -> LE(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(LE(x_1, x_2)) = 1 + x_1 + x_2 POL(s(x_1)) = 1 + x_1 The following Dependency Pairs can be deleted: LE(s(x), s(y)) -> LE(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: IF_GCD(true, x, y) -> GCD(minus(x, y), y) IF_GCD(false, x, y) -> GCD(minus(y, x), x) GCD(s(x), s(y)) -> IF_GCD(le(y, x), s(x), s(y)) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule GCD(s(x), s(y)) -> IF_GCD(le(y, x), s(x), s(y)) three new Dependency Pairs are created: GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) GCD(s(0), s(s(x''))) -> IF_GCD(false, s(0), s(s(x''))) The transformation is resulting in one subcycle: SCC3.Nar1: GCD(s(0), s(s(x''))) -> IF_GCD(false, s(0), s(s(x''))) GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) IF_GCD(false, x, y) -> GCD(minus(y, x), x) GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) IF_GCD(true, x, y) -> GCD(minus(x, y), y) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule IF_GCD(false, x, y) -> GCD(minus(y, x), x) three new Dependency Pairs are created: IF_GCD(false, s(y''), s(x'')) -> GCD(minus(x'', y''), s(y'')) IF_GCD(false, 0, y') -> GCD(y', 0) IF_GCD(false, x'', 0) -> GCD(0, x'') The transformation is resulting in one subcycle: SCC3.Nar1.Nar1: GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) IF_GCD(true, x, y) -> GCD(minus(x, y), y) GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) IF_GCD(false, s(y''), s(x'')) -> GCD(minus(x'', y''), s(y'')) GCD(s(0), s(s(x''))) -> IF_GCD(false, s(0), s(s(x''))) On this Scc, a Narrowing SCC transformation can be performed. As a result of transforming the rule IF_GCD(true, x, y) -> GCD(minus(x, y), y) three new Dependency Pairs are created: IF_GCD(true, s(x''), s(y'')) -> GCD(minus(x'', y''), s(y'')) IF_GCD(true, x'', 0) -> GCD(x'', 0) IF_GCD(true, 0, y') -> GCD(0, y') The transformation is resulting in one subcycle: SCC3.Nar1.Nar1.Nar1: GCD(s(0), s(s(x''))) -> IF_GCD(false, s(0), s(s(x''))) IF_GCD(false, s(y''), s(x'')) -> GCD(minus(x'', y''), s(y'')) GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) IF_GCD(true, s(x''), s(y'')) -> GCD(minus(x'', y''), s(y'')) GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) On this Scc, a Instantiation SCC transformation can be performed. As a result of transforming the rule IF_GCD(false, s(y''), s(x'')) -> GCD(minus(x'', y''), s(y'')) two new Dependency Pairs are created: IF_GCD(false, s(s(y'''')), s(s(x''''))) -> GCD(minus(s(x''''), s(y'''')), s(s(y''''))) IF_GCD(false, s(0), s(s(x''''))) -> GCD(minus(s(x''''), 0), s(0)) The transformation is resulting in one subcycle: SCC3.Nar1.Nar1.Nar1.Inst1: IF_GCD(false, s(s(y'''')), s(s(x''''))) -> GCD(minus(s(x''''), s(y'''')), s(s(y''''))) GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) IF_GCD(true, s(x''), s(y'')) -> GCD(minus(x'', y''), s(y'')) GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) IF_GCD(false, s(0), s(s(x''''))) -> GCD(minus(s(x''''), 0), s(0)) GCD(s(0), s(s(x''))) -> IF_GCD(false, s(0), s(s(x''))) On this Scc, a Instantiation SCC transformation can be performed. As a result of transforming the rule IF_GCD(true, s(x''), s(y'')) -> GCD(minus(x'', y''), s(y'')) two new Dependency Pairs are created: IF_GCD(true, s(s(y'''')), s(s(x''''))) -> GCD(minus(s(y''''), s(x'''')), s(s(x''''))) IF_GCD(true, s(x''''), s(0)) -> GCD(minus(x'''', 0), s(0)) The transformation is resulting in two subcycles: SCC3.Nar1.Nar1.Nar1.Inst1.Inst1: IF_GCD(true, s(x''''), s(0)) -> GCD(minus(x'''', 0), s(0)) GCD(s(x'), s(0)) -> IF_GCD(true, s(x'), s(0)) 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 minus(0, x) -> 0 Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(minus(x_1, x_2)) = x_1 POL(true) = 0 POL(IF_GCD(x_1, x_2, x_3)) = x_2 POL(GCD(x_1, x_2)) = x_1 POL(0) = 0 resulting in no subcycles. SCC3.Nar1.Nar1.Nar1.Inst1.Inst2: IF_GCD(true, s(s(y'''')), s(s(x''''))) -> GCD(minus(s(y''''), s(x'''')), s(s(x''''))) GCD(s(s(y'')), s(s(x''))) -> IF_GCD(le(x'', y''), s(s(y'')), s(s(x''))) IF_GCD(false, s(s(y'''')), s(s(x''''))) -> GCD(minus(s(x''''), s(y'''')), s(s(y''''))) 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 minus(0, x) -> 0 Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(le(x_1, x_2)) = 0 POL(minus(x_1, x_2)) = x_1 POL(true) = 0 POL(IF_GCD(x_1, x_2, x_3)) = x_2 + x_3 POL(GCD(x_1, x_2)) = x_1 + x_2 POL(0) = 0 POL(false) = 0 resulting in no subcycles. Innermost Termination of R successfully shown. Duration: 11.316 seconds.