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


Left Termination of the query pattern

p(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) TRUE


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

(0)
Obligation:
Clauses:

p(X, Z) :- ','(q(X, Y), p(Y, Z)).
p(X, X).
q(a, b).


Query: p(g,a)
----------------------------------------

(1) PrologToDTProblemTransformerProof (SOUND)
Built DT problem from termination graph DT10.

{
    "root": 109,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p X Z)",
                "(',' (q X Y) (p Y Z))"
            ],
            [
                "(p X X)",
                null
            ],
            [
                "(q (a) (b))",
                null
            ]
        ]
    },
    "graph": {
        "nodes": {
            "type": "Nodes",
            "120": {
                "goal": [{
                    "clause": 1,
                    "scope": 1,
                    "term": "(p T5 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T5"],
                    "free": [],
                    "exprvars": []
                }
            },
            "110": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 1,
                        "term": "(p T1 T2)"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T1 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "113": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(',' (q T5 X5) (p X5 T7))"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T5 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T5"],
                    "free": ["X5"],
                    "exprvars": []
                }
            },
            "124": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(true)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "114": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(',' (q T5 X5) (p X5 T7))"
                    },
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T5 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T5"],
                    "free": ["X5"],
                    "exprvars": []
                }
            },
            "125": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "115": {
                "goal": [{
                    "clause": 2,
                    "scope": 2,
                    "term": "(',' (q T5 X5) (p X5 T7))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T5"],
                    "free": ["X5"],
                    "exprvars": []
                }
            },
            "126": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "116": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T5 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T5"],
                    "free": [],
                    "exprvars": []
                }
            },
            "117": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p (b) T7)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "118": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "109": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T1 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 109,
                "to": 110,
                "label": "CASE"
            },
            {
                "from": 110,
                "to": 113,
                "label": "ONLY EVAL with clause\np(X3, X4) :- ','(q(X3, X5), p(X5, X4)).\nand substitutionT1 -> T5,\nX3 -> T5,\nT2 -> T7,\nX4 -> T7,\nT6 -> T7"
            },
            {
                "from": 113,
                "to": 114,
                "label": "CASE"
            },
            {
                "from": 114,
                "to": 115,
                "label": "PARALLEL"
            },
            {
                "from": 114,
                "to": 116,
                "label": "PARALLEL"
            },
            {
                "from": 115,
                "to": 117,
                "label": "EVAL with clause\nq(a, b).\nand substitutionT5 -> a,\nX5 -> b"
            },
            {
                "from": 115,
                "to": 118,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 116,
                "to": 120,
                "label": "FAILURE"
            },
            {
                "from": 117,
                "to": 109,
                "label": "INSTANCE with matching:\nT1 -> b\nT2 -> T7"
            },
            {
                "from": 120,
                "to": 124,
                "label": "EVAL with clause\np(X11, X11).\nand substitutionT5 -> T11,\nX11 -> T11,\nT2 -> T11"
            },
            {
                "from": 120,
                "to": 125,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 124,
                "to": 126,
                "label": "SUCCESS"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

pA(a, X1) :- pA(b, X1).

Clauses:

pcA(a, X1) :- pcA(b, X1).
pcA(X1, X1).

Afs:

pA(x1, x2)  =  pA(x1)


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

(3) TriplesToPiDPProof (SOUND)
We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:

pA_in_2: (b,f)

Transforming TRIPLES into the following Term Rewriting System:

Pi DP problem:
The TRS P consists of the following rules:

   PA_IN_GA(a, X1) -> U1_GA(X1, pA_in_ga(b, X1))
   PA_IN_GA(a, X1) -> PA_IN_GA(b, X1)

R is empty.
The argument filtering Pi contains the following mapping:
pA_in_ga(x1, x2)  =  pA_in_ga(x1)

a  =  a

b  =  b

PA_IN_GA(x1, x2)  =  PA_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x2)


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:

   PA_IN_GA(a, X1) -> U1_GA(X1, pA_in_ga(b, X1))
   PA_IN_GA(a, X1) -> PA_IN_GA(b, X1)

R is empty.
The argument filtering Pi contains the following mapping:
pA_in_ga(x1, x2)  =  pA_in_ga(x1)

a  =  a

b  =  b

PA_IN_GA(x1, x2)  =  PA_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x2)


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
