4.44/1.94 YES 4.44/1.94 proof of /export/starexec/sandbox/benchmark/theBenchmark.pl 4.44/1.94 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 4.44/1.94 4.44/1.94 4.44/1.94 Left Termination of the query pattern 4.44/1.94 4.44/1.94 flatten(g,a) 4.44/1.94 4.44/1.94 w.r.t. the given Prolog program could successfully be proven: 4.44/1.94 4.44/1.94 (0) Prolog 4.44/1.94 (1) PrologToPiTRSProof [SOUND, 0 ms] 4.44/1.94 (2) PiTRS 4.44/1.94 (3) DependencyPairsProof [EQUIVALENT, 0 ms] 4.44/1.94 (4) PiDP 4.44/1.94 (5) DependencyGraphProof [EQUIVALENT, 0 ms] 4.44/1.94 (6) PiDP 4.44/1.94 (7) UsableRulesProof [EQUIVALENT, 0 ms] 4.44/1.94 (8) PiDP 4.44/1.94 (9) PiDPToQDPProof [SOUND, 0 ms] 4.44/1.94 (10) QDP 4.44/1.94 (11) UsableRulesReductionPairsProof [EQUIVALENT, 8 ms] 4.44/1.94 (12) QDP 4.44/1.94 (13) PisEmptyProof [EQUIVALENT, 0 ms] 4.44/1.94 (14) YES 4.44/1.94 4.44/1.94 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (0) 4.44/1.94 Obligation: 4.44/1.94 Clauses: 4.44/1.94 4.44/1.94 flatten(atom(X), .(X, [])). 4.44/1.94 flatten(cons(atom(X), U), .(X, Y)) :- flatten(U, Y). 4.44/1.94 flatten(cons(cons(U, V), W), X) :- flatten(cons(U, cons(V, W)), X). 4.44/1.94 4.44/1.94 4.44/1.94 Query: flatten(g,a) 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (1) PrologToPiTRSProof (SOUND) 4.44/1.94 We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes: 4.44/1.94 4.44/1.94 flatten_in_2: (b,f) 4.44/1.94 4.44/1.94 Transforming Prolog into the following Term Rewriting System: 4.44/1.94 4.44/1.94 Pi-finite rewrite system: 4.44/1.94 The TRS R consists of the following rules: 4.44/1.94 4.44/1.94 flatten_in_ga(atom(X), .(X, [])) -> flatten_out_ga(atom(X), .(X, [])) 4.44/1.94 flatten_in_ga(cons(atom(X), U), .(X, Y)) -> U1_ga(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 flatten_in_ga(cons(cons(U, V), W), X) -> U2_ga(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 U2_ga(U, V, W, X, flatten_out_ga(cons(U, cons(V, W)), X)) -> flatten_out_ga(cons(cons(U, V), W), X) 4.44/1.94 U1_ga(X, U, Y, flatten_out_ga(U, Y)) -> flatten_out_ga(cons(atom(X), U), .(X, Y)) 4.44/1.94 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 flatten_in_ga(x1, x2) = flatten_in_ga(x1) 4.44/1.94 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 flatten_out_ga(x1, x2) = flatten_out_ga(x1, x2) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 U1_ga(x1, x2, x3, x4) = U1_ga(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_ga(x1, x2, x3, x4, x5) = U2_ga(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 4.44/1.94 4.44/1.94 4.44/1.94 4.44/1.94 Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog 4.44/1.94 4.44/1.94 4.44/1.94 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (2) 4.44/1.94 Obligation: 4.44/1.94 Pi-finite rewrite system: 4.44/1.94 The TRS R consists of the following rules: 4.44/1.94 4.44/1.94 flatten_in_ga(atom(X), .(X, [])) -> flatten_out_ga(atom(X), .(X, [])) 4.44/1.94 flatten_in_ga(cons(atom(X), U), .(X, Y)) -> U1_ga(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 flatten_in_ga(cons(cons(U, V), W), X) -> U2_ga(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 U2_ga(U, V, W, X, flatten_out_ga(cons(U, cons(V, W)), X)) -> flatten_out_ga(cons(cons(U, V), W), X) 4.44/1.94 U1_ga(X, U, Y, flatten_out_ga(U, Y)) -> flatten_out_ga(cons(atom(X), U), .(X, Y)) 4.44/1.94 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 flatten_in_ga(x1, x2) = flatten_in_ga(x1) 4.44/1.94 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 flatten_out_ga(x1, x2) = flatten_out_ga(x1, x2) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 U1_ga(x1, x2, x3, x4) = U1_ga(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_ga(x1, x2, x3, x4, x5) = U2_ga(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 4.44/1.94 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (3) DependencyPairsProof (EQUIVALENT) 4.44/1.94 Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem: 4.44/1.94 Pi DP problem: 4.44/1.94 The TRS P consists of the following rules: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> U1_GA(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> FLATTEN_IN_GA(U, Y) 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> U2_GA(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> FLATTEN_IN_GA(cons(U, cons(V, W)), X) 4.44/1.94 4.44/1.94 The TRS R consists of the following rules: 4.44/1.94 4.44/1.94 flatten_in_ga(atom(X), .(X, [])) -> flatten_out_ga(atom(X), .(X, [])) 4.44/1.94 flatten_in_ga(cons(atom(X), U), .(X, Y)) -> U1_ga(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 flatten_in_ga(cons(cons(U, V), W), X) -> U2_ga(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 U2_ga(U, V, W, X, flatten_out_ga(cons(U, cons(V, W)), X)) -> flatten_out_ga(cons(cons(U, V), W), X) 4.44/1.94 U1_ga(X, U, Y, flatten_out_ga(U, Y)) -> flatten_out_ga(cons(atom(X), U), .(X, Y)) 4.44/1.94 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 flatten_in_ga(x1, x2) = flatten_in_ga(x1) 4.44/1.94 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 flatten_out_ga(x1, x2) = flatten_out_ga(x1, x2) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 U1_ga(x1, x2, x3, x4) = U1_ga(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_ga(x1, x2, x3, x4, x5) = U2_ga(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(x1, x2) = FLATTEN_IN_GA(x1) 4.44/1.94 4.44/1.94 U1_GA(x1, x2, x3, x4) = U1_GA(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_GA(x1, x2, x3, x4, x5) = U2_GA(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 4.44/1.94 We have to consider all (P,R,Pi)-chains 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (4) 4.44/1.94 Obligation: 4.44/1.94 Pi DP problem: 4.44/1.94 The TRS P consists of the following rules: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> U1_GA(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> FLATTEN_IN_GA(U, Y) 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> U2_GA(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> FLATTEN_IN_GA(cons(U, cons(V, W)), X) 4.44/1.94 4.44/1.94 The TRS R consists of the following rules: 4.44/1.94 4.44/1.94 flatten_in_ga(atom(X), .(X, [])) -> flatten_out_ga(atom(X), .(X, [])) 4.44/1.94 flatten_in_ga(cons(atom(X), U), .(X, Y)) -> U1_ga(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 flatten_in_ga(cons(cons(U, V), W), X) -> U2_ga(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 U2_ga(U, V, W, X, flatten_out_ga(cons(U, cons(V, W)), X)) -> flatten_out_ga(cons(cons(U, V), W), X) 4.44/1.94 U1_ga(X, U, Y, flatten_out_ga(U, Y)) -> flatten_out_ga(cons(atom(X), U), .(X, Y)) 4.44/1.94 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 flatten_in_ga(x1, x2) = flatten_in_ga(x1) 4.44/1.94 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 flatten_out_ga(x1, x2) = flatten_out_ga(x1, x2) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 U1_ga(x1, x2, x3, x4) = U1_ga(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_ga(x1, x2, x3, x4, x5) = U2_ga(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(x1, x2) = FLATTEN_IN_GA(x1) 4.44/1.94 4.44/1.94 U1_GA(x1, x2, x3, x4) = U1_GA(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_GA(x1, x2, x3, x4, x5) = U2_GA(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 4.44/1.94 We have to consider all (P,R,Pi)-chains 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (5) DependencyGraphProof (EQUIVALENT) 4.44/1.94 The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 2 less nodes. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (6) 4.44/1.94 Obligation: 4.44/1.94 Pi DP problem: 4.44/1.94 The TRS P consists of the following rules: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> FLATTEN_IN_GA(cons(U, cons(V, W)), X) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> FLATTEN_IN_GA(U, Y) 4.44/1.94 4.44/1.94 The TRS R consists of the following rules: 4.44/1.94 4.44/1.94 flatten_in_ga(atom(X), .(X, [])) -> flatten_out_ga(atom(X), .(X, [])) 4.44/1.94 flatten_in_ga(cons(atom(X), U), .(X, Y)) -> U1_ga(X, U, Y, flatten_in_ga(U, Y)) 4.44/1.94 flatten_in_ga(cons(cons(U, V), W), X) -> U2_ga(U, V, W, X, flatten_in_ga(cons(U, cons(V, W)), X)) 4.44/1.94 U2_ga(U, V, W, X, flatten_out_ga(cons(U, cons(V, W)), X)) -> flatten_out_ga(cons(cons(U, V), W), X) 4.44/1.94 U1_ga(X, U, Y, flatten_out_ga(U, Y)) -> flatten_out_ga(cons(atom(X), U), .(X, Y)) 4.44/1.94 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 flatten_in_ga(x1, x2) = flatten_in_ga(x1) 4.44/1.94 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 flatten_out_ga(x1, x2) = flatten_out_ga(x1, x2) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 U1_ga(x1, x2, x3, x4) = U1_ga(x1, x2, x4) 4.44/1.94 4.44/1.94 U2_ga(x1, x2, x3, x4, x5) = U2_ga(x1, x2, x3, x5) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(x1, x2) = FLATTEN_IN_GA(x1) 4.44/1.94 4.44/1.94 4.44/1.94 We have to consider all (P,R,Pi)-chains 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (7) UsableRulesProof (EQUIVALENT) 4.44/1.94 For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (8) 4.44/1.94 Obligation: 4.44/1.94 Pi DP problem: 4.44/1.94 The TRS P consists of the following rules: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W), X) -> FLATTEN_IN_GA(cons(U, cons(V, W)), X) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U), .(X, Y)) -> FLATTEN_IN_GA(U, Y) 4.44/1.94 4.44/1.94 R is empty. 4.44/1.94 The argument filtering Pi contains the following mapping: 4.44/1.94 atom(x1) = atom(x1) 4.44/1.94 4.44/1.94 cons(x1, x2) = cons(x1, x2) 4.44/1.94 4.44/1.94 .(x1, x2) = .(x1, x2) 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(x1, x2) = FLATTEN_IN_GA(x1) 4.44/1.94 4.44/1.94 4.44/1.94 We have to consider all (P,R,Pi)-chains 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (9) PiDPToQDPProof (SOUND) 4.44/1.94 Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (10) 4.44/1.94 Obligation: 4.44/1.94 Q DP problem: 4.44/1.94 The TRS P consists of the following rules: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W)) -> FLATTEN_IN_GA(cons(U, cons(V, W))) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U)) -> FLATTEN_IN_GA(U) 4.44/1.94 4.44/1.94 R is empty. 4.44/1.94 Q is empty. 4.44/1.94 We have to consider all (P,Q,R)-chains. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (11) UsableRulesReductionPairsProof (EQUIVALENT) 4.44/1.94 By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well. 4.44/1.94 4.44/1.94 The following dependency pairs can be deleted: 4.44/1.94 4.44/1.94 FLATTEN_IN_GA(cons(cons(U, V), W)) -> FLATTEN_IN_GA(cons(U, cons(V, W))) 4.44/1.94 FLATTEN_IN_GA(cons(atom(X), U)) -> FLATTEN_IN_GA(U) 4.44/1.94 No rules are removed from R. 4.44/1.94 4.44/1.94 Used ordering: POLO with Polynomial interpretation [POLO]: 4.44/1.94 4.44/1.94 POL(FLATTEN_IN_GA(x_1)) = 2*x_1 4.44/1.94 POL(atom(x_1)) = x_1 4.44/1.94 POL(cons(x_1, x_2)) = 1 + 2*x_1 + x_2 4.44/1.94 4.44/1.94 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (12) 4.44/1.94 Obligation: 4.44/1.94 Q DP problem: 4.44/1.94 P is empty. 4.44/1.94 R is empty. 4.44/1.94 Q is empty. 4.44/1.94 We have to consider all (P,Q,R)-chains. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (13) PisEmptyProof (EQUIVALENT) 4.44/1.94 The TRS P is empty. Hence, there is no (P,Q,R) chain. 4.44/1.94 ---------------------------------------- 4.44/1.94 4.44/1.94 (14) 4.44/1.94 YES 4.55/2.00 EOF