/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 rec(g,a) w.r.t. the given Prolog program could successfully be proven: (0) Prolog (1) PrologToDTProblemTransformerProof [SOUND, 48 ms] (2) TRIPLES (3) TPisEmptyProof [EQUIVALENT, 0 ms] (4) YES ---------------------------------------- (0) Obligation: Clauses: rec(A, Ret) :- ','(=:=(A, 0), ','(!, is(Ret, 0))). rec(A, Ret) :- ','(is(A1, -(A, 1)), ','(rec(A1, Ret1), ','(countDown(Ret1, Ret2), is(Ret, +(1, Ret2))))). countDown(X, Ret) :- ','(>(X, 0), ','(!, ','(is(X1, -(X, 1)), ','(countDown(X1, Ret1), is(Ret, -(Ret1, 1)))))). countDown(X, X) :- ','(=<(X, 0), !). Query: rec(g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 1, "program": { "directives": [], "clauses": [ [ "(rec A Ret)", "(',' (=:= A (0)) (',' (!) (is Ret (0))))" ], [ "(rec A Ret)", "(',' (is A1 (- A (1))) (',' (rec A1 Ret1) (',' (countDown Ret1 Ret2) (is Ret (+ (1) Ret2)))))" ], [ "(countDown X Ret)", "(',' (> X (0)) (',' (!) (',' (is X1 (- X (1))) (',' (countDown X1 Ret1) (is Ret (- Ret1 (1)))))))" ], [ "(countDown X X)", "(',' (=< X (0)) (!))" ] ] }, "graph": { "nodes": { "2364": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" }, { "lhs": { "name": "T8", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" } ] }, "ground": [], "free": [], "exprvars": [ "T5", "T8" ] } }, "2363": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" }] }, "ground": [], "free": [], "exprvars": ["T5"] } }, "2362": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" }, { "lhs": { "name": "T8", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" } ] }, "ground": ["T8"], "free": [], "exprvars": [ "T5", "T8" ] } }, "2361": { "goal": [{ "clause": -1, "scope": -1, "term": "(is T7 (0))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" }] }, "ground": [], "free": [], "exprvars": ["T5"] } }, "type": "Nodes", "2360": { "goal": [{ "clause": 1, "scope": 1, "term": "(rec T5 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }] }, "ground": ["T5"], "free": [], "exprvars": ["T5"] } }, "2371": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (',' (=:= T17 (0)) (',' (!_2) (is X21 (0)))) (',' (countDown X21 X12) (is T13 (+ (1) X12))))" }, { "clause": 1, "scope": 2, "term": "(',' (rec T17 X11) (',' (countDown X11 X12) (is T13 (+ (1) X12))))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T14", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "arguments": [ { "name": "T11", "type": "PlainIntegerVariable" }, { "type": "PlainIntegerConstant", "value": "1" } ], "type": "PlainIntegerOperation", "operation": "-" }, "operation": "=" }, { "lhs": { "arguments": [ { "name": "T11", "type": "PlainIntegerVariable" }, { "type": "PlainIntegerConstant", "value": "1" } ], "type": "PlainIntegerOperation", "operation": "-" }, "type": "PlainIntegerRelation", "rhs": { "arguments": [ { "name": "T11", "type": "PlainIntegerVariable" }, { "type": "PlainIntegerConstant", "value": "1" } ], "type": "PlainIntegerOperation", "operation": "-" }, "operation": "=" }, { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" } ] }, "ground": ["T17"], "free": [ "X11", "X12", "X21" ], "exprvars": [ "T14", "T5", "T17", "T11" ] } }, "2370": { "goal": [ { "clause": 0, "scope": 2, "term": "(',' (rec T14 X11) (',' (countDown X11 X12) (is T13 (+ (1) X12))))" }, { "clause": 1, "scope": 2, "term": "(',' (rec T14 X11) (',' (countDown X11 X12) (is T13 (+ (1) X12))))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T14", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "arguments": [ { "name": "T11", "type": "PlainIntegerVariable" }, { "type": "PlainIntegerConstant", "value": "1" } ], "type": "PlainIntegerOperation", "operation": "-" }, "operation": "=" }, { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" } ] }, "ground": ["T14"], "free": [ "X11", "X12" ], "exprvars": [ "T14", "T5", "T11" ] } }, "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(rec T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "2359": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_1) (is T7 (0)))" }, { "clause": 1, "scope": 1, "term": "(rec T5 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "=" }] }, "ground": ["T5"], "free": [], "exprvars": ["T5"] } }, "2369": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (rec T14 X11) (',' (countDown X11 X12) (is T13 (+ (1) X12))))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T14", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "arguments": [ { "name": "T11", "type": "PlainIntegerVariable" }, { "type": "PlainIntegerConstant", "value": "1" } ], "type": "PlainIntegerOperation", "operation": "-" }, "operation": "=" }, { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" } ] }, "ground": [ "T14", "T11" ], "free": [ "X10", "X11", "X12" ], "exprvars": [ "T14", "T5", "T11" ] } }, "4": { "goal": [ { "clause": 0, "scope": 1, "term": "(rec T1 T2)" }, { "clause": 1, "scope": 1, "term": "(rec T1 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "7": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (=:= T5 (0)) (',' (!_1) (is T7 (0))))" }, { "clause": 1, "scope": 1, "term": "(rec T5 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T5"], "free": [], "exprvars": [] } }, "2365": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (is X10 (- T11 (1))) (',' (rec X10 X11) (',' (countDown X11 X12) (is T13 (+ (1) X12)))))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "name": "T5", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "!=" } ] }, "ground": ["T11"], "free": [ "X10", "X11", "X12" ], "exprvars": [ "T5", "T11" ] } }, "8": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 4, "label": "CASE" }, { "from": 4, "to": 7, "label": "ONLY EVAL with clause\nrec(X4, X5) :- ','(=:=(X4, 0), ','(!_1, is(X5, 0))).\nand substitutionT1 -> T5,\nX4 -> T5,\nT2 -> T7,\nX5 -> T7,\nT6 -> T7" }, { "from": 7, "to": 8, "label": "IS ERROR" }, { "from": 7, "to": 2359, "label": "ARITHCOMP SUCCESS" }, { "from": 7, "to": 2360, "label": "ARITHCOMP FAIL" }, { "from": 2359, "to": 2361, "label": "CUT" }, { "from": 2360, "to": 2365, "label": "ONLY EVAL with clause\nrec(X8, X9) :- ','(is(X10, -(X8, 1)), ','(rec(X10, X11), ','(countDown(X11, X12), is(X9, +(1, X12))))).\nand substitutionT5 -> T11,\nX8 -> T11,\nT2 -> T13,\nX9 -> T13,\nT12 -> T13" }, { "from": 2361, "to": 2362, "label": "\nT7 -> T8" }, { "from": 2361, "to": 2363, "label": "IS FAIL" }, { "from": 2362, "to": 2364, "label": "SUCCESS" }, { "from": 2365, "to": 2369, "label": "\nX10 -> T14" }, { "from": 2369, "to": 2370, "label": "CASE" }, { "from": 2370, "to": 2371, "label": "ONLY EVAL with clause\nrec(X19, X20) :- ','(=:=(X19, 0), ','(!_2, is(X20, 0))).\nand substitutionT14 -> T17,\nX19 -> T17,\nX11 -> X21,\nX20 -> X21" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: Clauses: Afs: ---------------------------------------- (3) TPisEmptyProof (EQUIVALENT) There are no more dependency triples. Hence, the dependency triple problem trivially terminates. ---------------------------------------- (4) YES