2.17/1.06 YES 2.17/1.07 We consider the system theBenchmark. 2.17/1.07 2.17/1.07 Alphabet: 2.17/1.07 2.17/1.07 0 : [] --> nat 2.17/1.07 build : [nat] --> list 2.17/1.07 collapse : [list] --> nat 2.17/1.07 cons : [nat -> nat * list] --> list 2.17/1.07 diff : [nat * nat] --> nat 2.17/1.07 gcd : [nat * nat] --> nat 2.17/1.07 min : [nat * nat] --> nat 2.17/1.07 nil : [] --> list 2.17/1.07 s : [nat] --> nat 2.17/1.07 2.17/1.07 Rules: 2.17/1.07 2.17/1.07 min(x, 0) => 0 2.17/1.07 min(0, x) => 0 2.17/1.07 min(s(x), s(y)) => s(min(x, y)) 2.17/1.07 diff(x, 0) => x 2.17/1.07 diff(0, x) => x 2.17/1.07 diff(s(x), s(y)) => diff(x, y) 2.17/1.07 gcd(s(x), 0) => s(x) 2.17/1.07 gcd(0, s(x)) => s(x) 2.17/1.07 gcd(s(x), s(y)) => gcd(diff(x, y), s(min(x, y))) 2.17/1.07 collapse(nil) => 0 2.17/1.07 collapse(cons(f, x)) => f collapse(x) 2.17/1.07 build(0) => nil 2.17/1.07 build(s(x)) => cons(/\y.gcd(y, x), build(x)) 2.17/1.07 2.17/1.07 This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). 2.17/1.07 2.17/1.07 We observe that the rules contain a first-order subset: 2.17/1.07 2.17/1.07 min(X, 0) => 0 2.17/1.07 min(0, X) => 0 2.17/1.07 min(s(X), s(Y)) => s(min(X, Y)) 2.17/1.07 diff(X, 0) => X 2.17/1.07 diff(0, X) => X 2.17/1.07 diff(s(X), s(Y)) => diff(X, Y) 2.17/1.07 gcd(s(X), 0) => s(X) 2.17/1.07 gcd(0, s(X)) => s(X) 2.17/1.07 gcd(s(X), s(Y)) => gcd(diff(X, Y), s(min(X, Y))) 2.17/1.07 2.17/1.07 Moreover, the system is finitely branching. Thus, by [Kop12, Thm. 7.55], we may omit all first-order dependency pairs from the dependency pair problem (DP(R), R) if this first-order part is Ce-terminating when seen as a many-sorted first-order TRS. 2.17/1.07 2.17/1.07 According to the external first-order termination prover, this system is indeed Ce-terminating: 2.17/1.07 2.17/1.07 || proof of resources/system.trs 2.17/1.07 || # AProVE Commit ID: d84c10301d352dfd14de2104819581f4682260f5 fuhs 20130616 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || Termination w.r.t. Q of the given QTRS could be proven: 2.17/1.07 || 2.17/1.07 || (0) QTRS 2.17/1.07 || (1) DependencyPairsProof [EQUIVALENT] 2.17/1.07 || (2) QDP 2.17/1.07 || (3) DependencyGraphProof [EQUIVALENT] 2.17/1.07 || (4) AND 2.17/1.07 || (5) QDP 2.17/1.07 || (6) UsableRulesProof [EQUIVALENT] 2.17/1.07 || (7) QDP 2.17/1.07 || (8) QDPSizeChangeProof [EQUIVALENT] 2.17/1.07 || (9) YES 2.17/1.07 || (10) QDP 2.17/1.07 || (11) UsableRulesProof [EQUIVALENT] 2.17/1.07 || (12) QDP 2.17/1.07 || (13) QDPSizeChangeProof [EQUIVALENT] 2.17/1.07 || (14) YES 2.17/1.07 || (15) QDP 2.17/1.07 || (16) QDPOrderProof [EQUIVALENT] 2.17/1.07 || (17) QDP 2.17/1.07 || (18) PisEmptyProof [EQUIVALENT] 2.17/1.07 || (19) YES 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (0) 2.17/1.07 || Obligation: 2.17/1.07 || Q restricted rewrite system: 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (1) DependencyPairsProof (EQUIVALENT) 2.17/1.07 || Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (2) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || MIN(s(%X), s(%Y)) -> MIN(%X, %Y) 2.17/1.07 || DIFF(s(%X), s(%Y)) -> DIFF(%X, %Y) 2.17/1.07 || GCD(s(%X), s(%Y)) -> GCD(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || GCD(s(%X), s(%Y)) -> DIFF(%X, %Y) 2.17/1.07 || GCD(s(%X), s(%Y)) -> MIN(%X, %Y) 2.17/1.07 || 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (3) DependencyGraphProof (EQUIVALENT) 2.17/1.07 || The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 3 SCCs with 2 less nodes. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (4) 2.17/1.07 || Complex Obligation (AND) 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (5) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || DIFF(s(%X), s(%Y)) -> DIFF(%X, %Y) 2.17/1.07 || 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (6) UsableRulesProof (EQUIVALENT) 2.17/1.07 || We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (7) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || DIFF(s(%X), s(%Y)) -> DIFF(%X, %Y) 2.17/1.07 || 2.17/1.07 || R is empty. 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (8) QDPSizeChangeProof (EQUIVALENT) 2.17/1.07 || By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem. 2.17/1.07 || 2.17/1.07 || From the DPs we obtained the following set of size-change graphs: 2.17/1.07 || *DIFF(s(%X), s(%Y)) -> DIFF(%X, %Y) 2.17/1.07 || The graph contains the following edges 1 > 1, 2 > 2 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (9) 2.17/1.07 || YES 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (10) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || MIN(s(%X), s(%Y)) -> MIN(%X, %Y) 2.17/1.07 || 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (11) UsableRulesProof (EQUIVALENT) 2.17/1.07 || We can use the usable rules and reduction pair processor [LPAR04] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its arguments. Then, we can delete all non-usable rules [FROCOS05] from R. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (12) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || MIN(s(%X), s(%Y)) -> MIN(%X, %Y) 2.17/1.07 || 2.17/1.07 || R is empty. 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (13) QDPSizeChangeProof (EQUIVALENT) 2.17/1.07 || By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem. 2.17/1.07 || 2.17/1.07 || From the DPs we obtained the following set of size-change graphs: 2.17/1.07 || *MIN(s(%X), s(%Y)) -> MIN(%X, %Y) 2.17/1.07 || The graph contains the following edges 1 > 1, 2 > 2 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (14) 2.17/1.07 || YES 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (15) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || The TRS P consists of the following rules: 2.17/1.07 || 2.17/1.07 || GCD(s(%X), s(%Y)) -> GCD(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (16) QDPOrderProof (EQUIVALENT) 2.17/1.07 || We use the reduction pair processor [LPAR04,JAR06]. 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || The following pairs can be oriented strictly and are deleted. 2.17/1.07 || 2.17/1.07 || GCD(s(%X), s(%Y)) -> GCD(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || The remaining pairs can at least be oriented weakly. 2.17/1.07 || Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation: 2.17/1.07 || 2.17/1.07 || POL( GCD_2(x_1, x_2) ) = max{0, 2x_1 + x_2 - 2} 2.17/1.07 || POL( diff_2(x_1, x_2) ) = x_1 + x_2 2.17/1.07 || POL( 0 ) = 0 2.17/1.07 || POL( s_1(x_1) ) = 2x_1 + 2 2.17/1.07 || POL( min_2(x_1, x_2) ) = x_1 2.17/1.07 || 2.17/1.07 || The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented: 2.17/1.07 || 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || 2.17/1.07 || 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (17) 2.17/1.07 || Obligation: 2.17/1.07 || Q DP problem: 2.17/1.07 || P is empty. 2.17/1.07 || The TRS R consists of the following rules: 2.17/1.07 || 2.17/1.07 || min(%X, 0) -> 0 2.17/1.07 || min(0, %X) -> 0 2.17/1.07 || min(s(%X), s(%Y)) -> s(min(%X, %Y)) 2.17/1.07 || diff(%X, 0) -> %X 2.17/1.07 || diff(0, %X) -> %X 2.17/1.07 || diff(s(%X), s(%Y)) -> diff(%X, %Y) 2.17/1.07 || gcd(s(%X), 0) -> s(%X) 2.17/1.07 || gcd(0, s(%X)) -> s(%X) 2.17/1.07 || gcd(s(%X), s(%Y)) -> gcd(diff(%X, %Y), s(min(%X, %Y))) 2.17/1.07 || ~PAIR(%X, %Y) -> %X 2.17/1.07 || ~PAIR(%X, %Y) -> %Y 2.17/1.07 || 2.17/1.07 || Q is empty. 2.17/1.07 || We have to consider all minimal (P,Q,R)-chains. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (18) PisEmptyProof (EQUIVALENT) 2.17/1.07 || The TRS P is empty. Hence, there is no (P,Q,R) chain. 2.17/1.07 || ---------------------------------------- 2.17/1.07 || 2.17/1.07 || (19) 2.17/1.07 || YES 2.17/1.07 || 2.17/1.07 We use the dependency pair framework as described in [Kop12, Ch. 6/7], with static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs and accessible arguments in [Kop13]). 2.17/1.07 2.17/1.07 We thus obtain the following dependency pair problem (P_0, R_0, static, formative): 2.17/1.07 2.17/1.07 Dependency Pairs P_0: 2.17/1.07 2.17/1.07 0] collapse#(cons(F, X)) =#> collapse#(X) 2.17/1.07 1] build#(s(X)) =#> gcd#(Y, X) 2.17/1.07 2] build#(s(X)) =#> build#(X) 2.17/1.07 2.17/1.07 Rules R_0: 2.17/1.07 2.17/1.07 min(X, 0) => 0 2.17/1.07 min(0, X) => 0 2.17/1.07 min(s(X), s(Y)) => s(min(X, Y)) 2.17/1.07 diff(X, 0) => X 2.17/1.07 diff(0, X) => X 2.17/1.07 diff(s(X), s(Y)) => diff(X, Y) 2.17/1.07 gcd(s(X), 0) => s(X) 2.17/1.07 gcd(0, s(X)) => s(X) 2.17/1.07 gcd(s(X), s(Y)) => gcd(diff(X, Y), s(min(X, Y))) 2.17/1.07 collapse(nil) => 0 2.17/1.07 collapse(cons(F, X)) => F collapse(X) 2.17/1.07 build(0) => nil 2.17/1.07 build(s(X)) => cons(/\x.gcd(x, X), build(X)) 2.17/1.07 2.17/1.07 Thus, the original system is terminating if (P_0, R_0, static, formative) is finite. 2.17/1.07 2.17/1.07 We consider the dependency pair problem (P_0, R_0, static, formative). 2.17/1.07 2.17/1.07 We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: 2.17/1.07 2.17/1.07 * 0 : 0 2.17/1.07 * 1 : 2.17/1.07 * 2 : 1, 2 2.17/1.07 2.17/1.07 This graph has the following strongly connected components: 2.17/1.07 2.17/1.07 P_1: 2.17/1.07 2.17/1.07 collapse#(cons(F, X)) =#> collapse#(X) 2.17/1.07 2.17/1.07 P_2: 2.17/1.07 2.17/1.07 build#(s(X)) =#> build#(X) 2.17/1.07 2.17/1.07 By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f) and (P_2, R_0, m, f). 2.17/1.07 2.17/1.07 Thus, the original system is terminating if each of (P_1, R_0, static, formative) and (P_2, R_0, static, formative) is finite. 2.17/1.07 2.17/1.07 We consider the dependency pair problem (P_2, R_0, static, formative). 2.17/1.07 2.17/1.07 We apply the subterm criterion with the following projection function: 2.17/1.07 2.17/1.07 nu(build#) = 1 2.17/1.07 2.17/1.07 Thus, we can orient the dependency pairs as follows: 2.17/1.07 2.17/1.07 nu(build#(s(X))) = s(X) |> X = nu(build#(X)) 2.17/1.07 2.17/1.07 By [Kop12, Thm. 7.35] and [Kop13, Thm. 5], we may replace a dependency pair problem (P_2, R_0, static, f) by ({}, R_0, static, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. 2.17/1.07 2.17/1.07 Thus, the original system is terminating if (P_1, R_0, static, formative) is finite. 2.17/1.07 2.17/1.07 We consider the dependency pair problem (P_1, R_0, static, formative). 2.17/1.07 2.17/1.07 We apply the subterm criterion with the following projection function: 2.17/1.07 2.17/1.07 nu(collapse#) = 1 2.17/1.07 2.17/1.07 Thus, we can orient the dependency pairs as follows: 2.17/1.07 2.17/1.07 nu(collapse#(cons(F, X))) = cons(F, X) |> X = nu(collapse#(X)) 2.17/1.07 2.17/1.07 By [Kop12, Thm. 7.35] and [Kop13, Thm. 5], we may replace a dependency pair problem (P_1, R_0, static, f) by ({}, R_0, static, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. 2.17/1.07 2.17/1.07 As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. 2.17/1.07 2.17/1.07 2.17/1.07 +++ Citations +++ 2.17/1.07 2.17/1.07 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 2.17/1.07 [Kop13] C. Kop. Static Dependency Pairs with Accessibility. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/static.pdf, 2013. 2.17/1.07 [KusIsoSakBla09] K. Kusakari, Y. Isogai, M. Sakai, and F. Blanqui. Static Dependency Pair Method Based On Strong Computability for Higher-Order Rewrite Systems. In volume 92(10) of IEICE Transactions on Information and Systems. 2007--2015, 2009. 2.17/1.07 EOF