/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 len(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: len([], 0). len(Xs, s(N)) :- ','(no(empty(Xs)), ','(tail(Xs, Ys), len(Ys, N))). tail([], []). tail(.(X, Xs), Xs). empty([]). no(X) :- ','(X, ','(!, failure(a))). no(X1). failure(b). Query: len(g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 1, "program": { "directives": [], "clauses": [ [ "(len ([]) (0))", null ], [ "(len Xs (s N))", "(',' (no (empty Xs)) (',' (tail Xs Ys) (len Ys N)))" ], [ "(tail ([]) ([]))", null ], [ "(tail (. X Xs) Xs)", null ], [ "(empty ([]))", null ], [ "(no X)", "(',' X (',' (!) (failure (a))))" ], [ "(no X1)", null ], [ "(failure (b))", null ] ] }, "graph": { "nodes": { "24": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "68": { "goal": [ { "clause": 5, "scope": 6, "term": "(',' (no (empty T8)) (',' (tail T8 X14) (len X14 T10)))" }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T8)) (',' (tail T8 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [[ "(len T8 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T8"], "free": ["X14"], "exprvars": [] } }, "25": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "69": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (',' (call (empty T13)) (',' (!_6) (failure (a)))) (',' (tail T13 X14) (len X14 T10)))" }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [[ "(len T13 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "26": { "goal": [ { "clause": 5, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" }, { "clause": 6, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "28": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (',' (call (empty ([]))) (',' (!_2) (failure (a)))) (',' (tail ([]) X6) (len X6 T5)))" }, { "clause": 6, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "type": "Nodes", "70": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (empty T13) (',' (',' (!_6) (failure (a))) (',' (tail T13 X14) (len X14 T10))))" }, { "clause": -1, "scope": 7, "term": null }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [[ "(len T13 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "71": { "goal": [ { "clause": 4, "scope": 8, "term": "(',' (empty T13) (',' (',' (!_6) (failure (a))) (',' (tail T13 X14) (len X14 T10))))" }, { "clause": -1, "scope": 8, "term": null }, { "clause": -1, "scope": 7, "term": null }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [[ "(len T13 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "72": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (',' (!_6) (failure (a))) (',' (tail ([]) X14) (len X14 T10)))" }, { "clause": -1, "scope": 8, "term": null }, { "clause": -1, "scope": 7, "term": null }, { "clause": 6, "scope": 6, "term": "(',' (no (empty ([]))) (',' (tail ([]) X14) (len X14 T10)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X14"], "exprvars": [] } }, "73": { "goal": [ { "clause": -1, "scope": 8, "term": null }, { "clause": -1, "scope": 7, "term": null }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [ [ "(len T13 T2)", "(len ([]) (0))" ], [ "(empty T13)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "30": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (empty ([])) (',' (',' (!_2) (failure (a))) (',' (tail ([]) X6) (len X6 T5))))" }, { "clause": -1, "scope": 3, "term": null }, { "clause": 6, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "74": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (failure (a)) (',' (tail ([]) X14) (len X14 T10)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X14"], "exprvars": [] } }, "31": { "goal": [ { "clause": 4, "scope": 4, "term": "(',' (empty ([])) (',' (',' (!_2) (failure (a))) (',' (tail ([]) X6) (len X6 T5))))" }, { "clause": -1, "scope": 4, "term": null }, { "clause": -1, "scope": 3, "term": null }, { "clause": 6, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "75": { "goal": [{ "clause": 7, "scope": 9, "term": "(',' (failure (a)) (',' (tail ([]) X14) (len X14 T10)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X14"], "exprvars": [] } }, "32": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (',' (!_2) (failure (a))) (',' (tail ([]) X6) (len X6 T5)))" }, { "clause": -1, "scope": 4, "term": null }, { "clause": -1, "scope": 3, "term": null }, { "clause": 6, "scope": 2, "term": "(',' (no (empty ([]))) (',' (tail ([]) X6) (len X6 T5)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "76": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "33": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (failure (a)) (',' (tail ([]) X6) (len X6 T5)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "77": { "goal": [ { "clause": -1, "scope": 7, "term": null }, { "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" } ], "kb": { "nonunifying": [ [ "(len T13 T2)", "(len ([]) (0))" ], [ "(empty T13)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "34": { "goal": [{ "clause": 7, "scope": 5, "term": "(',' (failure (a)) (',' (tail ([]) X6) (len X6 T5)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X6"], "exprvars": [] } }, "78": { "goal": [{ "clause": 6, "scope": 6, "term": "(',' (no (empty T13)) (',' (tail T13 X14) (len X14 T10)))" }], "kb": { "nonunifying": [ [ "(len T13 T2)", "(len ([]) (0))" ], [ "(empty T13)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T13"], "free": ["X14"], "exprvars": [] } }, "35": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "79": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (tail T16 X14) (len X14 T10))" }], "kb": { "nonunifying": [ [ "(len T16 T2)", "(len ([]) (0))" ], [ "(empty T16)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": ["X14"], "exprvars": [] } }, "36": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (no (empty T8)) (',' (tail T8 X14) (len X14 T10)))" }], "kb": { "nonunifying": [[ "(len T8 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T8"], "free": ["X14"], "exprvars": [] } }, "15": { "goal": [ { "clause": -1, "scope": -1, "term": "(true)" }, { "clause": 1, "scope": 1, "term": "(len ([]) T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "37": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "16": { "goal": [{ "clause": 1, "scope": 1, "term": "(len T1 T2)" }], "kb": { "nonunifying": [[ "(len T1 T2)", "(len ([]) (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(len T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "6": { "goal": [ { "clause": 0, "scope": 1, "term": "(len T1 T2)" }, { "clause": 1, "scope": 1, "term": "(len T1 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "80": { "goal": [ { "clause": 2, "scope": 10, "term": "(',' (tail T16 X14) (len X14 T10))" }, { "clause": 3, "scope": 10, "term": "(',' (tail T16 X14) (len X14 T10))" } ], "kb": { "nonunifying": [ [ "(len T16 T2)", "(len ([]) (0))" ], [ "(empty T16)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": ["X14"], "exprvars": [] } }, "81": { "goal": [{ "clause": 3, "scope": 10, "term": "(',' (tail T16 X14) (len X14 T10))" }], "kb": { "nonunifying": [ [ "(len T16 T2)", "(len ([]) (0))" ], [ "(empty T16)", "(empty ([]))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": ["X14"], "exprvars": [] } }, "82": { "goal": [{ "clause": -1, "scope": -1, "term": "(len T22 T10)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T22"], "free": [], "exprvars": [] } }, "83": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "21": { "goal": [{ "clause": 1, "scope": 1, "term": "(len ([]) T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 6, "label": "CASE" }, { "from": 6, "to": 15, "label": "EVAL with clause\nlen([], 0).\nand substitutionT1 -> [],\nT2 -> 0" }, { "from": 6, "to": 16, "label": "EVAL-BACKTRACK" }, { "from": 15, "to": 21, "label": "SUCCESS" }, { "from": 16, "to": 36, "label": "EVAL with clause\nlen(X12, s(X13)) :- ','(no(empty(X12)), ','(tail(X12, X14), len(X14, X13))).\nand substitutionT1 -> T8,\nX12 -> T8,\nX13 -> T10,\nT2 -> s(T10),\nT9 -> T10" }, { "from": 16, "to": 37, "label": "EVAL-BACKTRACK" }, { "from": 21, "to": 24, "label": "EVAL with clause\nlen(X4, s(X5)) :- ','(no(empty(X4)), ','(tail(X4, X6), len(X6, X5))).\nand substitutionX4 -> [],\nX5 -> T5,\nT2 -> s(T5),\nT4 -> T5" }, { "from": 21, "to": 25, "label": "EVAL-BACKTRACK" }, { "from": 24, "to": 26, "label": "CASE" }, { "from": 26, "to": 28, "label": "ONLY EVAL with clause\nno(X9) :- ','(call(X9), ','(!_2, failure(a))).\nand substitutionX9 -> empty([])" }, { "from": 28, "to": 30, "label": "CALL" }, { "from": 30, "to": 31, "label": "CASE" }, { "from": 31, "to": 32, "label": "ONLY EVAL with clause\nempty([]).\nand substitution" }, { "from": 32, "to": 33, "label": "CUT" }, { "from": 33, "to": 34, "label": "CASE" }, { "from": 34, "to": 35, "label": "BACKTRACK\nfor clause: failure(b)because of non-unification" }, { "from": 36, "to": 68, "label": "CASE" }, { "from": 68, "to": 69, "label": "ONLY EVAL with clause\nno(X17) :- ','(call(X17), ','(!_6, failure(a))).\nand substitutionT8 -> T13,\nX17 -> empty(T13)" }, { "from": 69, "to": 70, "label": "CALL" }, { "from": 70, "to": 71, "label": "CASE" }, { "from": 71, "to": 72, "label": "EVAL with clause\nempty([]).\nand substitutionT13 -> []" }, { "from": 71, "to": 73, "label": "EVAL-BACKTRACK" }, { "from": 72, "to": 74, "label": "CUT" }, { "from": 73, "to": 77, "label": "FAILURE" }, { "from": 74, "to": 75, "label": "CASE" }, { "from": 75, "to": 76, "label": "BACKTRACK\nfor clause: failure(b)because of non-unification" }, { "from": 77, "to": 78, "label": "FAILURE" }, { "from": 78, "to": 79, "label": "ONLY EVAL with clause\nno(X20).\nand substitutionT13 -> T16,\nX20 -> empty(T16)" }, { "from": 79, "to": 80, "label": "CASE" }, { "from": 80, "to": 81, "label": "BACKTRACK\nfor clause: tail([], [])\nwith clash: (empty(T16), empty([]))" }, { "from": 81, "to": 82, "label": "EVAL with clause\ntail(.(X25, X26), X26).\nand substitutionX25 -> T21,\nX26 -> T22,\nT16 -> .(T21, T22),\nX14 -> T22" }, { "from": 81, "to": 83, "label": "EVAL-BACKTRACK" }, { "from": 82, "to": 1, "label": "INSTANCE with matching:\nT1 -> T22\nT2 -> T10" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: lenA(.(X1, X2), s(X3)) :- lenA(X2, X3). Clauses: lencA([], 0). lencA(.(X1, X2), s(X3)) :- lencA(X2, X3). Afs: lenA(x1, x2) = lenA(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: lenA_in_2: (b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: LENA_IN_GA(.(X1, X2), s(X3)) -> U1_GA(X1, X2, X3, lenA_in_ga(X2, X3)) LENA_IN_GA(.(X1, X2), s(X3)) -> LENA_IN_GA(X2, X3) R is empty. The argument filtering Pi contains the following mapping: lenA_in_ga(x1, x2) = lenA_in_ga(x1) .(x1, x2) = .(x1, x2) s(x1) = s(x1) LENA_IN_GA(x1, x2) = LENA_IN_GA(x1) U1_GA(x1, x2, x3, x4) = U1_GA(x1, x2, x4) 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: LENA_IN_GA(.(X1, X2), s(X3)) -> U1_GA(X1, X2, X3, lenA_in_ga(X2, X3)) LENA_IN_GA(.(X1, X2), s(X3)) -> LENA_IN_GA(X2, X3) R is empty. The argument filtering Pi contains the following mapping: lenA_in_ga(x1, x2) = lenA_in_ga(x1) .(x1, x2) = .(x1, x2) s(x1) = s(x1) LENA_IN_GA(x1, x2) = LENA_IN_GA(x1) U1_GA(x1, x2, x3, x4) = U1_GA(x1, x2, x4) 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: LENA_IN_GA(.(X1, X2), s(X3)) -> LENA_IN_GA(X2, X3) R is empty. The argument filtering Pi contains the following mapping: .(x1, x2) = .(x1, x2) s(x1) = s(x1) LENA_IN_GA(x1, x2) = LENA_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: LENA_IN_GA(.(X1, X2)) -> LENA_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: *LENA_IN_GA(.(X1, X2)) -> LENA_IN_GA(X2) The graph contains the following edges 1 > 1 ---------------------------------------- (10) YES