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


Left Termination of the query pattern

even(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:

even(0).
even(s(s(0))).
even(s(s(s(X)))) :- odd(X).
odd(s(0)).
odd(s(X)) :- even(s(s(X))).


Query: even(g)
----------------------------------------

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

{
    "root": 1,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(even (0))",
                null
            ],
            [
                "(even (s (s (0))))",
                null
            ],
            [
                "(even (s (s (s X))))",
                "(odd X)"
            ],
            [
                "(odd (s (0)))",
                null
            ],
            [
                "(odd (s X))",
                "(even (s (s X)))"
            ]
        ]
    },
    "graph": {
        "nodes": {
            "type": "Nodes",
            "140": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "130": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "131": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(odd T3)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "132": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "1": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(even T1)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "133": {
                "goal": [
                    {
                        "clause": 3,
                        "scope": 2,
                        "term": "(odd T3)"
                    },
                    {
                        "clause": 4,
                        "scope": 2,
                        "term": "(odd T3)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "123": {
                "goal": [
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(even T1)"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(even T1)"
                    }
                ],
                "kb": {
                    "nonunifying": [[
                        "(even T1)",
                        "(even (0))"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "134": {
                "goal": [{
                    "clause": 3,
                    "scope": 2,
                    "term": "(odd T3)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "124": {
                "goal": [
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(even (0))"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(even (0))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "135": {
                "goal": [{
                    "clause": 4,
                    "scope": 2,
                    "term": "(odd T3)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T3"],
                    "free": [],
                    "exprvars": []
                }
            },
            "125": {
                "goal": [{
                    "clause": 2,
                    "scope": 1,
                    "term": "(even (0))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "136": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(true)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "126": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "137": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "127": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(true)"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(even (s (s (0))))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "138": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "128": {
                "goal": [{
                    "clause": 2,
                    "scope": 1,
                    "term": "(even T1)"
                }],
                "kb": {
                    "nonunifying": [
                        [
                            "(even T1)",
                            "(even (0))"
                        ],
                        [
                            "(even T1)",
                            "(even (s (s (0))))"
                        ]
                    ],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "139": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(even (s (s T6)))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T6"],
                    "free": [],
                    "exprvars": []
                }
            },
            "8": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 1,
                        "term": "(even T1)"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(even T1)"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(even T1)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "129": {
                "goal": [{
                    "clause": 2,
                    "scope": 1,
                    "term": "(even (s (s (0))))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "32": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(true)"
                    },
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(even (0))"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(even (0))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 1,
                "to": 8,
                "label": "CASE"
            },
            {
                "from": 8,
                "to": 32,
                "label": "EVAL with clause\neven(0).\nand substitutionT1 -> 0"
            },
            {
                "from": 8,
                "to": 123,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 32,
                "to": 124,
                "label": "SUCCESS"
            },
            {
                "from": 123,
                "to": 127,
                "label": "EVAL with clause\neven(s(s(0))).\nand substitutionT1 -> s(s(0))"
            },
            {
                "from": 123,
                "to": 128,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 124,
                "to": 125,
                "label": "BACKTRACK\nfor clause: even(s(s(0)))because of non-unification"
            },
            {
                "from": 125,
                "to": 126,
                "label": "BACKTRACK\nfor clause: even(s(s(s(X)))) :- odd(X)because of non-unification"
            },
            {
                "from": 127,
                "to": 129,
                "label": "SUCCESS"
            },
            {
                "from": 128,
                "to": 131,
                "label": "EVAL with clause\neven(s(s(s(X4)))) :- odd(X4).\nand substitutionX4 -> T3,\nT1 -> s(s(s(T3)))"
            },
            {
                "from": 128,
                "to": 132,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 129,
                "to": 130,
                "label": "BACKTRACK\nfor clause: even(s(s(s(X)))) :- odd(X)because of non-unification"
            },
            {
                "from": 131,
                "to": 133,
                "label": "CASE"
            },
            {
                "from": 133,
                "to": 134,
                "label": "PARALLEL"
            },
            {
                "from": 133,
                "to": 135,
                "label": "PARALLEL"
            },
            {
                "from": 134,
                "to": 136,
                "label": "EVAL with clause\nodd(s(0)).\nand substitutionT3 -> s(0)"
            },
            {
                "from": 134,
                "to": 137,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 135,
                "to": 139,
                "label": "EVAL with clause\nodd(s(X7)) :- even(s(s(X7))).\nand substitutionX7 -> T6,\nT3 -> s(T6)"
            },
            {
                "from": 135,
                "to": 140,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 136,
                "to": 138,
                "label": "SUCCESS"
            },
            {
                "from": 139,
                "to": 1,
                "label": "INSTANCE with matching:\nT1 -> s(s(T6))"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

evenA(s(s(s(s(X1))))) :- evenA(s(s(X1))).

Clauses:

evencA(0).
evencA(s(s(0))).
evencA(s(s(s(s(0))))).
evencA(s(s(s(s(X1))))) :- evencA(s(s(X1))).

Afs:

evenA(x1)  =  evenA(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:

evenA_in_1: (b)

Transforming TRIPLES into the following Term Rewriting System:

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

   EVENA_IN_G(s(s(s(s(X1))))) -> U1_G(X1, evenA_in_g(s(s(X1))))
   EVENA_IN_G(s(s(s(s(X1))))) -> EVENA_IN_G(s(s(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:

   EVENA_IN_G(s(s(s(s(X1))))) -> U1_G(X1, evenA_in_g(s(s(X1))))
   EVENA_IN_G(s(s(s(s(X1))))) -> EVENA_IN_G(s(s(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:

   EVENA_IN_G(s(s(s(s(X1))))) -> EVENA_IN_G(s(s(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:

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


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

(10)
YES
