YES proof of /export/starexec/sandbox/benchmark/theBenchmark.pl # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty Left Termination of the query pattern flat(g,a) w.r.t. the given Prolog program could successfully be proven: (0) Prolog (1) PrologToTRSTransformerProof [SOUND, 0 ms] (2) QTRS (3) QTRSRRRProof [EQUIVALENT, 97 ms] (4) QTRS (5) RisEmptyProof [EQUIVALENT, 0 ms] (6) YES ---------------------------------------- (0) Obligation: Clauses: flat([], []). flat(.([], T), R) :- flat(T, R). flat(.(.(H, T), TT), .(H, R)) :- flat(.(T, TT), R). Query: flat(g,a) ---------------------------------------- (1) PrologToTRSTransformerProof (SOUND) Transformed Prolog program to TRS. { "root": 1, "program": { "directives": [], "clauses": [ [ "(flat ([]) ([]))", null ], [ "(flat (. ([]) T) R)", "(flat T R)" ], [ "(flat (. (. H T) TT) (. H R))", "(flat (. T TT) R)" ] ] }, "graph": { "nodes": { "77": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "23": { "goal": [{ "clause": 1, "scope": 1, "term": "(flat T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "26": { "goal": [{ "clause": 2, "scope": 1, "term": "(flat T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "17": { "goal": [{ "clause": -1, "scope": -1, "term": "(true)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "28": { "goal": [{ "clause": -1, "scope": -1, "term": "(flat T11 T13)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T11"], "free": [], "exprvars": [] } }, "type": "Nodes", "1": { "goal": [{ "clause": -1, "scope": -1, "term": "(flat T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "5": { "goal": [ { "clause": 0, "scope": 1, "term": "(flat T1 T2)" }, { "clause": 1, "scope": 1, "term": "(flat T1 T2)" }, { "clause": 2, "scope": 1, "term": "(flat T1 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "8": { "goal": [{ "clause": 0, "scope": 1, "term": "(flat T1 T2)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "9": { "goal": [ { "clause": 1, "scope": 1, "term": "(flat T1 T2)" }, { "clause": 2, "scope": 1, "term": "(flat T1 T2)" } ], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": ["T1"], "free": [], "exprvars": [] } }, "30": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "20": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "21": { "goal": [], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [], "free": [], "exprvars": [] } }, "76": { "goal": [{ "clause": -1, "scope": -1, "term": "(flat (. T23 T24) T26)" }], "kb": { "nonunifying": [], "intvars": {}, "arithmetic": { "type": "PlainIntegerRelationState", "relations": [] }, "ground": [ "T23", "T24" ], "free": [], "exprvars": [] } } }, "edges": [ { "from": 1, "to": 5, "label": "CASE" }, { "from": 5, "to": 8, "label": "PARALLEL" }, { "from": 5, "to": 9, "label": "PARALLEL" }, { "from": 8, "to": 17, "label": "EVAL with clause\nflat([], []).\nand substitutionT1 -> [],\nT2 -> []" }, { "from": 8, "to": 20, "label": "EVAL-BACKTRACK" }, { "from": 9, "to": 23, "label": "PARALLEL" }, { "from": 9, "to": 26, "label": "PARALLEL" }, { "from": 17, "to": 21, "label": "SUCCESS" }, { "from": 23, "to": 28, "label": "EVAL with clause\nflat(.([], X9), X10) :- flat(X9, X10).\nand substitutionX9 -> T11,\nT1 -> .([], T11),\nT2 -> T13,\nX10 -> T13,\nT12 -> T13" }, { "from": 23, "to": 30, "label": "EVAL-BACKTRACK" }, { "from": 26, "to": 76, "label": "EVAL with clause\nflat(.(.(X19, X20), X21), .(X19, X22)) :- flat(.(X20, X21), X22).\nand substitutionX19 -> T22,\nX20 -> T23,\nX21 -> T24,\nT1 -> .(.(T22, T23), T24),\nX22 -> T26,\nT2 -> .(T22, T26),\nT25 -> T26" }, { "from": 26, "to": 77, "label": "EVAL-BACKTRACK" }, { "from": 28, "to": 1, "label": "INSTANCE with matching:\nT1 -> T11\nT2 -> T13" }, { "from": 76, "to": 1, "label": "INSTANCE with matching:\nT1 -> .(T23, T24)\nT2 -> T26" } ], "type": "Graph" } } ---------------------------------------- (2) Obligation: Q restricted rewrite system: The TRS R consists of the following rules: f1_in([]) -> f1_out1([]) f1_in(.([], T11)) -> U1(f1_in(T11), .([], T11)) U1(f1_out1(T13), .([], T11)) -> f1_out1(T13) f1_in(.(.(T22, T23), T24)) -> U2(f1_in(.(T23, T24)), .(.(T22, T23), T24)) U2(f1_out1(T26), .(.(T22, T23), T24)) -> f1_out1(.(T22, T26)) Q is empty. ---------------------------------------- (3) QTRSRRRProof (EQUIVALENT) Used ordering: f1_in/1(YES) []/0) f1_out1/1)YES( ./2(YES,YES) U1/2(YES,YES) U2/2(YES,YES) Quasi precedence: [f1_in_1, []] > [._2, U2_2] > U1_2 Status: f1_in_1: [1] []: multiset status ._2: multiset status U1_2: multiset status U2_2: multiset status With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly: f1_in([]) -> f1_out1([]) f1_in(.([], T11)) -> U1(f1_in(T11), .([], T11)) U1(f1_out1(T13), .([], T11)) -> f1_out1(T13) f1_in(.(.(T22, T23), T24)) -> U2(f1_in(.(T23, T24)), .(.(T22, T23), T24)) U2(f1_out1(T26), .(.(T22, T23), T24)) -> f1_out1(.(T22, T26)) ---------------------------------------- (4) Obligation: Q restricted rewrite system: R is empty. Q is empty. ---------------------------------------- (5) RisEmptyProof (EQUIVALENT) The TRS R is empty. Hence, termination is trivially proven. ---------------------------------------- (6) YES