YES
proof of /hpcwork/ff862203/termcomp26/benchmarks/zzwIk.pl
# AProVE Commit ID: 23a904c96b029b0a549cde0d0d17dbccf967db59 jckassing 20260626 unpublished dirty


Left Termination of the query pattern

p(a)

w.r.t. the given Prolog program could successfully be proven:

(0) Prolog
(1) PrologToIRSwTTransformerProof [SOUND, 0 ms]
(2) TRUE


----------------------------------------

(0)
Obligation:
Clauses:

p(.(A, [])) :- l(.(A, [])).
r(1).
l([]).
l(.(H, T)) :- ','(r(H), l(T)).


Query: p(a)
----------------------------------------

(1) PrologToIRSwTTransformerProof (SOUND)
Transformed Prolog program to IRSwT according to method in Master Thesis of A. Weinert

{
    "root": 8,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p (. A ([])))",
                "(l (. A ([])))"
            ],
            [
                "(r (1))",
                null
            ],
            [
                "(l ([]))",
                null
            ],
            [
                "(l (. H T))",
                "(',' (r H) (l T))"
            ]
        ]
    },
    "graph": {
        "nodes": {
            "11": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "12": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(l (. T5 ([])))"
                    },
                    {
                        "clause": 3,
                        "scope": 2,
                        "term": "(l (. T5 ([])))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "13": {
                "goal": [{
                    "clause": 3,
                    "scope": 2,
                    "term": "(l (. T5 ([])))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "14": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (r T10) (l ([])))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "110": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "90": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "8": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T1)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "9": {
                "goal": [{
                    "clause": 0,
                    "scope": 1,
                    "term": "(p T1)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "61": {
                "goal": [{
                    "clause": 1,
                    "scope": 3,
                    "term": "(',' (r T10) (l ([])))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "63": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(l ([]))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "74": {
                "goal": [{
                    "clause": 2,
                    "scope": 4,
                    "term": "(l ([]))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "85": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(true)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "64": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "75": {
                "goal": [{
                    "clause": 3,
                    "scope": 4,
                    "term": "(l ([]))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "10": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(l (. T5 ([])))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "65": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 4,
                        "term": "(l ([]))"
                    },
                    {
                        "clause": 3,
                        "scope": 4,
                        "term": "(l ([]))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 8,
                "to": 9,
                "label": "CASE"
            },
            {
                "from": 9,
                "to": 10,
                "label": "EVAL with clause\np(.(X3, [])) :- l(.(X3, [])).\nand substitutionX3 -> T5,\nT1 -> .(T5, []),\nT4 -> T5"
            },
            {
                "from": 9,
                "to": 11,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 10,
                "to": 12,
                "label": "CASE"
            },
            {
                "from": 12,
                "to": 13,
                "label": "BACKTRACK\nfor clause: l([])because of non-unification"
            },
            {
                "from": 13,
                "to": 14,
                "label": "ONLY EVAL with clause\nl(.(X8, X9)) :- ','(r(X8), l(X9)).\nand substitutionT5 -> T10,\nX8 -> T10,\nX9 -> [],\nT9 -> T10"
            },
            {
                "from": 14,
                "to": 61,
                "label": "CASE"
            },
            {
                "from": 61,
                "to": 63,
                "label": "EVAL with clause\nr(1).\nand substitutionT10 -> 1"
            },
            {
                "from": 61,
                "to": 64,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 63,
                "to": 65,
                "label": "CASE"
            },
            {
                "from": 65,
                "to": 74,
                "label": "PARALLEL"
            },
            {
                "from": 65,
                "to": 75,
                "label": "PARALLEL"
            },
            {
                "from": 74,
                "to": 85,
                "label": "ONLY EVAL with clause\nl([]).\nand substitution"
            },
            {
                "from": 75,
                "to": 110,
                "label": "BACKTRACK\nfor clause: l(.(H, T)) :- ','(r(H), l(T))because of non-unification"
            },
            {
                "from": 85,
                "to": 90,
                "label": "SUCCESS"
            }
        ],
        "type": "Graph"
    }
}

----------------------------------------

(2)
TRUE
