YES
proof of /hpcwork/ff862203/termcomp26/benchmarks/eoxaZ.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 [SOUND, 0 ms]
(8) QDP
(9) QDPSizeChangeProof [EQUIVALENT, 0 ms]
(10) YES


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

(0)
Obligation:
Clauses:

p(0).
p(s(X)) :- ','(geq(X, Y), p(Y)).
geq(X, X).
geq(s(X), Y) :- geq(X, Y).


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

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

{
    "root": 25,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p (0))",
                null
            ],
            [
                "(p (s X))",
                "(',' (geq X Y) (p Y))"
            ],
            [
                "(geq X X)",
                null
            ],
            [
                "(geq (s X) Y)",
                "(geq X Y)"
            ]
        ]
    },
    "graph": {
        "nodes": {
            "25": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T1)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "26": {
                "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": []
                }
            },
            "160": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (geq T11 X18) (p X18))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T11"],
                    "free": ["X18"],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "161": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "140": {
                "goal": [{
                    "clause": 1,
                    "scope": 1,
                    "term": "(p (0))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "141": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "152": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(',' (geq T3 X4) (p X4))"
                    },
                    {
                        "clause": 3,
                        "scope": 2,
                        "term": "(',' (geq T3 X4) (p X4))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X4"],
                    "exprvars": []
                }
            },
            "144": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (geq T3 X4) (p X4))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X4"],
                    "exprvars": []
                }
            },
            "155": {
                "goal": [{
                    "clause": 2,
                    "scope": 2,
                    "term": "(',' (geq T3 X4) (p X4))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X4"],
                    "exprvars": []
                }
            },
            "156": {
                "goal": [{
                    "clause": 3,
                    "scope": 2,
                    "term": "(',' (geq T3 X4) (p X4))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": ["X4"],
                    "exprvars": []
                }
            },
            "146": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "159": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(p T8)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T8"],
                    "free": [],
                    "exprvars": []
                }
            },
            "60": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(true)"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(p (0))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "61": {
                "goal": [{
                    "clause": 1,
                    "scope": 1,
                    "term": "(p T1)"
                }],
                "kb": {
                    "nonunifying": [[
                        "(p T1)",
                        "(p (0))"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 25,
                "to": 26,
                "label": "CASE"
            },
            {
                "from": 26,
                "to": 60,
                "label": "EVAL with clause\np(0).\nand substitutionT1 -> 0"
            },
            {
                "from": 26,
                "to": 61,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 60,
                "to": 140,
                "label": "SUCCESS"
            },
            {
                "from": 61,
                "to": 144,
                "label": "EVAL with clause\np(s(X3)) :- ','(geq(X3, X4), p(X4)).\nand substitutionX3 -> T3,\nT1 -> s(T3)"
            },
            {
                "from": 61,
                "to": 146,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 140,
                "to": 141,
                "label": "BACKTRACK\nfor clause: p(s(X)) :- ','(geq(X, Y), p(Y))because of non-unification"
            },
            {
                "from": 144,
                "to": 152,
                "label": "CASE"
            },
            {
                "from": 152,
                "to": 155,
                "label": "PARALLEL"
            },
            {
                "from": 152,
                "to": 156,
                "label": "PARALLEL"
            },
            {
                "from": 155,
                "to": 159,
                "label": "ONLY EVAL with clause\ngeq(X9, X9).\nand substitutionT3 -> T8,\nX9 -> T8,\nX4 -> T8"
            },
            {
                "from": 156,
                "to": 160,
                "label": "EVAL with clause\ngeq(s(X16), X17) :- geq(X16, X17).\nand substitutionX16 -> T11,\nT3 -> s(T11),\nX4 -> X18,\nX17 -> X18"
            },
            {
                "from": 156,
                "to": 161,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 159,
                "to": 25,
                "label": "INSTANCE with matching:\nT1 -> T8"
            },
            {
                "from": 160,
                "to": 144,
                "label": "INSTANCE with matching:\nT3 -> T11\nX4 -> X18"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

pB(X1, X1) :- pA(X1).
pB(s(X1), X2) :- pB(X1, X2).
pA(s(X1)) :- pB(X1, X2).

Clauses:

pcA(0).
pcA(s(X1)) :- qcB(X1, X2).
qcB(X1, X1) :- pcA(X1).
qcB(s(X1), X2) :- qcB(X1, X2).

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)

pB_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_G(s(X1)) -> U3_G(X1, pB_in_ga(X1, X2))
   PA_IN_G(s(X1)) -> PB_IN_GA(X1, X2)
   PB_IN_GA(X1, X1) -> U1_GA(X1, pA_in_g(X1))
   PB_IN_GA(X1, X1) -> PA_IN_G(X1)
   PB_IN_GA(s(X1), X2) -> U2_GA(X1, X2, pB_in_ga(X1, X2))
   PB_IN_GA(s(X1), X2) -> PB_IN_GA(X1, X2)

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

s(x1)  =  s(x1)

pB_in_ga(x1, x2)  =  pB_in_ga(x1)

PA_IN_G(x1)  =  PA_IN_G(x1)

U3_G(x1, x2)  =  U3_G(x1, x2)

PB_IN_GA(x1, x2)  =  PB_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x1, x2)

U2_GA(x1, x2, x3)  =  U2_GA(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:

   PA_IN_G(s(X1)) -> U3_G(X1, pB_in_ga(X1, X2))
   PA_IN_G(s(X1)) -> PB_IN_GA(X1, X2)
   PB_IN_GA(X1, X1) -> U1_GA(X1, pA_in_g(X1))
   PB_IN_GA(X1, X1) -> PA_IN_G(X1)
   PB_IN_GA(s(X1), X2) -> U2_GA(X1, X2, pB_in_ga(X1, X2))
   PB_IN_GA(s(X1), X2) -> PB_IN_GA(X1, X2)

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

s(x1)  =  s(x1)

pB_in_ga(x1, x2)  =  pB_in_ga(x1)

PA_IN_G(x1)  =  PA_IN_G(x1)

U3_G(x1, x2)  =  U3_G(x1, x2)

PB_IN_GA(x1, x2)  =  PB_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x1, x2)

U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)


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

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

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

   PA_IN_G(s(X1)) -> PB_IN_GA(X1, X2)
   PB_IN_GA(X1, X1) -> PA_IN_G(X1)
   PB_IN_GA(s(X1), X2) -> PB_IN_GA(X1, X2)

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

PA_IN_G(x1)  =  PA_IN_G(x1)

PB_IN_GA(x1, x2)  =  PB_IN_GA(x1)


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

(7) PiDPToQDPProof (SOUND)
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(s(X1)) -> PB_IN_GA(X1)
   PB_IN_GA(X1) -> PA_IN_G(X1)
   PB_IN_GA(s(X1)) -> PB_IN_GA(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:
*PB_IN_GA(X1) -> PA_IN_G(X1)
The graph contains the following edges 1 >= 1


*PB_IN_GA(s(X1)) -> PB_IN_GA(X1)
The graph contains the following edges 1 > 1


*PA_IN_G(s(X1)) -> PB_IN_GA(X1)
The graph contains the following edges 1 > 1


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

(10)
YES
