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


Left Termination of the query pattern

tc(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(a, b).
p(b, c).
tc(X, X).
tc(X, Y) :- ','(p(X, Z), tc(Z, Y)).


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

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

{
    "root": 3,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p (a) (b))",
                null
            ],
            [
                "(p (b) (c))",
                null
            ],
            [
                "(tc X X)",
                null
            ],
            [
                "(tc X Y)",
                "(',' (p X Z) (tc Z Y))"
            ]
        ]
    },
    "graph": {
        "nodes": {
            "17": {
                "goal": [
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(tc T1 T2)"
                    },
                    {
                        "clause": 3,
                        "scope": 1,
                        "term": "(tc T1 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "150": {
                "goal": [{
                    "clause": 0,
                    "scope": 3,
                    "term": "(',' (p T12 X16) (tc X16 T14))"
                }],
                "kb": {
                    "nonunifying": [[
                        "(tc T12 T2)",
                        "(tc X2 X2)"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T12"],
                    "free": [
                        "X2",
                        "X16"
                    ],
                    "exprvars": []
                }
            },
            "151": {
                "goal": [{
                    "clause": 1,
                    "scope": 3,
                    "term": "(',' (p T12 X16) (tc X16 T14))"
                }],
                "kb": {
                    "nonunifying": [[
                        "(tc T12 T2)",
                        "(tc X2 X2)"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T12"],
                    "free": [
                        "X2",
                        "X16"
                    ],
                    "exprvars": []
                }
            },
            "141": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "152": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(tc (b) T14)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "120": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 2,
                        "term": "(',' (p T7 X7) (tc X7 T9))"
                    },
                    {
                        "clause": 1,
                        "scope": 2,
                        "term": "(',' (p T7 X7) (tc X7 T9))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T7"],
                    "free": ["X7"],
                    "exprvars": []
                }
            },
            "153": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "121": {
                "goal": [{
                    "clause": 0,
                    "scope": 2,
                    "term": "(',' (p T7 X7) (tc X7 T9))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T7"],
                    "free": ["X7"],
                    "exprvars": []
                }
            },
            "154": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(tc (c) T14)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "155": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "123": {
                "goal": [{
                    "clause": 1,
                    "scope": 2,
                    "term": "(',' (p T7 X7) (tc X7 T9))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T7"],
                    "free": ["X7"],
                    "exprvars": []
                }
            },
            "3": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(tc T1 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "126": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(tc (b) T9)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "148": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (p T12 X16) (tc X16 T14))"
                }],
                "kb": {
                    "nonunifying": [[
                        "(tc T12 T2)",
                        "(tc X2 X2)"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T12"],
                    "free": [
                        "X2",
                        "X16"
                    ],
                    "exprvars": []
                }
            },
            "116": {
                "goal": [{
                    "clause": 3,
                    "scope": 1,
                    "term": "(tc T4 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T4"],
                    "free": [],
                    "exprvars": []
                }
            },
            "127": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "149": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 3,
                        "term": "(',' (p T12 X16) (tc X16 T14))"
                    },
                    {
                        "clause": 1,
                        "scope": 3,
                        "term": "(',' (p T12 X16) (tc X16 T14))"
                    }
                ],
                "kb": {
                    "nonunifying": [[
                        "(tc T12 T2)",
                        "(tc X2 X2)"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T12"],
                    "free": [
                        "X2",
                        "X16"
                    ],
                    "exprvars": []
                }
            },
            "139": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(tc (c) T9)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "119": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (p T7 X7) (tc X7 T9))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T7"],
                    "free": ["X7"],
                    "exprvars": []
                }
            },
            "96": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(true)"
                    },
                    {
                        "clause": 3,
                        "scope": 1,
                        "term": "(tc T4 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T4"],
                    "free": [],
                    "exprvars": []
                }
            },
            "98": {
                "goal": [{
                    "clause": 3,
                    "scope": 1,
                    "term": "(tc T1 T2)"
                }],
                "kb": {
                    "nonunifying": [[
                        "(tc T1 T2)",
                        "(tc X2 X2)"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": ["X2"],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 3,
                "to": 17,
                "label": "CASE"
            },
            {
                "from": 17,
                "to": 96,
                "label": "EVAL with clause\ntc(X2, X2).\nand substitutionT1 -> T4,\nX2 -> T4,\nT2 -> T4"
            },
            {
                "from": 17,
                "to": 98,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 96,
                "to": 116,
                "label": "SUCCESS"
            },
            {
                "from": 98,
                "to": 148,
                "label": "ONLY EVAL with clause\ntc(X14, X15) :- ','(p(X14, X16), tc(X16, X15)).\nand substitutionT1 -> T12,\nX14 -> T12,\nT2 -> T14,\nX15 -> T14,\nT13 -> T14"
            },
            {
                "from": 116,
                "to": 119,
                "label": "ONLY EVAL with clause\ntc(X5, X6) :- ','(p(X5, X7), tc(X7, X6)).\nand substitutionT4 -> T7,\nX5 -> T7,\nT2 -> T9,\nX6 -> T9,\nT8 -> T9"
            },
            {
                "from": 119,
                "to": 120,
                "label": "CASE"
            },
            {
                "from": 120,
                "to": 121,
                "label": "PARALLEL"
            },
            {
                "from": 120,
                "to": 123,
                "label": "PARALLEL"
            },
            {
                "from": 121,
                "to": 126,
                "label": "EVAL with clause\np(a, b).\nand substitutionT7 -> a,\nX7 -> b"
            },
            {
                "from": 121,
                "to": 127,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 123,
                "to": 139,
                "label": "EVAL with clause\np(b, c).\nand substitutionT7 -> b,\nX7 -> c"
            },
            {
                "from": 123,
                "to": 141,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 126,
                "to": 3,
                "label": "INSTANCE with matching:\nT1 -> b\nT2 -> T9"
            },
            {
                "from": 139,
                "to": 3,
                "label": "INSTANCE with matching:\nT1 -> c\nT2 -> T9"
            },
            {
                "from": 148,
                "to": 149,
                "label": "CASE"
            },
            {
                "from": 149,
                "to": 150,
                "label": "PARALLEL"
            },
            {
                "from": 149,
                "to": 151,
                "label": "PARALLEL"
            },
            {
                "from": 150,
                "to": 152,
                "label": "EVAL with clause\np(a, b).\nand substitutionT12 -> a,\nX16 -> b"
            },
            {
                "from": 150,
                "to": 153,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 151,
                "to": 154,
                "label": "EVAL with clause\np(b, c).\nand substitutionT12 -> b,\nX16 -> c"
            },
            {
                "from": 151,
                "to": 155,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 152,
                "to": 3,
                "label": "INSTANCE with matching:\nT1 -> b\nT2 -> T14"
            },
            {
                "from": 154,
                "to": 3,
                "label": "INSTANCE with matching:\nT1 -> c\nT2 -> T14"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

tcA(a, X1) :- tcA(b, X1).
tcA(b, X1) :- tcA(c, X1).
tcA(a, X1) :- tcA(b, X1).
tcA(b, X1) :- tcA(c, X1).

Clauses:

tccA(X1, X1).
tccA(a, X1) :- tccA(b, X1).
tccA(b, X1) :- tccA(c, X1).
tccA(a, X1) :- tccA(b, X1).
tccA(b, X1) :- tccA(c, X1).

Afs:

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

tcA_in_2: (b,f)

Transforming TRIPLES into the following Term Rewriting System:

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

   TCA_IN_GA(a, X1) -> U1_GA(X1, tcA_in_ga(b, X1))
   TCA_IN_GA(a, X1) -> TCA_IN_GA(b, X1)
   TCA_IN_GA(b, X1) -> U2_GA(X1, tcA_in_ga(c, X1))
   TCA_IN_GA(b, X1) -> TCA_IN_GA(c, X1)

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

a  =  a

b  =  b

c  =  c

TCA_IN_GA(x1, x2)  =  TCA_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x2)

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

   TCA_IN_GA(a, X1) -> U1_GA(X1, tcA_in_ga(b, X1))
   TCA_IN_GA(a, X1) -> TCA_IN_GA(b, X1)
   TCA_IN_GA(b, X1) -> U2_GA(X1, tcA_in_ga(c, X1))
   TCA_IN_GA(b, X1) -> TCA_IN_GA(c, X1)

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

a  =  a

b  =  b

c  =  c

TCA_IN_GA(x1, x2)  =  TCA_IN_GA(x1)

U1_GA(x1, x2)  =  U1_GA(x2)

U2_GA(x1, x2)  =  U2_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 4 less nodes.
----------------------------------------

(6)
TRUE
