/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 fold(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, 4 ms] (4) PiDP (5) DependencyGraphProof [EQUIVALENT, 0 ms] (6) TRUE ---------------------------------------- (0) Obligation: Clauses: fold(X, [], Z) :- ','(!, eq(X, Z)). fold(X, Y, Z) :- ','(head(Y, H), ','(tail(Y, T), ','(myop(X, H, V), fold(V, T, Z)))). myop(a, b, c). head([], X1). head(.(H, X2), H). tail([], []). tail(.(X3, T), T). eq(X, X). Query: fold(g,g,a) ---------------------------------------- (1) PrologToDTProblemTransformerProof (SOUND) Built DT problem from termination graph DT10. { "root": 1, "program": { "directives": [], "clauses": [ [ "(fold X ([]) Z)", "(',' (!) (eq X Z))" ], [ "(fold X Y Z)", "(',' (head Y H) (',' (tail Y T) (',' (myop X H V) (fold V T Z))))" ], [ "(myop (a) (b) (c))", null ], [ "(head ([]) X1)", null ], [ "(head (. H X2) H)", null ], [ "(tail ([]) ([]))", null ], [ "(tail (. X3 T) T)", null ], [ "(eq X X)", null ] ] }, "graph": { "nodes": { "180": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (myop T15 T31 X19) (fold X19 T32 T18))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T31", "T32" ], "free": ["X19"], "exprvars": [] } }, "181": { "goal": [{ "clause": 2, "scope": 5, "term": "(',' (myop T15 T31 X19) (fold X19 T32 T18))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T31", "T32" ], "free": ["X19"], "exprvars": [] } }, "171": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (tail (. T23 T24) X18) (',' (myop T15 T23 X19) (fold X19 X18 T18)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T23", "T24" ], "free": [ "X18", "X19" ], "exprvars": [] } }, "182": { "goal": [{ "clause": -1, "scope": -1, "term": "(fold (c) T32 T18)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T32"], "free": [], "exprvars": [] } }, "type": "Nodes", "161": { "goal": [{ "clause": 4, "scope": 3, "term": "(',' (head T16 X17) (',' (tail T16 X18) (',' (myop T15 X17 X19) (fold X19 X18 T18))))" }], "kb": { "nonunifying": [[ "(fold T15 T16 T3)", "(fold X6 ([]) X7)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T16" ], "free": [ "X6", "X7", "X17", "X18", "X19" ], "exprvars": [] } }, "183": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "140": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "173": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "141": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "131": { "goal": [{ "clause": 1, "scope": 1, "term": "(fold T1 T2 T3)" }], "kb": { "nonunifying": [[ "(fold T1 T2 T3)", "(fold X6 ([]) X7)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [ "X6", "X7" ], "exprvars": [] } }, "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(fold T1 T2 T3)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "177": { "goal": [ { "clause": 5, "scope": 4, "term": "(',' (tail (. T23 T24) X18) (',' (myop T15 T23 X19) (fold X19 X18 T18)))" }, { "clause": 6, "scope": 4, "term": "(',' (tail (. T23 T24) X18) (',' (myop T15 T23 X19) (fold X19 X18 T18)))" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T23", "T24" ], "free": [ "X18", "X19" ], "exprvars": [] } }, "156": { "goal": [ { "clause": 3, "scope": 3, "term": "(',' (head T16 X17) (',' (tail T16 X18) (',' (myop T15 X17 X19) (fold X19 X18 T18))))" }, { "clause": 4, "scope": 3, "term": "(',' (head T16 X17) (',' (tail T16 X18) (',' (myop T15 X17 X19) (fold X19 X18 T18))))" } ], "kb": { "nonunifying": [[ "(fold T15 T16 T3)", "(fold X6 ([]) X7)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T16" ], "free": [ "X6", "X7", "X17", "X18", "X19" ], "exprvars": [] } }, "178": { "goal": [{ "clause": 6, "scope": 4, "term": "(',' (tail (. T23 T24) X18) (',' (myop T15 T23 X19) (fold X19 X18 T18)))" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T23", "T24" ], "free": [ "X18", "X19" ], "exprvars": [] } }, "146": { "goal": [{ "clause": -1, "scope": -1, "term": "(',' (head T16 X17) (',' (tail T16 X18) (',' (myop T15 X17 X19) (fold X19 X18 T18))))" }], "kb": { "nonunifying": [[ "(fold T15 T16 T3)", "(fold X6 ([]) X7)" ]], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T15", "T16" ], "free": [ "X6", "X7", "X17", "X18", "X19" ], "exprvars": [] } }, "4": { "goal": [ { "clause": 0, "scope": 1, "term": "(fold T1 T2 T3)" }, { "clause": 1, "scope": 1, "term": "(fold T1 T2 T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T1", "T2" ], "free": [], "exprvars": [] } }, "137": { "goal": [{ "clause": -1, "scope": -1, "term": "(eq T6 T8)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "138": { "goal": [{ "clause": 7, "scope": 2, "term": "(eq T6 T8)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "117": { "goal": [ { "clause": -1, "scope": -1, "term": "(',' (!_1) (eq T6 T8))" }, { "clause": 1, "scope": 1, "term": "(fold T6 ([]) T3)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T6"], "free": [], "exprvars": [] } }, "139": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 4, "label": "CASE" }, { "from": 4, "to": 117, "label": "EVAL with clause\nfold(X6, [], X7) :- ','(!_1, eq(X6, X7)).\nand substitutionT1 -> T6,\nX6 -> T6,\nT2 -> [],\nT3 -> T8,\nX7 -> T8,\nT7 -> T8" }, { "from": 4, "to": 131, "label": "EVAL-BACKTRACK" }, { "from": 117, "to": 137, "label": "CUT" }, { "from": 131, "to": 146, "label": "ONLY EVAL with clause\nfold(X14, X15, X16) :- ','(head(X15, X17), ','(tail(X15, X18), ','(myop(X14, X17, X19), fold(X19, X18, X16)))).\nand substitutionT1 -> T15,\nX14 -> T15,\nT2 -> T16,\nX15 -> T16,\nT3 -> T18,\nX16 -> T18,\nT17 -> T18" }, { "from": 137, "to": 138, "label": "CASE" }, { "from": 138, "to": 139, "label": "EVAL with clause\neq(X10, X10).\nand substitutionT6 -> T11,\nX10 -> T11,\nT8 -> T11" }, { "from": 138, "to": 140, "label": "EVAL-BACKTRACK" }, { "from": 139, "to": 141, "label": "SUCCESS" }, { "from": 146, "to": 156, "label": "CASE" }, { "from": 156, "to": 161, "label": "BACKTRACK\nfor clause: head([], X1)\nwith clash: (fold(T15, T16, T3), fold(X6, [], X7))" }, { "from": 161, "to": 171, "label": "EVAL with clause\nhead(.(X26, X27), X26).\nand substitutionX26 -> T23,\nX27 -> T24,\nT16 -> .(T23, T24),\nX17 -> T23" }, { "from": 161, "to": 173, "label": "EVAL-BACKTRACK" }, { "from": 171, "to": 177, "label": "CASE" }, { "from": 177, "to": 178, "label": "BACKTRACK\nfor clause: tail([], [])because of non-unification" }, { "from": 178, "to": 180, "label": "ONLY EVAL with clause\ntail(.(X38, X39), X39).\nand substitutionT23 -> T31,\nX38 -> T31,\nT24 -> T32,\nX39 -> T32,\nX18 -> T32" }, { "from": 180, "to": 181, "label": "CASE" }, { "from": 181, "to": 182, "label": "EVAL with clause\nmyop(a, b, c).\nand substitutionT15 -> a,\nT31 -> b,\nX19 -> c" }, { "from": 181, "to": 183, "label": "EVAL-BACKTRACK" }, { "from": 182, "to": 1, "label": "INSTANCE with matching:\nT1 -> c\nT2 -> T32\nT3 -> T18" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Triples: foldA(a, .(b, X1), X2) :- foldA(c, X1, X2). Clauses: foldcA(X1, [], X1). foldcA(a, .(b, X1), X2) :- foldcA(c, X1, X2). Afs: foldA(x1, x2, x3) = foldA(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: foldA_in_3: (b,b,f) Transforming TRIPLES into the following Term Rewriting System: Pi DP problem: The TRS P consists of the following rules: FOLDA_IN_GGA(a, .(b, X1), X2) -> U1_GGA(X1, X2, foldA_in_gga(c, X1, X2)) FOLDA_IN_GGA(a, .(b, X1), X2) -> FOLDA_IN_GGA(c, X1, X2) R is empty. The argument filtering Pi contains the following mapping: foldA_in_gga(x1, x2, x3) = foldA_in_gga(x1, x2) a = a .(x1, x2) = .(x1, x2) b = b c = c FOLDA_IN_GGA(x1, x2, x3) = FOLDA_IN_GGA(x1, x2) U1_GGA(x1, x2, x3) = U1_GGA(x1, x3) 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: FOLDA_IN_GGA(a, .(b, X1), X2) -> U1_GGA(X1, X2, foldA_in_gga(c, X1, X2)) FOLDA_IN_GGA(a, .(b, X1), X2) -> FOLDA_IN_GGA(c, X1, X2) R is empty. The argument filtering Pi contains the following mapping: foldA_in_gga(x1, x2, x3) = foldA_in_gga(x1, x2) a = a .(x1, x2) = .(x1, x2) b = b c = c FOLDA_IN_GGA(x1, x2, x3) = FOLDA_IN_GGA(x1, x2) U1_GGA(x1, x2, x3) = U1_GGA(x1, x3) We have to consider all (P,R,Pi)-chains ---------------------------------------- (5) DependencyGraphProof (EQUIVALENT) The approximation of the Dependency Graph [LOPSTR] contains 0 SCCs with 2 less nodes. ---------------------------------------- (6) TRUE