/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 sum(g,a,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 [SOUND, 0 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,a,g) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 3, "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": { "190": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "180": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "type": "Nodes", "172": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum ([]) T2 ([]))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "184": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (add T10 T16 T14) (sum T11 T17 T15))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T14", "T15" ], "free": [], "exprvars": [] } }, "185": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "120": { "goal": [{ "clause": 1, "scope": 1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [[ "(sum T1 T2 T3)", "(sum ([]) ([]) ([]))" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T3" ], "free": [], "exprvars": [] } }, "186": { "goal": [ { "clause": 2, "scope": 2, "term": "(',' (add T10 T16 T14) (sum T11 T17 T15))" }, { "clause": 3, "scope": 2, "term": "(',' (add T10 T16 T14) (sum T11 T17 T15))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T14", "T15" ], "free": [], "exprvars": [] } }, "187": { "goal": [{ "clause": 2, "scope": 2, "term": "(',' (add T10 T16 T14) (sum T11 T17 T15))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T14", "T15" ], "free": [], "exprvars": [] } }, "188": { "goal": [{ "clause": 3, "scope": 2, "term": "(',' (add T10 T16 T14) (sum T11 T17 T15))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T10", "T11", "T14", "T15" ], "free": [], "exprvars": [] } }, "189": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T11 T23 T15)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T15" ], "free": [], "exprvars": [] } }, "3": { "goal": [{ "clause": -1, "scope": -1, "term": "(sum T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T3" ], "free": [], "exprvars": [] } }, "205": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (add T30 T33 T32) (sum T11 T34 T15))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T11", "T15", "T30", "T32" ], "free": [], "exprvars": [] } }, "107": { "goal": [ { "clause": -1, "scope": -1, "term": "(true)" }, { "clause": 1, "scope": 1, "term": "(sum ([]) T2 ([]))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "206": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "10": { "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", "T3" ], "free": [], "exprvars": [] } } }, "edges": [ { "from": 3, "to": 10, "label": "CASE" }, { "from": 10, "to": 107, "label": "EVAL with clause\nsum([], [], []).\nand substitutionT1 -> [],\nT2 -> [],\nT3 -> []" }, { "from": 10, "to": 120, "label": "EVAL-BACKTRACK" }, { "from": 107, "to": 172, "label": "SUCCESS" }, { "from": 120, "to": 184, "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 -> T16,\nX19 -> T17,\nT2 -> .(T16, T17),\nX20 -> T14,\nX21 -> T15,\nT3 -> .(T14, T15),\nT12 -> T16,\nT13 -> T17" }, { "from": 120, "to": 185, "label": "EVAL-BACKTRACK" }, { "from": 172, "to": 180, "label": "BACKTRACK\nfor clause: sum(.(X1, Y1), .(X2, Y2), .(X3, Y3)) :- ','(add(X1, X2, X3), sum(Y1, Y2, Y3))because of non-unification" }, { "from": 184, "to": 186, "label": "CASE" }, { "from": 186, "to": 187, "label": "PARALLEL" }, { "from": 186, "to": 188, "label": "PARALLEL" }, { "from": 187, "to": 189, "label": "EVAL with clause\nadd(0, X26, X26).\nand substitutionT10 -> 0,\nT16 -> T22,\nX26 -> T22,\nT14 -> T22,\nT17 -> T23" }, { "from": 187, "to": 190, "label": "EVAL-BACKTRACK" }, { "from": 188, "to": 205, "label": "EVAL with clause\nadd(s(X33), X34, s(X35)) :- add(X33, X34, X35).\nand substitutionX33 -> T30,\nT10 -> s(T30),\nT16 -> T33,\nX34 -> T33,\nX35 -> T32,\nT14 -> s(T32),\nT31 -> T33,\nT17 -> T34" }, { "from": 188, "to": 206, "label": "EVAL-BACKTRACK" }, { "from": 189, "to": 3, "label": "INSTANCE with matching:\nT1 -> T11\nT2 -> T23\nT3 -> T15" }, { "from": 205, "to": 184, "label": "INSTANCE with matching:\nT10 -> T30\nT16 -> T33\nT14 -> T32\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, x3) ---------------------------------------- (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,f,b) pB_in_6: (b,f,b,b,f,b) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: SUMA_IN_GAG(.(X1, X2), .(X3, X4), .(X5, X6)) -> U3_GAG(X1, X2, X3, X4, X5, X6, pB_in_gaggag(X1, X3, X5, X2, X4, X6)) SUMA_IN_GAG(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GAGGAG(X1, X3, X5, X2, X4, X6) PB_IN_GAGGAG(0, X1, X1, X2, X3, X4) -> U1_GAGGAG(X1, X2, X3, X4, sumA_in_gag(X2, X3, X4)) PB_IN_GAGGAG(0, X1, X1, X2, X3, X4) -> SUMA_IN_GAG(X2, X3, X4) PB_IN_GAGGAG(s(X1), X2, s(X3), X4, X5, X6) -> U2_GAGGAG(X1, X2, X3, X4, X5, X6, pB_in_gaggag(X1, X2, X3, X4, X5, X6)) PB_IN_GAGGAG(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GAGGAG(X1, X2, X3, X4, X5, X6) R is empty. The argument filtering Pi contains the following mapping: sumA_in_gag(x1, x2, x3) = sumA_in_gag(x1, x3) .(x1, x2) = .(x1, x2) pB_in_gaggag(x1, x2, x3, x4, x5, x6) = pB_in_gaggag(x1, x3, x4, x6) 0 = 0 s(x1) = s(x1) SUMA_IN_GAG(x1, x2, x3) = SUMA_IN_GAG(x1, x3) U3_GAG(x1, x2, x3, x4, x5, x6, x7) = U3_GAG(x1, x2, x5, x6, x7) PB_IN_GAGGAG(x1, x2, x3, x4, x5, x6) = PB_IN_GAGGAG(x1, x3, x4, x6) U1_GAGGAG(x1, x2, x3, x4, x5) = U1_GAGGAG(x1, x2, x4, x5) U2_GAGGAG(x1, x2, x3, x4, x5, x6, x7) = U2_GAGGAG(x1, x3, x4, x6, 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_GAG(.(X1, X2), .(X3, X4), .(X5, X6)) -> U3_GAG(X1, X2, X3, X4, X5, X6, pB_in_gaggag(X1, X3, X5, X2, X4, X6)) SUMA_IN_GAG(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GAGGAG(X1, X3, X5, X2, X4, X6) PB_IN_GAGGAG(0, X1, X1, X2, X3, X4) -> U1_GAGGAG(X1, X2, X3, X4, sumA_in_gag(X2, X3, X4)) PB_IN_GAGGAG(0, X1, X1, X2, X3, X4) -> SUMA_IN_GAG(X2, X3, X4) PB_IN_GAGGAG(s(X1), X2, s(X3), X4, X5, X6) -> U2_GAGGAG(X1, X2, X3, X4, X5, X6, pB_in_gaggag(X1, X2, X3, X4, X5, X6)) PB_IN_GAGGAG(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GAGGAG(X1, X2, X3, X4, X5, X6) R is empty. The argument filtering Pi contains the following mapping: sumA_in_gag(x1, x2, x3) = sumA_in_gag(x1, x3) .(x1, x2) = .(x1, x2) pB_in_gaggag(x1, x2, x3, x4, x5, x6) = pB_in_gaggag(x1, x3, x4, x6) 0 = 0 s(x1) = s(x1) SUMA_IN_GAG(x1, x2, x3) = SUMA_IN_GAG(x1, x3) U3_GAG(x1, x2, x3, x4, x5, x6, x7) = U3_GAG(x1, x2, x5, x6, x7) PB_IN_GAGGAG(x1, x2, x3, x4, x5, x6) = PB_IN_GAGGAG(x1, x3, x4, x6) U1_GAGGAG(x1, x2, x3, x4, x5) = U1_GAGGAG(x1, x2, x4, x5) U2_GAGGAG(x1, x2, x3, x4, x5, x6, x7) = U2_GAGGAG(x1, x3, x4, x6, 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_GAG(.(X1, X2), .(X3, X4), .(X5, X6)) -> PB_IN_GAGGAG(X1, X3, X5, X2, X4, X6) PB_IN_GAGGAG(0, X1, X1, X2, X3, X4) -> SUMA_IN_GAG(X2, X3, X4) PB_IN_GAGGAG(s(X1), X2, s(X3), X4, X5, X6) -> PB_IN_GAGGAG(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_GAG(x1, x2, x3) = SUMA_IN_GAG(x1, x3) PB_IN_GAGGAG(x1, x2, x3, x4, x5, x6) = PB_IN_GAGGAG(x1, x3, x4, x6) 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_GAG(.(X1, X2), .(X5, X6)) -> PB_IN_GAGGAG(X1, X5, X2, X6) PB_IN_GAGGAG(0, X1, X2, X4) -> SUMA_IN_GAG(X2, X4) PB_IN_GAGGAG(s(X1), s(X3), X4, X6) -> PB_IN_GAGGAG(X1, X3, X4, X6) 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_GAGGAG(0, X1, X2, X4) -> SUMA_IN_GAG(X2, X4) The graph contains the following edges 3 >= 1, 4 >= 2 *PB_IN_GAGGAG(s(X1), s(X3), X4, X6) -> PB_IN_GAGGAG(X1, X3, X4, X6) The graph contains the following edges 1 > 1, 2 > 2, 3 >= 3, 4 >= 4 *SUMA_IN_GAG(.(X1, X2), .(X5, X6)) -> PB_IN_GAGGAG(X1, X5, X2, X6) The graph contains the following edges 1 > 1, 2 > 2, 1 > 3, 2 > 4 ---------------------------------------- (10) YES