/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 main(g,g) w.r.t. the given Prolog program could successfully be proven: (0) Prolog (1) PrologToIRSwTTransformerProof [SOUND, 28 ms] (2) TRUE ---------------------------------------- (0) Obligation: Clauses: main(M, N) :- ','(>(M, 0), ','(>(N, 0), gcd(M, N))). gcd(Y1, Y2) :- ','(=<(Y1, 0), !). gcd(Y1, Y2) :- ','(=<(Y2, 0), !). gcd(Y1, Y2) :- ','(=:=(Y2, 0), !). gcd(Y1, Y2) :- ','(>(Y1, Y2), ','(gcd(-(Y1, Y2), Y2), !)). gcd(Y1, Y2) :- gcd(Y1, -(Y2, Y1)). Query: main(g,g) ---------------------------------------- (1) PrologToIRSwTTransformerProof (SOUND) Transformed Prolog program to IRSwT according to method in Master Thesis of A. Weinert { "root": 1, "program": { "directives": [], "clauses": [ [ "(main M N)", "(',' (> M (0)) (',' (> N (0)) (gcd M N)))" ], [ "(gcd Y1 Y2)", "(',' (=< Y1 (0)) (!))" ], [ "(gcd Y1 Y2)", "(',' (=< Y2 (0)) (!))" ], [ "(gcd Y1 Y2)", "(',' (=:= Y2 (0)) (!))" ], [ "(gcd Y1 Y2)", "(',' (> Y1 Y2) (',' (gcd (- Y1 Y2) Y2) (!)))" ], [ "(gcd Y1 Y2)", "(gcd Y1 (- Y2 Y1))" ] ] }, "graph": { "nodes": { "12": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "type": "Nodes", "1998": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (=< T22 (0)) (!_2))" }, { "clause": 3, "scope": 2, "term": "(gcd T21 T22)" }, { "clause": 4, "scope": 2, "term": "(gcd T21 T22)" }, { "clause": 5, "scope": 2, "term": "(gcd T21 T22)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": ">" }, { "lhs": { "name": "T7", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T8", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T7", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T8", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": ">" } ] }, "ground": [ "T21", "T22" ], "free": [], "exprvars": [ "T7", "T22", "T8", "T16", "T21", "T15" ] } }, "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(main T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "1975": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (=< T15 (0)) (!_2))" }, { "clause": 2, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 3, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 4, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 5, "scope": 2, "term": "(gcd T15 T16)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" } ] }, "ground": [ "T15", "T16" ], "free": [], "exprvars": [ "T7", "T8", "T16", "T15" ] } }, "1997": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "<=" } ] }, "ground": [], "free": [], "exprvars": [ "T7", "T8", "T16", "T15" ] } }, "1963": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "1974": { "goal": [ { "clause": 1, "scope": 2, "term": "(gcd T7 T8)" }, { "clause": 2, "scope": 2, "term": "(gcd T7 T8)" }, { "clause": 3, "scope": 2, "term": "(gcd T7 T8)" }, { "clause": 4, "scope": 2, "term": "(gcd T7 T8)" }, { "clause": 5, "scope": 2, "term": "(gcd T7 T8)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" } ] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": [ "T7", "T8" ] } }, "1962": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": ">=" }] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": ["T7"] } }, "1973": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": ">=" } ] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": [ "T7", "T8" ] } }, "1995": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "<=" } ] }, "ground": [], "free": [], "exprvars": [ "T7", "T8", "T16", "T15" ] } }, "1961": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (> T8 (0)) (gcd T7 T8))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [{ "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": ["T7"] } }, "1972": { "goal": [{ "clause": -1, "scope": -1, "term": "(gcd T7 T8)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" } ] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": [ "T7", "T8" ] } }, "5": { "goal": [{ "clause": 0, "scope": 1, "term": "(main T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "1992": { "goal": [ { "clause": 2, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 3, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 4, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 5, "scope": 2, "term": "(gcd T15 T16)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": ">" } ] }, "ground": [ "T16", "T15" ], "free": [], "exprvars": [ "T7", "T8", "T16", "T15" ] } }, "1991": { "goal": [ { "clause": -1, "scope": -1, "term": "(!_2)" }, { "clause": 2, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 3, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 4, "scope": 2, "term": "(gcd T15 T16)" }, { "clause": 5, "scope": 2, "term": "(gcd T15 T16)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [ { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "type": "PlainIntegerConstant", "value": "0" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T7", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T16", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "name": "T8", "type": "PlainIntegerVariable" }, "operation": "<" }, { "lhs": { "name": "T15", "type": "PlainIntegerVariable" }, "type": "PlainIntegerRelation", "rhs": { "type": "PlainIntegerConstant", "value": "0" }, "operation": "<=" } ] }, "ground": [ "T16", "T15" ], "free": [], "exprvars": [ "T7", "T8", "T16", "T15" ] } }, "8": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (> T7 (0)) (',' (> T8 (0)) (gcd T7 T8)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T7", "T8" ], "free": [], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 5, "label": "CASE" }, { "from": 5, "to": 8, "label": "ONLY EVAL with clause\nmain(X5, X6) :- ','(>(X5, 0), ','(>(X6, 0), gcd(X5, X6))).\nand substitutionT1 -> T7,\nX5 -> T7,\nT2 -> T8,\nX6 -> T8" }, { "from": 8, "to": 12, "label": "IS ERROR" }, { "from": 8, "to": 1961, "label": "ARITHCOMP SUCCESS" }, { "from": 8, "to": 1962, "label": "ARITHCOMP FAIL" }, { "from": 1961, "to": 1963, "label": "IS ERROR" }, { "from": 1961, "to": 1972, "label": "ARITHCOMP SUCCESS" }, { "from": 1961, "to": 1973, "label": "ARITHCOMP FAIL" }, { "from": 1972, "to": 1974, "label": "CASE" }, { "from": 1974, "to": 1975, "label": "ONLY EVAL with clause\ngcd(X13, X14) :- ','(=<(X13, 0), !_2).\nand substitutionT7 -> T15,\nX13 -> T15,\nT8 -> T16,\nX14 -> T16" }, { "from": 1975, "to": 1991, "label": "ARITHCOMP SUCCESS" }, { "from": 1975, "to": 1992, "label": "ARITHCOMP FAIL" }, { "from": 1991, "to": 1995, "label": "CUT" }, { "from": 1992, "to": 1998, "label": "ONLY EVAL with clause\ngcd(X19, X20) :- ','(=<(X20, 0), !_2).\nand substitutionT15 -> T21,\nX19 -> T21,\nT16 -> T22,\nX20 -> T22" }, { "from": 1995, "to": 1997, "label": "SUCCESS" } ], "type": "Graph" } } ---------------------------------------- (2) TRUE