YES proof of /export/starexec/sandbox/benchmark/theBenchmark.pl # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty Left Termination of the query pattern sum(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, 5 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: sum(X, 0, X). sum(X, s(Y), s(Z)) :- sum(X, Y, Z). Query: sum(a,g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 6, "program": { "directives": [], "clauses": [ [ "(sum X (0) X)", null ], [ "(sum X (s Y) (s Z))", "(sum X Y Z)" ] ] }, "graph": { "nodes": { "88": { "goal": [ { "clause": 0, "scope": 2, "term": "(sum T13 T11 T14)" }, { "clause": 1, "scope": 2, "term": "(sum T13 T11 T14)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T11"], "free": [], "exprvars": [] } }, "12": { "goal": [ { "clause": 0, "scope": 1, "term": "(sum T1 T2 T3)" }, { "clause": 1, "scope": 1, "term": "(sum T1 T2 T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": [], "exprvars": [] } }, "89": { "goal": [{ "clause": 0, "scope": 2, "term": "(sum T13 T11 T14)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T11"], "free": [], "exprvars": [] } }, "type": "Nodes", "6": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": [], "exprvars": [] } }, "90": { "goal": [{ "clause": 1, "scope": 2, "term": "(sum T13 T11 T14)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T11"], "free": [], "exprvars": [] } }, "91": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "92": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "82": { "goal": [ { "clause": -1, "scope": -1, "term": "(true)" }, { "clause": 1, "scope": 1, "term": "(sum T1 (0) T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "93": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "83": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [[ "(sum T1 T2 T3)", "(sum X2 (0) X2)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T2"], "free": ["X2"], "exprvars": [] } }, "94": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T29 T27 T30)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T27"], "free": [], "exprvars": [] } }, "84": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum T1 (0) T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "95": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "85": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "86": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T13 T11 T14)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T11"], "free": [], "exprvars": [] } }, "87": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } } }, "edges": [ { "from": 6, "to": 12, "label": "CASE" }, { "from": 12, "to": 82, "label": "EVAL with clause\nsum(X2, 0, X2).\nand substitutionT1 -> T5,\nX2 -> T5,\nT2 -> 0,\nT3 -> T5" }, { "from": 12, "to": 83, "label": "EVAL-BACKTRACK" }, { "from": 82, "to": 84, "label": "SUCCESS" }, { "from": 83, "to": 86, "label": "EVAL with clause\nsum(X9, s(X10), s(X11)) :- sum(X9, X10, X11).\nand substitutionT1 -> T13,\nX9 -> T13,\nX10 -> T11,\nT2 -> s(T11),\nX11 -> T14,\nT3 -> s(T14),\nT10 -> T13,\nT12 -> T14" }, { "from": 83, "to": 87, "label": "EVAL-BACKTRACK" }, { "from": 84, "to": 85, "label": "BACKTRACK\nfor clause: sum(X, s(Y), s(Z)) :- sum(X, Y, Z)because of non-unification" }, { "from": 86, "to": 88, "label": "CASE" }, { "from": 88, "to": 89, "label": "PARALLEL" }, { "from": 88, "to": 90, "label": "PARALLEL" }, { "from": 89, "to": 91, "label": "EVAL with clause\nsum(X16, 0, X16).\nand substitutionT13 -> T19,\nX16 -> T19,\nT11 -> 0,\nT14 -> T19" }, { "from": 89, "to": 92, "label": "EVAL-BACKTRACK" }, { "from": 90, "to": 94, "label": "EVAL with clause\nsum(X23, s(X24), s(X25)) :- sum(X23, X24, X25).\nand substitutionT13 -> T29,\nX23 -> T29,\nX24 -> T27,\nT11 -> s(T27),\nX25 -> T30,\nT14 -> s(T30),\nT26 -> T29,\nT28 -> T30" }, { "from": 90, "to": 95, "label": "EVAL-BACKTRACK" }, { "from": 91, "to": 93, "label": "SUCCESS" }, { "from": 94, "to": 6, "label": "INSTANCE with matching:\nT1 -> T29\nT2 -> T27\nT3 -> T30" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: sumA(X1, s(s(X2)), s(s(X3))) :- sumA(X1, X2, X3). Clauses: sumcA(X1, 0, X1). sumcA(X1, s(0), s(X1)). sumcA(X1, s(s(X2)), s(s(X3))) :- sumcA(X1, X2, X3). Afs: sumA(x1, x2, x3) = sumA(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: sumA_in_3: (f,b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: SUMA_IN_AGA(X1, s(s(X2)), s(s(X3))) -> U1_AGA(X1, X2, X3, sumA_in_aga(X1, X2, X3)) SUMA_IN_AGA(X1, s(s(X2)), s(s(X3))) -> SUMA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: sumA_in_aga(x1, x2, x3) = sumA_in_aga(x2) s(x1) = s(x1) SUMA_IN_AGA(x1, x2, x3) = SUMA_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: SUMA_IN_AGA(X1, s(s(X2)), s(s(X3))) -> U1_AGA(X1, X2, X3, sumA_in_aga(X1, X2, X3)) SUMA_IN_AGA(X1, s(s(X2)), s(s(X3))) -> SUMA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: sumA_in_aga(x1, x2, x3) = sumA_in_aga(x2) s(x1) = s(x1) SUMA_IN_AGA(x1, x2, x3) = SUMA_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: SUMA_IN_AGA(X1, s(s(X2)), s(s(X3))) -> SUMA_IN_AGA(X1, X2, X3) R is empty. The argument filtering Pi contains the following mapping: s(x1) = s(x1) SUMA_IN_AGA(x1, x2, x3) = SUMA_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: SUMA_IN_AGA(s(s(X2))) -> SUMA_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: *SUMA_IN_AGA(s(s(X2))) -> SUMA_IN_AGA(X2) The graph contains the following edges 1 > 1 ---------------------------------------- (10) YES