/export/starexec/sandbox2/solver/bin/starexec_run_standard /export/starexec/sandbox2/benchmark/theBenchmark.pl /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES proof of /export/starexec/sandbox2/benchmark/theBenchmark.pl # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty Left Termination of the query pattern select(g,g,a) w.r.t. the given Prolog program could successfully be proven: (0) Prolog (1) PrologToDTProblemTransformerProof [SOUND, 0 ms] (2) TRIPLES (3) TriplesToPiDPProof [SOUND, 0 ms] (4) PiDP (5) DependencyGraphProof [EQUIVALENT, 0 ms] (6) PiDP (7) PiDPToQDPProof [SOUND, 0 ms] (8) QDP (9) QDPSizeChangeProof [EQUIVALENT, 0 ms] (10) YES ---------------------------------------- (0) Obligation: Clauses: select(X1, [], X2) :- ','(!, failure(a)). select(X, Y, Zs) :- ','(head(Y, X), tail(Y, Zs)). select(X, Y, .(H, Zs)) :- ','(head(Y, H), ','(tail(Y, T), select(X, T, Zs))). head([], X3). head(.(H, X4), H). tail([], []). tail(.(X5, T), T). failure(b). Query: select(g,g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 2, "program": { "directives": [], "clauses": [ [ "(select X1 ([]) X2)", "(',' (!) (failure (a)))" ], [ "(select X Y Zs)", "(',' (head Y X) (tail Y Zs))" ], [ "(select X Y (. H Zs))", "(',' (head Y H) (',' (tail Y T) (select X T Zs)))" ], [ "(head ([]) X3)", null ], [ "(head (. H X4) H)", null ], [ "(tail ([]) ([]))", null ], [ "(tail (. X5 T) T)", null ], [ "(failure (b))", null ] ] }, "graph": { "nodes": { "22": { "goal": [ { "clause": 0, "scope": 1, "term": "(select T1 T2 T3)" }, { "clause": 1, "scope": 1, "term": "(select T1 T2 T3)" }, { "clause": 2, "scope": 1, "term": "(select T1 T2 T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "44": { "goal": [ { "clause": 1, "scope": 1, "term": "(select T1 T2 T3)" }, { "clause": 2, "scope": 1, "term": "(select T1 T2 T3)" } ], "kb": { "nonunifying": [[ "(select T1 T2 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "type": "Nodes", "298": { "goal": [{ "clause": -1, "scope": -1, "term": "(failure (a))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "299": { "goal": [{ "clause": 7, "scope": 2, "term": "(failure (a))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "332": { "goal": [{ "clause": 4, "scope": 5, "term": "(',' (head T41 T44) (',' (tail T41 X46) (select T40 X46 T45)))" }], "kb": { "nonunifying": [[ "(select T40 T41 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T41" ], "free": [ "X8", "X9", "X46" ], "exprvars": [] } }, "312": { "goal": [{ "clause": -1, "scope": -1, "term": "(tail (. T24 T25) T14)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T24", "T25" ], "free": [], "exprvars": [] } }, "314": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "336": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (tail (. T53 T54) X46) (select T40 X46 T55))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T53", "T54" ], "free": ["X46"], "exprvars": [] } }, "337": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "316": { "goal": [ { "clause": 5, "scope": 4, "term": "(tail (. T24 T25) T14)" }, { "clause": 6, "scope": 4, "term": "(tail (. T24 T25) T14)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T24", "T25" ], "free": [], "exprvars": [] } }, "338": { "goal": [ { "clause": 5, "scope": 6, "term": "(',' (tail (. T53 T54) X46) (select T40 X46 T55))" }, { "clause": 6, "scope": 6, "term": "(',' (tail (. T53 T54) X46) (select T40 X46 T55))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T53", "T54" ], "free": ["X46"], "exprvars": [] } }, "317": { "goal": [{ "clause": 6, "scope": 4, "term": "(tail (. T24 T25) T14)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T24", "T25" ], "free": [], "exprvars": [] } }, "339": { "goal": [{ "clause": 6, "scope": 6, "term": "(',' (tail (. T53 T54) X46) (select T40 X46 T55))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T53", "T54" ], "free": ["X46"], "exprvars": [] } }, "318": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "319": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "340": { "goal": [{ "clause": -1, "scope": -1, "term": "(select T40 T65 T55)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T65" ], "free": [], "exprvars": [] } }, "320": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "2": { "goal": [{ "clause": -1, "scope": -1, "term": "(select T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "321": { "goal": [{ "clause": 2, "scope": 1, "term": "(select T11 T12 T3)" }], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "300": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "325": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (head T41 T44) (',' (tail T41 X46) (select T40 X46 T45)))" }], "kb": { "nonunifying": [[ "(select T40 T41 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T41" ], "free": [ "X8", "X9", "X46" ], "exprvars": [] } }, "304": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (head T12 T11) (tail T12 T14))" }, { "clause": 2, "scope": 1, "term": "(select T11 T12 T3)" } ], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "326": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "305": { "goal": [ { "clause": 3, "scope": 3, "term": "(',' (head T12 T11) (tail T12 T14))" }, { "clause": 4, "scope": 3, "term": "(',' (head T12 T11) (tail T12 T14))" }, { "clause": -1, "scope": 3, "term": null }, { "clause": 2, "scope": 1, "term": "(select T11 T12 T3)" } ], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "328": { "goal": [ { "clause": 3, "scope": 5, "term": "(',' (head T41 T44) (',' (tail T41 X46) (select T40 X46 T45)))" }, { "clause": 4, "scope": 5, "term": "(',' (head T41 T44) (',' (tail T41 X46) (select T40 X46 T45)))" } ], "kb": { "nonunifying": [[ "(select T40 T41 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T40", "T41" ], "free": [ "X8", "X9", "X46" ], "exprvars": [] } }, "307": { "goal": [ { "clause": 4, "scope": 3, "term": "(',' (head T12 T11) (tail T12 T14))" }, { "clause": -1, "scope": 3, "term": null }, { "clause": 2, "scope": 1, "term": "(select T11 T12 T3)" } ], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "308": { "goal": [{ "clause": 4, "scope": 3, "term": "(',' (head T12 T11) (tail T12 T14))" }], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "309": { "goal": [ { "clause": -1, "scope": 3, "term": null }, { "clause": 2, "scope": 1, "term": "(select T11 T12 T3)" } ], "kb": { "nonunifying": [[ "(select T11 T12 T3)", "(select X8 ([]) X9)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T12" ], "free": [ "X8", "X9" ], "exprvars": [] } }, "42": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_1) (failure (a)))" }, { "clause": 1, "scope": 1, "term": "(select T6 ([]) T3)" }, { "clause": 2, "scope": 1, "term": "(select T6 ([]) T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } } }, "edges": [ { "from": 2, "to": 22, "label": "CASE" }, { "from": 22, "to": 42, "label": "EVAL with clause\nselect(X8, [], X9) :- ','(!_1, failure(a)).\nand substitutionT1 -> T6,\nX8 -> T6,\nT2 -> [],\nT3 -> T7,\nX9 -> T7" }, { "from": 22, "to": 44, "label": "EVAL-BACKTRACK" }, { "from": 42, "to": 298, "label": "CUT" }, { "from": 44, "to": 304, "label": "ONLY EVAL with clause\nselect(X13, X14, X15) :- ','(head(X14, X13), tail(X14, X15)).\nand substitutionT1 -> T11,\nX13 -> T11,\nT2 -> T12,\nX14 -> T12,\nT3 -> T14,\nX15 -> T14,\nT13 -> T14" }, { "from": 298, "to": 299, "label": "CASE" }, { "from": 299, "to": 300, "label": "BACKTRACK\nfor clause: failure(b)because of non-unification" }, { "from": 304, "to": 305, "label": "CASE" }, { "from": 305, "to": 307, "label": "BACKTRACK\nfor clause: head([], X3)\nwith clash: (select(T11, T12, T3), select(X8, [], X9))" }, { "from": 307, "to": 308, "label": "PARALLEL" }, { "from": 307, "to": 309, "label": "PARALLEL" }, { "from": 308, "to": 312, "label": "EVAL with clause\nhead(.(X25, X26), X25).\nand substitutionX25 -> T24,\nX26 -> T25,\nT12 -> .(T24, T25),\nT11 -> T24" }, { "from": 308, "to": 314, "label": "EVAL-BACKTRACK" }, { "from": 309, "to": 321, "label": "FAILURE" }, { "from": 312, "to": 316, "label": "CASE" }, { "from": 316, "to": 317, "label": "BACKTRACK\nfor clause: tail([], [])because of non-unification" }, { "from": 317, "to": 318, "label": "EVAL with clause\ntail(.(X31, X32), X32).\nand substitutionT24 -> T30,\nX31 -> T30,\nT25 -> T31,\nX32 -> T31,\nT14 -> T31" }, { "from": 317, "to": 319, "label": "EVAL-BACKTRACK" }, { "from": 318, "to": 320, "label": "SUCCESS" }, { "from": 321, "to": 325, "label": "EVAL with clause\nselect(X42, X43, .(X44, X45)) :- ','(head(X43, X44), ','(tail(X43, X46), select(X42, X46, X45))).\nand substitutionT11 -> T40,\nX42 -> T40,\nT12 -> T41,\nX43 -> T41,\nX44 -> T44,\nX45 -> T45,\nT3 -> .(T44, T45),\nT42 -> T44,\nT43 -> T45" }, { "from": 321, "to": 326, "label": "EVAL-BACKTRACK" }, { "from": 325, "to": 328, "label": "CASE" }, { "from": 328, "to": 332, "label": "BACKTRACK\nfor clause: head([], X3)\nwith clash: (select(T40, T41, T3), select(X8, [], X9))" }, { "from": 332, "to": 336, "label": "EVAL with clause\nhead(.(X54, X55), X54).\nand substitutionX54 -> T53,\nX55 -> T54,\nT41 -> .(T53, T54),\nT44 -> T53,\nT45 -> T55" }, { "from": 332, "to": 337, "label": "EVAL-BACKTRACK" }, { "from": 336, "to": 338, "label": "CASE" }, { "from": 338, "to": 339, "label": "BACKTRACK\nfor clause: tail([], [])because of non-unification" }, { "from": 339, "to": 340, "label": "ONLY EVAL with clause\ntail(.(X64, X65), X65).\nand substitutionT53 -> T64,\nX64 -> T64,\nT54 -> T65,\nX65 -> T65,\nX46 -> T65" }, { "from": 340, "to": 2, "label": "INSTANCE with matching:\nT1 -> T40\nT2 -> T65\nT3 -> T55" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: selectA(X1, .(X2, X3), .(X2, X4)) :- selectA(X1, X3, X4). Clauses: selectcA(X1, .(X1, X2), X2). selectcA(X1, .(X2, X3), .(X2, X4)) :- selectcA(X1, X3, X4). Afs: selectA(x1, x2, x3) = selectA(x1, x2) ---------------------------------------- (3) TriplesToPiDPProof (SOUND) We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes: selectA_in_3: (b,b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: SELECTA_IN_GGA(X1, .(X2, X3), .(X2, X4)) -> U1_GGA(X1, X2, X3, X4, selectA_in_gga(X1, X3, X4)) SELECTA_IN_GGA(X1, .(X2, X3), .(X2, X4)) -> SELECTA_IN_GGA(X1, X3, X4) R is empty. The argument filtering Pi contains the following mapping: selectA_in_gga(x1, x2, x3) = selectA_in_gga(x1, x2) .(x1, x2) = .(x1, x2) SELECTA_IN_GGA(x1, x2, x3) = SELECTA_IN_GGA(x1, x2) U1_GGA(x1, x2, x3, x4, x5) = U1_GGA(x1, x2, x3, x5) We have to consider all (P,R,Pi)-chains Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES ---------------------------------------- (4) Obligation: Pi DP problem: The TRS P consists of the following rules: SELECTA_IN_GGA(X1, .(X2, X3), .(X2, X4)) -> U1_GGA(X1, X2, X3, X4, selectA_in_gga(X1, X3, X4)) SELECTA_IN_GGA(X1, .(X2, X3), .(X2, X4)) -> SELECTA_IN_GGA(X1, X3, X4) R is empty. The argument filtering Pi contains the following mapping: selectA_in_gga(x1, x2, x3) = selectA_in_gga(x1, x2) .(x1, x2) = .(x1, x2) SELECTA_IN_GGA(x1, x2, x3) = SELECTA_IN_GGA(x1, x2) U1_GGA(x1, x2, x3, x4, x5) = U1_GGA(x1, x2, x3, x5) We have to consider all (P,R,Pi)-chains ---------------------------------------- (5) DependencyGraphProof (EQUIVALENT) The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 1 less node. ---------------------------------------- (6) Obligation: Pi DP problem: The TRS P consists of the following rules: SELECTA_IN_GGA(X1, .(X2, X3), .(X2, X4)) -> SELECTA_IN_GGA(X1, X3, X4) R is empty. The argument filtering Pi contains the following mapping: .(x1, x2) = .(x1, x2) SELECTA_IN_GGA(x1, x2, x3) = SELECTA_IN_GGA(x1, x2) We have to consider all (P,R,Pi)-chains ---------------------------------------- (7) PiDPToQDPProof (SOUND) Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi. ---------------------------------------- (8) Obligation: Q DP problem: The TRS P consists of the following rules: SELECTA_IN_GGA(X1, .(X2, X3)) -> SELECTA_IN_GGA(X1, X3) R is empty. Q is empty. We have to consider all (P,Q,R)-chains. ---------------------------------------- (9) QDPSizeChangeProof (EQUIVALENT) 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. From the DPs we obtained the following set of size-change graphs: *SELECTA_IN_GGA(X1, .(X2, X3)) -> SELECTA_IN_GGA(X1, X3) The graph contains the following edges 1 >= 1, 2 > 2 ---------------------------------------- (10) YES