/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 add(a,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: add(X, 0, X). add(X, Y, s(Z)) :- ','(\+(isZero(Y)), ','(p(Y, P), add(X, P, Z))). p(0, 0). p(s(X), X). isZero(0). Query: add(a,g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 5, "program": { "directives": [], "clauses": [ [ "(add X (0) X)", null ], [ "(add X Y (s Z))", "(',' (\\+ (isZero Y)) (',' (p Y P) (add X P Z)))" ], [ "(p (0) (0))", null ], [ "(p (s X) X)", null ], [ "(isZero (0))", null ] ] }, "graph": { "nodes": { "44": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "45": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (call (isZero T16)) (',' (!_5) (fail)))" }, { "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [[ "(add T1 T16 T3)", "(add X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "46": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (isZero T16) (',' (!_5) (fail)))" }, { "clause": -1, "scope": 6, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [[ "(add T1 T16 T3)", "(add X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "type": "Nodes", "232": { "goal": [{ "clause": -1, "scope": -1, "term": "(add T18 T24 T19)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T24"], "free": [], "exprvars": [] } }, "233": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "53": { "goal": [ { "clause": 4, "scope": 7, "term": "(',' (isZero T16) (',' (!_5) (fail)))" }, { "clause": -1, "scope": 7, "term": null }, { "clause": -1, "scope": 6, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [[ "(add T1 T16 T3)", "(add X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "54": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_5) (fail))" }, { "clause": -1, "scope": 7, "term": null }, { "clause": -1, "scope": 6, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p (0) X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X16"], "exprvars": [] } }, "76": { "goal": [ { "clause": -1, "scope": 6, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [ [ "(add T1 T16 T3)", "(add X2 (0) X2)" ], [ "(isZero T16)", "(isZero (0))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "11": { "goal": [ { "clause": -1, "scope": -1, "term": "(true)" }, { "clause": 1, "scope": 1, "term": "(add T1 (0) T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "55": { "goal": [ { "clause": -1, "scope": 7, "term": null }, { "clause": -1, "scope": 6, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [ [ "(add T1 T16 T3)", "(add X2 (0) X2)" ], [ "(isZero T16)", "(isZero (0))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "77": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (p T16 X16) (add T18 X16 T19))" }], "kb": { "nonunifying": [ [ "(add T1 T16 T3)", "(add X2 (0) X2)" ], [ "(isZero T16)", "(isZero (0))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "12": { "goal": [{ "clause": 1, "scope": 1, "term": "(add T1 T2 T3)" }], "kb": { "nonunifying": [[ "(add T1 T2 T3)", "(add X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": ["X2"], "exprvars": [] } }, "56": { "goal": [{ "clause": -1, "scope": -1, "term": "(fail)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "78": { "goal": [ { "clause": 2, "scope": 8, "term": "(',' (p T16 X16) (add T18 X16 T19))" }, { "clause": 3, "scope": 8, "term": "(',' (p T16 X16) (add T18 X16 T19))" } ], "kb": { "nonunifying": [ [ "(add T1 T16 T3)", "(add X2 (0) X2)" ], [ "(isZero T16)", "(isZero (0))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "13": { "goal": [{ "clause": 1, "scope": 1, "term": "(add T1 (0) T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "79": { "goal": [{ "clause": 3, "scope": 8, "term": "(',' (p T16 X16) (add T18 X16 T19))" }], "kb": { "nonunifying": [ [ "(add T1 T16 T3)", "(add X2 (0) X2)" ], [ "(isZero T16)", "(isZero (0))" ] ], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } }, "14": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (\\+ (isZero (0))) (',' (p (0) X9) (add T10 X9 T11)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X9"], "exprvars": [] } }, "15": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "16": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (call (isZero (0))) (',' (!_2) (fail)))" }, { "clause": -1, "scope": -1, "term": "(',' (p (0) X9) (add T10 X9 T11))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X9"], "exprvars": [] } }, "38": { "goal": [{ "clause": -1, "scope": -1, "term": "(fail)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "39": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "19": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (isZero (0)) (',' (!_2) (fail)))" }, { "clause": -1, "scope": 3, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p (0) X9) (add T10 X9 T11))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X9"], "exprvars": [] } }, "5": { "goal": [{ "clause": -1, "scope": -1, "term": "(add T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": [], "exprvars": [] } }, "6": { "goal": [ { "clause": 0, "scope": 1, "term": "(add T1 T2 T3)" }, { "clause": 1, "scope": 1, "term": "(add T1 T2 T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": [], "exprvars": [] } }, "61": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "20": { "goal": [ { "clause": 4, "scope": 4, "term": "(',' (isZero (0)) (',' (!_2) (fail)))" }, { "clause": -1, "scope": 4, "term": null }, { "clause": -1, "scope": 3, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p (0) X9) (add T10 X9 T11))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X9"], "exprvars": [] } }, "21": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_2) (fail))" }, { "clause": -1, "scope": 4, "term": null }, { "clause": -1, "scope": 3, "term": null }, { "clause": -1, "scope": -1, "term": "(',' (p (0) X9) (add T10 X9 T11))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": ["X9"], "exprvars": [] } }, "43": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (\\+ (isZero T16)) (',' (p T16 X16) (add T18 X16 T19)))" }], "kb": { "nonunifying": [[ "(add T1 T16 T3)", "(add X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T16"], "free": [ "X2", "X16" ], "exprvars": [] } } }, "edges": [ { "from": 5, "to": 6, "label": "CASE" }, { "from": 6, "to": 11, "label": "EVAL with clause\nadd(X2, 0, X2).\nand substitutionT1 -> T5,\nX2 -> T5,\nT2 -> 0,\nT3 -> T5" }, { "from": 6, "to": 12, "label": "EVAL-BACKTRACK" }, { "from": 11, "to": 13, "label": "SUCCESS" }, { "from": 12, "to": 43, "label": "EVAL with clause\nadd(X13, X14, s(X15)) :- ','(\\+(isZero(X14)), ','(p(X14, X16), add(X13, X16, X15))).\nand substitutionT1 -> T18,\nX13 -> T18,\nT2 -> T16,\nX14 -> T16,\nX15 -> T19,\nT3 -> s(T19),\nT15 -> T18,\nT17 -> T19" }, { "from": 12, "to": 44, "label": "EVAL-BACKTRACK" }, { "from": 13, "to": 14, "label": "EVAL with clause\nadd(X6, X7, s(X8)) :- ','(\\+(isZero(X7)), ','(p(X7, X9), add(X6, X9, X8))).\nand substitutionT1 -> T10,\nX6 -> T10,\nX7 -> 0,\nX8 -> T11,\nT3 -> s(T11),\nT8 -> T10,\nT9 -> T11" }, { "from": 13, "to": 15, "label": "EVAL-BACKTRACK" }, { "from": 14, "to": 16, "label": "NOT" }, { "from": 16, "to": 19, "label": "CALL" }, { "from": 19, "to": 20, "label": "CASE" }, { "from": 20, "to": 21, "label": "ONLY EVAL with clause\nisZero(0).\nand substitution" }, { "from": 21, "to": 38, "label": "CUT" }, { "from": 38, "to": 39, "label": "FAILURE" }, { "from": 43, "to": 45, "label": "NOT" }, { "from": 45, "to": 46, "label": "CALL" }, { "from": 46, "to": 53, "label": "CASE" }, { "from": 53, "to": 54, "label": "EVAL with clause\nisZero(0).\nand substitutionT16 -> 0" }, { "from": 53, "to": 55, "label": "EVAL-BACKTRACK" }, { "from": 54, "to": 56, "label": "CUT" }, { "from": 55, "to": 76, "label": "FAILURE" }, { "from": 56, "to": 61, "label": "FAILURE" }, { "from": 76, "to": 77, "label": "FAILURE" }, { "from": 77, "to": 78, "label": "CASE" }, { "from": 78, "to": 79, "label": "BACKTRACK\nfor clause: p(0, 0)\nwith clash: (isZero(T16), isZero(0))" }, { "from": 79, "to": 232, "label": "EVAL with clause\np(s(X21), X21).\nand substitutionX21 -> T24,\nT16 -> s(T24),\nX16 -> T24" }, { "from": 79, "to": 233, "label": "EVAL-BACKTRACK" }, { "from": 232, "to": 5, "label": "INSTANCE with matching:\nT1 -> T18\nT2 -> T24\nT3 -> T19" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: addA(X1, s(X2), s(X3)) :- addA(X1, X2, X3). Clauses: addcA(X1, 0, X1). addcA(X1, s(X2), s(X3)) :- addcA(X1, X2, X3). Afs: addA(x1, x2, x3) = addA(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: addA_in_3: (f,b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: ADDA_IN_AGA(X1, s(X2), s(X3)) -> U1_AGA(X1, X2, X3, addA_in_aga(X1, X2, X3)) ADDA_IN_AGA(X1, s(X2), s(X3)) -> ADDA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: addA_in_aga(x1, x2, x3) = addA_in_aga(x2) s(x1) = s(x1) ADDA_IN_AGA(x1, x2, x3) = ADDA_IN_AGA(x2) U1_AGA(x1, x2, x3, x4) = U1_AGA(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: ADDA_IN_AGA(X1, s(X2), s(X3)) -> U1_AGA(X1, X2, X3, addA_in_aga(X1, X2, X3)) ADDA_IN_AGA(X1, s(X2), s(X3)) -> ADDA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: addA_in_aga(x1, x2, x3) = addA_in_aga(x2) s(x1) = s(x1) ADDA_IN_AGA(x1, x2, x3) = ADDA_IN_AGA(x2) U1_AGA(x1, x2, x3, x4) = U1_AGA(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: ADDA_IN_AGA(X1, s(X2), s(X3)) -> ADDA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: s(x1) = s(x1) ADDA_IN_AGA(x1, x2, x3) = ADDA_IN_AGA(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: ADDA_IN_AGA(s(X2)) -> ADDA_IN_AGA(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: *ADDA_IN_AGA(s(X2)) -> ADDA_IN_AGA(X2) The graph contains the following edges 1 > 1 ---------------------------------------- (10) YES