/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 sum(g,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, 17 ms] (8) QDP (9) QDPSizeChangeProof [EQUIVALENT, 0 ms] (10) YES ---------------------------------------- (0) Obligation: Clauses: sum([], [], []). sum(.(X1, Y1), .(X2, Y2), .(X3, Y3)) :- ','(add(X1, X2, X3), sum(Y1, Y2, Y3)). add(0, X, X). add(s(X), Y, s(Z)) :- add(X, Y, Z). Query: sum(g,g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 165, "program": { "directives": [], "clauses": [ [ "(sum ([]) ([]) ([]))", null ], [ "(sum (. X1 Y1) (. X2 Y2) (. X3 Y3))", "(',' (add X1 X2 X3) (sum Y1 Y2 Y3))" ], [ "(add (0) X X)", null ], [ "(add (s X) Y (s Z))", "(add X Y Z)" ] ] }, "graph": { "nodes": { "170": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "181": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T11 T13 T23)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T13" ], "free": [], "exprvars": [] } }, "171": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (add T10 T12 T16) (sum T11 T13 T17))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T12", "T13" ], "free": [], "exprvars": [] } }, "182": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "type": "Nodes", "174": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "175": { "goal": [ { "clause": 2, "scope": 2, "term": "(',' (add T10 T12 T16) (sum T11 T13 T17))" }, { "clause": 3, "scope": 2, "term": "(',' (add T10 T12 T16) (sum T11 T13 T17))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T12", "T13" ], "free": [], "exprvars": [] } }, "165": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "176": { "goal": [{ "clause": 2, "scope": 2, "term": "(',' (add T10 T12 T16) (sum T11 T13 T17))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T12", "T13" ], "free": [], "exprvars": [] } }, "166": { "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": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "177": { "goal": [{ "clause": 3, "scope": 2, "term": "(',' (add T10 T12 T16) (sum T11 T13 T17))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T12", "T13" ], "free": [], "exprvars": [] } }, "221": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (add T30 T31 T33) (sum T11 T13 T34))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T13", "T30", "T31" ], "free": [], "exprvars": [] } }, "167": { "goal": [ { "clause": -1, "scope": -1, "term": "(true)" }, { "clause": 1, "scope": 1, "term": "(sum ([]) ([]) T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "222": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "168": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [[ "(sum T1 T2 T3)", "(sum ([]) ([]) ([]))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "169": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum ([]) ([]) T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } } }, "edges": [ { "from": 165, "to": 166, "label": "CASE" }, { "from": 166, "to": 167, "label": "EVAL with clause\nsum([], [], []).\nand substitutionT1 -> [],\nT2 -> [],\nT3 -> []" }, { "from": 166, "to": 168, "label": "EVAL-BACKTRACK" }, { "from": 167, "to": 169, "label": "SUCCESS" }, { "from": 168, "to": 171, "label": "EVAL with clause\nsum(.(X16, X17), .(X18, X19), .(X20, X21)) :- ','(add(X16, X18, X20), sum(X17, X19, X21)).\nand substitutionX16 -> T10,\nX17 -> T11,\nT1 -> .(T10, T11),\nX18 -> T12,\nX19 -> T13,\nT2 -> .(T12, T13),\nX20 -> T16,\nX21 -> T17,\nT3 -> .(T16, T17),\nT14 -> T16,\nT15 -> T17" }, { "from": 168, "to": 174, "label": "EVAL-BACKTRACK" }, { "from": 169, "to": 170, "label": "BACKTRACK\nfor clause: sum(.(X1, Y1), .(X2, Y2), .(X3, Y3)) :- ','(add(X1, X2, X3), sum(Y1, Y2, Y3))because of non-unification" }, { "from": 171, "to": 175, "label": "CASE" }, { "from": 175, "to": 176, "label": "PARALLEL" }, { "from": 175, "to": 177, "label": "PARALLEL" }, { "from": 176, "to": 181, "label": "EVAL with clause\nadd(0, X26, X26).\nand substitutionT10 -> 0,\nT12 -> T22,\nX26 -> T22,\nT16 -> T22,\nT17 -> T23" }, { "from": 176, "to": 182, "label": "EVAL-BACKTRACK" }, { "from": 177, "to": 221, "label": "EVAL with clause\nadd(s(X33), X34, s(X35)) :- add(X33, X34, X35).\nand substitutionX33 -> T30,\nT10 -> s(T30),\nT12 -> T31,\nX34 -> T31,\nX35 -> T33,\nT16 -> s(T33),\nT32 -> T33,\nT17 -> T34" }, { "from": 177, "to": 222, "label": "EVAL-BACKTRACK" }, { "from": 181, "to": 165, "label": "INSTANCE with matching:\nT1 -> T11\nT2 -> T13\nT3 -> T23" }, { "from": 221, "to": 171, "label": "INSTANCE with matching:\nT10 -> T30\nT12 -> T31\nT16 -> T33\nT17 -> T34" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: pB(0, X1, X1, X2, X3, X4) :- sumA(X2, X3, X4). pB(s(X1), X2, s(X3), X4, X5, X6) :- pB(X1, X2, X3, X4, X5, X6). sumA(.(X1, X2), .(X3, X4), .(X5, X6)) :- pB(X1, X3, X5, X2, X4, X6). Clauses: sumcA([], [], []). sumcA(.(X1, X2), .(X3, X4), .(X5, X6)) :- qcB(X1, X3, X5, X2, X4, X6). qcB(0, X1, X1, X2, X3, X4) :- sumcA(X2, X3, X4). qcB(s(X1), X2, s(X3), X4, X5, X6) :- qcB(X1, X2, X3, X4, X5, X6). Afs: sumA(x1, x2, x3) = sumA(x1, 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: (b,b,f) pB_in_6: (b,b,f,b,b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: SUMA_IN_GGA(.(X1, X2), .(X3, X4), .(X5, X6)) -> U3_GGA(X1, X2, X3, X4, X5, X6, pB_in_ggagga(X1, X3, X5, X2, X4, X6)) SUMA_IN_GGA(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GGAGGA(X1, X3, X5, X2, X4, X6) PB_IN_GGAGGA(0, X1, X1, X2, X3, X4) -> U1_GGAGGA(X1, X2, X3, X4, sumA_in_gga(X2, X3, X4)) PB_IN_GGAGGA(0, X1, X1, X2, X3, X4) -> SUMA_IN_GGA(X2, X3, X4) PB_IN_GGAGGA(s(X1), X2, s(X3), X4, X5, X6) -> U2_GGAGGA(X1, X2, X3, X4, X5, X6, pB_in_ggagga(X1, X2, X3, X4, X5, X6)) PB_IN_GGAGGA(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GGAGGA(X1, X2, X3, X4, X5, X6) R is empty. The argument filtering Pi contains the following mapping: sumA_in_gga(x1, x2, x3) = sumA_in_gga(x1, x2) .(x1, x2) = .(x1, x2) pB_in_ggagga(x1, x2, x3, x4, x5, x6) = pB_in_ggagga(x1, x2, x4, x5) 0 = 0 s(x1) = s(x1) SUMA_IN_GGA(x1, x2, x3) = SUMA_IN_GGA(x1, x2) U3_GGA(x1, x2, x3, x4, x5, x6, x7) = U3_GGA(x1, x2, x3, x4, x7) PB_IN_GGAGGA(x1, x2, x3, x4, x5, x6) = PB_IN_GGAGGA(x1, x2, x4, x5) U1_GGAGGA(x1, x2, x3, x4, x5) = U1_GGAGGA(x1, x2, x3, x5) U2_GGAGGA(x1, x2, x3, x4, x5, x6, x7) = U2_GGAGGA(x1, x2, x4, x5, x7) 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_GGA(.(X1, X2), .(X3, X4), .(X5, X6)) -> U3_GGA(X1, X2, X3, X4, X5, X6, pB_in_ggagga(X1, X3, X5, X2, X4, X6)) SUMA_IN_GGA(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GGAGGA(X1, X3, X5, X2, X4, X6) PB_IN_GGAGGA(0, X1, X1, X2, X3, X4) -> U1_GGAGGA(X1, X2, X3, X4, sumA_in_gga(X2, X3, X4)) PB_IN_GGAGGA(0, X1, X1, X2, X3, X4) -> SUMA_IN_GGA(X2, X3, X4) PB_IN_GGAGGA(s(X1), X2, s(X3), X4, X5, X6) -> U2_GGAGGA(X1, X2, X3, X4, X5, X6, pB_in_ggagga(X1, X2, X3, X4, X5, X6)) PB_IN_GGAGGA(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GGAGGA(X1, X2, X3, X4, X5, X6) R is empty. The argument filtering Pi contains the following mapping: sumA_in_gga(x1, x2, x3) = sumA_in_gga(x1, x2) .(x1, x2) = .(x1, x2) pB_in_ggagga(x1, x2, x3, x4, x5, x6) = pB_in_ggagga(x1, x2, x4, x5) 0 = 0 s(x1) = s(x1) SUMA_IN_GGA(x1, x2, x3) = SUMA_IN_GGA(x1, x2) U3_GGA(x1, x2, x3, x4, x5, x6, x7) = U3_GGA(x1, x2, x3, x4, x7) PB_IN_GGAGGA(x1, x2, x3, x4, x5, x6) = PB_IN_GGAGGA(x1, x2, x4, x5) U1_GGAGGA(x1, x2, x3, x4, x5) = U1_GGAGGA(x1, x2, x3, x5) U2_GGAGGA(x1, x2, x3, x4, x5, x6, x7) = U2_GGAGGA(x1, x2, x4, x5, x7) 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: SUMA_IN_GGA(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GGAGGA(X1, X3, X5, X2, X4, X6) PB_IN_GGAGGA(0, X1, X1, X2, X3, X4) -> SUMA_IN_GGA(X2, X3, X4) PB_IN_GGAGGA(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GGAGGA(X1, X2, X3, X4, X5, X6) R is empty. The argument filtering Pi contains the following mapping: .(x1, x2) = .(x1, x2) 0 = 0 s(x1) = s(x1) SUMA_IN_GGA(x1, x2, x3) = SUMA_IN_GGA(x1, x2) PB_IN_GGAGGA(x1, x2, x3, x4, x5, x6) = PB_IN_GGAGGA(x1, x2, x4, x5) 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_GGA(.(X1, X2), .(X3, X4)) -> PB_IN_GGAGGA(X1, X3, X2, X4) PB_IN_GGAGGA(0, X1, X2, X3) -> SUMA_IN_GGA(X2, X3) PB_IN_GGAGGA(s(X1), X2, X4, X5) -> PB_IN_GGAGGA(X1, X2, X4, X5) 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: *PB_IN_GGAGGA(0, X1, X2, X3) -> SUMA_IN_GGA(X2, X3) The graph contains the following edges 3 >= 1, 4 >= 2 *PB_IN_GGAGGA(s(X1), X2, X4, X5) -> PB_IN_GGAGGA(X1, X2, X4, X5) The graph contains the following edges 1 > 1, 2 >= 2, 3 >= 3, 4 >= 4 *SUMA_IN_GGA(.(X1, X2), .(X3, X4)) -> PB_IN_GGAGGA(X1, X3, X2, X4) The graph contains the following edges 1 > 1, 2 > 2, 1 > 3, 2 > 4 ---------------------------------------- (10) YES