/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 even(g) 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 [EQUIVALENT, 0 ms] (8) QDP (9) QDPSizeChangeProof [EQUIVALENT, 0 ms] (10) YES ---------------------------------------- (0) Obligation: Clauses: even(0) :- !. even(N) :- ','(p(N, P), odd(P)). odd(s(0)) :- !. odd(N) :- ','(p(N, P), even(P)). p(0, 0). p(s(X), X). Query: even(g) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 1, "program": { "directives": [], "clauses": [ [ "(even (0))", "(!)" ], [ "(even N)", "(',' (p N P) (odd P))" ], [ "(odd (s (0)))", "(!)" ], [ "(odd N)", "(',' (p N P) (even P))" ], [ "(p (0) (0))", null ], [ "(p (s X) X)", null ] ] }, "graph": { "nodes": { "89": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "type": "Nodes", "132": { "goal": [ { "clause": 2, "scope": 3, "term": "(odd T6)" }, { "clause": 3, "scope": 3, "term": "(odd T6)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "133": { "goal": [ { "clause": -1, "scope": -1, "term": "(!_3)" }, { "clause": 3, "scope": 3, "term": "(odd (s (0)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "134": { "goal": [{ "clause": 3, "scope": 3, "term": "(odd T6)" }], "kb": { "nonunifying": [[ "(odd T6)", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "135": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "136": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "139": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (p T9 X11) (even X11))" }], "kb": { "nonunifying": [[ "(odd T9)", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T9"], "free": ["X11"], "exprvars": [] } }, "72": { "goal": [ { "clause": 4, "scope": 2, "term": "(',' (p T3 X3) (odd X3))" }, { "clause": 5, "scope": 2, "term": "(',' (p T3 X3) (odd X3))" } ], "kb": { "nonunifying": [[ "(even T3)", "(even (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T3"], "free": ["X3"], "exprvars": [] } }, "73": { "goal": [{ "clause": 5, "scope": 2, "term": "(',' (p T3 X3) (odd X3))" }], "kb": { "nonunifying": [[ "(even T3)", "(even (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T3"], "free": ["X3"], "exprvars": [] } }, "54": { "goal": [ { "clause": -1, "scope": -1, "term": "(!_1)" }, { "clause": 1, "scope": 1, "term": "(even (0))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "77": { "goal": [{ "clause": -1, "scope": -1, "term": "(odd T6)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "59": { "goal": [{ "clause": 1, "scope": 1, "term": "(even T1)" }], "kb": { "nonunifying": [[ "(even T1)", "(even (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "140": { "goal": [ { "clause": 4, "scope": 4, "term": "(',' (p T9 X11) (even X11))" }, { "clause": 5, "scope": 4, "term": "(',' (p T9 X11) (even X11))" } ], "kb": { "nonunifying": [[ "(odd T9)", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T9"], "free": ["X11"], "exprvars": [] } }, "141": { "goal": [{ "clause": 4, "scope": 4, "term": "(',' (p T9 X11) (even X11))" }], "kb": { "nonunifying": [[ "(odd T9)", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T9"], "free": ["X11"], "exprvars": [] } }, "142": { "goal": [{ "clause": 5, "scope": 4, "term": "(',' (p T9 X11) (even X11))" }], "kb": { "nonunifying": [[ "(odd T9)", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T9"], "free": ["X11"], "exprvars": [] } }, "165": { "goal": [{ "clause": -1, "scope": -1, "term": "(even T12)" }], "kb": { "nonunifying": [[ "(odd (s T12))", "(odd (s (0)))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T12"], "free": [], "exprvars": [] } }, "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(even T1)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "166": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "2": { "goal": [ { "clause": 0, "scope": 1, "term": "(even T1)" }, { "clause": 1, "scope": 1, "term": "(even T1)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "145": { "goal": [{ "clause": -1, "scope": -1, "term": "(even (0))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "146": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "60": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "61": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "62": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (p T3 X3) (odd X3))" }], "kb": { "nonunifying": [[ "(even T3)", "(even (0))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T3"], "free": ["X3"], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 2, "label": "CASE" }, { "from": 2, "to": 54, "label": "EVAL with clause\neven(0) :- !_1.\nand substitutionT1 -> 0" }, { "from": 2, "to": 59, "label": "EVAL-BACKTRACK" }, { "from": 54, "to": 60, "label": "CUT" }, { "from": 59, "to": 62, "label": "ONLY EVAL with clause\neven(X2) :- ','(p(X2, X3), odd(X3)).\nand substitutionT1 -> T3,\nX2 -> T3" }, { "from": 60, "to": 61, "label": "SUCCESS" }, { "from": 62, "to": 72, "label": "CASE" }, { "from": 72, "to": 73, "label": "BACKTRACK\nfor clause: p(0, 0)\nwith clash: (even(T3), even(0))" }, { "from": 73, "to": 77, "label": "EVAL with clause\np(s(X6), X6).\nand substitutionX6 -> T6,\nT3 -> s(T6),\nX3 -> T6" }, { "from": 73, "to": 89, "label": "EVAL-BACKTRACK" }, { "from": 77, "to": 132, "label": "CASE" }, { "from": 132, "to": 133, "label": "EVAL with clause\nodd(s(0)) :- !_3.\nand substitutionT6 -> s(0)" }, { "from": 132, "to": 134, "label": "EVAL-BACKTRACK" }, { "from": 133, "to": 135, "label": "CUT" }, { "from": 134, "to": 139, "label": "ONLY EVAL with clause\nodd(X10) :- ','(p(X10, X11), even(X11)).\nand substitutionT6 -> T9,\nX10 -> T9" }, { "from": 135, "to": 136, "label": "SUCCESS" }, { "from": 139, "to": 140, "label": "CASE" }, { "from": 140, "to": 141, "label": "PARALLEL" }, { "from": 140, "to": 142, "label": "PARALLEL" }, { "from": 141, "to": 145, "label": "EVAL with clause\np(0, 0).\nand substitutionT9 -> 0,\nX11 -> 0" }, { "from": 141, "to": 146, "label": "EVAL-BACKTRACK" }, { "from": 142, "to": 165, "label": "EVAL with clause\np(s(X14), X14).\nand substitutionX14 -> T12,\nT9 -> s(T12),\nX11 -> T12" }, { "from": 142, "to": 166, "label": "EVAL-BACKTRACK" }, { "from": 145, "to": 1, "label": "INSTANCE with matching:\nT1 -> 0" }, { "from": 165, "to": 1, "label": "INSTANCE with matching:\nT1 -> T12" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: evenA(s(0)) :- evenA(0). evenA(s(s(X1))) :- evenA(X1). Clauses: evencA(0). evencA(s(s(0))). evencA(s(0)) :- evencA(0). evencA(s(s(X1))) :- evencA(X1). Afs: evenA(x1) = evenA(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: evenA_in_1: (b) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: EVENA_IN_G(s(0)) -> U1_G(evenA_in_g(0)) EVENA_IN_G(s(0)) -> EVENA_IN_G(0) EVENA_IN_G(s(s(X1))) -> U2_G(X1, evenA_in_g(X1)) EVENA_IN_G(s(s(X1))) -> EVENA_IN_G(X1) R is empty. Pi is empty. 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: EVENA_IN_G(s(0)) -> U1_G(evenA_in_g(0)) EVENA_IN_G(s(0)) -> EVENA_IN_G(0) EVENA_IN_G(s(s(X1))) -> U2_G(X1, evenA_in_g(X1)) EVENA_IN_G(s(s(X1))) -> EVENA_IN_G(X1) R is empty. Pi is empty. We have to consider all (P,R,Pi)-chains ---------------------------------------- (5) DependencyGraphProof (EQUIVALENT) The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 3 less nodes. ---------------------------------------- (6) Obligation: Pi DP problem: The TRS P consists of the following rules: EVENA_IN_G(s(s(X1))) -> EVENA_IN_G(X1) R is empty. Pi is empty. We have to consider all (P,R,Pi)-chains ---------------------------------------- (7) PiDPToQDPProof (EQUIVALENT) 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: EVENA_IN_G(s(s(X1))) -> EVENA_IN_G(X1) 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: *EVENA_IN_G(s(s(X1))) -> EVENA_IN_G(X1) The graph contains the following edges 1 > 1 ---------------------------------------- (10) YES