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


Left Termination of the query pattern

p(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 [EQUIVALENT, 0 ms]
(8) QDP
(9) QDPSizeChangeProof [EQUIVALENT, 0 ms]
(10) YES


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

(0)
Obligation:
Clauses:

p(X) :- ','(q(f(Y)), p(Y)).
p(g(X)) :- p(X).
q(g(Y)).


Query: p(g)
----------------------------------------

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

{
    "root": 3,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p X)",
                "(',' (q (f Y)) (p Y))"
            ],
            [
                "(p (g X))",
                "(p X)"
            ],
            [
                "(q (g Y))",
                null
            ]
        ]
    },
    "graph": {
        "nodes": {
            "56": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T6)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T6"],
                    "free": [],
                    "exprvars": []
                }
            },
            "3": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T1)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "58": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "6": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 1,
                        "term": "(p T1)"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T1)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "52": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T3)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "42": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(',' (q (f X3)) (p X3))"
                    },
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T3)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X3"],
                    "exprvars": []
                }
            },
            "53": {
                "goal": [{
                    "clause": 1,
                    "scope": 1,
                    "term": "(p T3)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "21": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(',' (q (f X3)) (p X3))"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p T3)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X3"],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 3,
                "to": 6,
                "label": "CASE"
            },
            {
                "from": 6,
                "to": 21,
                "label": "ONLY EVAL with clause\np(X2) :- ','(q(f(X3)), p(X3)).\nand substitutionT1 -> T3,\nX2 -> T3"
            },
            {
                "from": 21,
                "to": 42,
                "label": "CASE"
            },
            {
                "from": 42,
                "to": 52,
                "label": "BACKTRACK\nfor clause: q(g(Y))because of non-unification"
            },
            {
                "from": 52,
                "to": 53,
                "label": "FAILURE"
            },
            {
                "from": 53,
                "to": 56,
                "label": "EVAL with clause\np(g(X7)) :- p(X7).\nand substitutionX7 -> T6,\nT3 -> g(T6)"
            },
            {
                "from": 53,
                "to": 58,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 56,
                "to": 3,
                "label": "INSTANCE with matching:\nT1 -> T6"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

pA(g(X1)) :- pA(X1).

Clauses:

pcA(g(X1)) :- pcA(X1).

Afs:

pA(x1)  =  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_1: (b)

Transforming TRIPLES into the following Term Rewriting System:

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

   PA_IN_G(g(X1)) -> U1_G(X1, pA_in_g(X1))
   PA_IN_G(g(X1)) -> PA_IN_G(X1)

R is empty.
Pi is empty.
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_G(g(X1)) -> U1_G(X1, pA_in_g(X1))
   PA_IN_G(g(X1)) -> PA_IN_G(X1)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
----------------------------------------

(5) DependencyGraphProof (EQUIVALENT)
The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 1 less node.
----------------------------------------

(6)
Obligation:
Pi DP problem:
The TRS P consists of the following rules:

   PA_IN_G(g(X1)) -> PA_IN_G(X1)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
----------------------------------------

(7) PiDPToQDPProof (EQUIVALENT)
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:

   PA_IN_G(g(X1)) -> PA_IN_G(X1)

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:
*PA_IN_G(g(X1)) -> PA_IN_G(X1)
The graph contains the following edges 1 > 1


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

(10)
YES
