/export/starexec/sandbox/solver/bin/starexec_run_standard /export/starexec/sandbox/benchmark/theBenchmark.pl /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- YES proof of /export/starexec/sandbox/benchmark/theBenchmark.pl # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty Left Termination of the query pattern map(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: map([], L) :- ','(!, eq(L, [])). map(X, .(Y, Ys)) :- ','(head(X, H), ','(tail(X, T), ','(p(H, Y), map(T, Ys)))). head([], X1). head(.(H, X2), H). tail([], []). tail(.(X3, T), T). p(X, Y). eq(X, X). Query: map(g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 17, "program": { "directives": [], "clauses": [ [ "(map ([]) L)", "(',' (!) (eq L ([])))" ], [ "(map X (. Y Ys))", "(',' (head X H) (',' (tail X T) (',' (p H Y) (map T Ys))))" ], [ "(head ([]) X1)", null ], [ "(head (. H X2) H)", null ], [ "(tail ([]) ([]))", null ], [ "(tail (. X3 T) T)", null ], [ "(p X Y)", null ], [ "(eq X X)", null ] ] }, "graph": { "nodes": { "22": { "goal": [{ "clause": 7, "scope": 2, "term": "(eq T5 ([]))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "23": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "24": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "25": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "17": { "goal": [{ "clause": -1, "scope": -1, "term": "(map T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "18": { "goal": [ { "clause": 0, "scope": 1, "term": "(map T1 T2)" }, { "clause": 1, "scope": 1, "term": "(map T1 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "19": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_1) (eq T5 ([])))" }, { "clause": 1, "scope": 1, "term": "(map ([]) T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "type": "Nodes", "320": { "goal": [{ "clause": -1, "scope": -1, "term": "(map T30 T40)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T30"], "free": [], "exprvars": [] } }, "118": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (tail (. T21 T22) X16) (',' (p T21 T15) (map X16 T16)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T21", "T22" ], "free": ["X16"], "exprvars": [] } }, "316": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (p T29 T15) (map T30 T16))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T29", "T30" ], "free": [], "exprvars": [] } }, "119": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "317": { "goal": [{ "clause": 6, "scope": 5, "term": "(',' (p T29 T15) (map T30 T16))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T29", "T30" ], "free": [], "exprvars": [] } }, "93": { "goal": [ { "clause": 2, "scope": 3, "term": "(',' (head T12 X15) (',' (tail T12 X16) (',' (p X15 T15) (map X16 T16))))" }, { "clause": 3, "scope": 3, "term": "(',' (head T12 X15) (',' (tail T12 X16) (',' (p X15 T15) (map X16 T16))))" } ], "kb": { "nonunifying": [[ "(map T12 T2)", "(map ([]) X5)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T12"], "free": [ "X5", "X15", "X16" ], "exprvars": [] } }, "109": { "goal": [{ "clause": 3, "scope": 3, "term": "(',' (head T12 X15) (',' (tail T12 X16) (',' (p X15 T15) (map X16 T16))))" }], "kb": { "nonunifying": [[ "(map T12 T2)", "(map ([]) X5)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T12"], "free": [ "X5", "X15", "X16" ], "exprvars": [] } }, "308": { "goal": [ { "clause": 4, "scope": 4, "term": "(',' (tail (. T21 T22) X16) (',' (p T21 T15) (map X16 T16)))" }, { "clause": 5, "scope": 4, "term": "(',' (tail (. T21 T22) X16) (',' (p T21 T15) (map X16 T16)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T21", "T22" ], "free": ["X16"], "exprvars": [] } }, "309": { "goal": [{ "clause": 5, "scope": 4, "term": "(',' (tail (. T21 T22) X16) (',' (p T21 T15) (map X16 T16)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T21", "T22" ], "free": ["X16"], "exprvars": [] } }, "20": { "goal": [{ "clause": 1, "scope": 1, "term": "(map T1 T2)" }], "kb": { "nonunifying": [[ "(map T1 T2)", "(map ([]) X5)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": ["X5"], "exprvars": [] } }, "64": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "21": { "goal": [{ "clause": -1, "scope": -1, "term": "(eq T5 ([]))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "43": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (head T12 X15) (',' (tail T12 X16) (',' (p X15 T15) (map X16 T16))))" }], "kb": { "nonunifying": [[ "(map T12 T2)", "(map ([]) X5)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T12"], "free": [ "X5", "X15", "X16" ], "exprvars": [] } } }, "edges": [ { "from": 17, "to": 18, "label": "CASE" }, { "from": 18, "to": 19, "label": "EVAL with clause\nmap([], X5) :- ','(!_1, eq(X5, [])).\nand substitutionT1 -> [],\nT2 -> T5,\nX5 -> T5,\nT4 -> T5" }, { "from": 18, "to": 20, "label": "EVAL-BACKTRACK" }, { "from": 19, "to": 21, "label": "CUT" }, { "from": 20, "to": 43, "label": "EVAL with clause\nmap(X12, .(X13, X14)) :- ','(head(X12, X15), ','(tail(X12, X16), ','(p(X15, X13), map(X16, X14)))).\nand substitutionT1 -> T12,\nX12 -> T12,\nX13 -> T15,\nX14 -> T16,\nT2 -> .(T15, T16),\nT13 -> T15,\nT14 -> T16" }, { "from": 20, "to": 64, "label": "EVAL-BACKTRACK" }, { "from": 21, "to": 22, "label": "CASE" }, { "from": 22, "to": 23, "label": "EVAL with clause\neq(X8, X8).\nand substitutionT5 -> [],\nX8 -> [],\nT8 -> []" }, { "from": 22, "to": 24, "label": "EVAL-BACKTRACK" }, { "from": 23, "to": 25, "label": "SUCCESS" }, { "from": 43, "to": 93, "label": "CASE" }, { "from": 93, "to": 109, "label": "BACKTRACK\nfor clause: head([], X1)\nwith clash: (map(T12, T2), map([], X5))" }, { "from": 109, "to": 118, "label": "EVAL with clause\nhead(.(X23, X24), X23).\nand substitutionX23 -> T21,\nX24 -> T22,\nT12 -> .(T21, T22),\nX15 -> T21" }, { "from": 109, "to": 119, "label": "EVAL-BACKTRACK" }, { "from": 118, "to": 308, "label": "CASE" }, { "from": 308, "to": 309, "label": "BACKTRACK\nfor clause: tail([], [])because of non-unification" }, { "from": 309, "to": 316, "label": "ONLY EVAL with clause\ntail(.(X31, X32), X32).\nand substitutionT21 -> T29,\nX31 -> T29,\nT22 -> T30,\nX32 -> T30,\nX16 -> T30" }, { "from": 316, "to": 317, "label": "CASE" }, { "from": 317, "to": 320, "label": "ONLY EVAL with clause\np(X39, X40).\nand substitutionT29 -> T38,\nX39 -> T38,\nT15 -> T39,\nX40 -> T39,\nT16 -> T40" }, { "from": 320, "to": 17, "label": "INSTANCE with matching:\nT1 -> T30\nT2 -> T40" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: mapA(.(X1, X2), .(X3, X4)) :- mapA(X2, X4). Clauses: mapcA([], []). mapcA(.(X1, X2), .(X3, X4)) :- mapcA(X2, X4). Afs: mapA(x1, x2) = mapA(x1) ---------------------------------------- (3) TriplesToPiDPProof (SOUND) We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes: mapA_in_2: (b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> U1_GA(X1, X2, X3, X4, mapA_in_ga(X2, X4)) MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4) R is empty. The argument filtering Pi contains the following mapping: mapA_in_ga(x1, x2) = mapA_in_ga(x1) .(x1, x2) = .(x2) MAPA_IN_GA(x1, x2) = MAPA_IN_GA(x1) U1_GA(x1, x2, x3, x4, x5) = U1_GA(x2, 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: MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> U1_GA(X1, X2, X3, X4, mapA_in_ga(X2, X4)) MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4) R is empty. The argument filtering Pi contains the following mapping: mapA_in_ga(x1, x2) = mapA_in_ga(x1) .(x1, x2) = .(x2) MAPA_IN_GA(x1, x2) = MAPA_IN_GA(x1) U1_GA(x1, x2, x3, x4, x5) = U1_GA(x2, 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: MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4) R is empty. The argument filtering Pi contains the following mapping: .(x1, x2) = .(x2) MAPA_IN_GA(x1, x2) = MAPA_IN_GA(x1) 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: MAPA_IN_GA(.(X2)) -> MAPA_IN_GA(X2) 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: *MAPA_IN_GA(.(X2)) -> MAPA_IN_GA(X2) The graph contains the following edges 1 > 1 ---------------------------------------- (10) YES