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


Left Termination of the query pattern

samefringe(g,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) AND
    (7) PiDP
        (8) UsableRulesProof [EQUIVALENT, 0 ms]
        (9) PiDP
        (10) PiDPToQDPProof [SOUND, 0 ms]
        (11) QDP
        (12) QDPSizeChangeProof [EQUIVALENT, 0 ms]
        (13) YES
    (14) PiDP
        (15) PiDPToQDPProof [SOUND, 0 ms]
        (16) QDP
        (17) QDPQMonotonicMRRProof [EQUIVALENT, 9 ms]
        (18) QDP
        (19) DependencyGraphProof [EQUIVALENT, 0 ms]
        (20) QDP
        (21) UsableRulesProof [EQUIVALENT, 0 ms]
        (22) QDP
        (23) QReductionProof [EQUIVALENT, 0 ms]
        (24) QDP
        (25) QDPSizeChangeProof [EQUIVALENT, 0 ms]
        (26) YES


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

(0)
Obligation:
Clauses:

gopher(nil, nil).
gopher(cons(nil, Y), cons(nil, Y)).
gopher(cons(cons(U, V), W), X) :- gopher(cons(U, cons(V, W)), X).
samefringe(nil, nil).
samefringe(cons(U, V), cons(X, Y)) :- ','(gopher(cons(U, V), cons(U1, V1)), ','(gopher(cons(X, Y), cons(X1, Y1)), samefringe(V1, Y1))).


Query: samefringe(g,g)
----------------------------------------

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

{
    "root": 16,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(gopher (nil) (nil))",
                null
            ],
            [
                "(gopher (cons (nil) Y) (cons (nil) Y))",
                null
            ],
            [
                "(gopher (cons (cons U V) W) X)",
                "(gopher (cons U (cons V W)) X)"
            ],
            [
                "(samefringe (nil) (nil))",
                null
            ],
            [
                "(samefringe (cons U V) (cons X Y))",
                "(',' (gopher (cons U V) (cons U1 V1)) (',' (gopher (cons X Y) (cons X1 Y1)) (samefringe V1 Y1)))"
            ]
        ]
    },
    "graph": {
        "nodes": {
            "22": {
                "goal": [{
                    "clause": 4,
                    "scope": 1,
                    "term": "(samefringe T1 T2)"
                }],
                "kb": {
                    "nonunifying": [[
                        "(samefringe T1 T2)",
                        "(samefringe (nil) (nil))"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T1",
                        "T2"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "44": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe T15 X17))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10",
                        "T15"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "23": {
                "goal": [{
                    "clause": 4,
                    "scope": 1,
                    "term": "(samefringe (nil) (nil))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "45": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "24": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "46": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(gopher (cons T9 T10) (cons X16 X17))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "47": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(samefringe T15 T17)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T15",
                        "T17"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "48": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 3,
                        "term": "(gopher (cons T9 T10) (cons X16 X17))"
                    },
                    {
                        "clause": 1,
                        "scope": 3,
                        "term": "(gopher (cons T9 T10) (cons X16 X17))"
                    },
                    {
                        "clause": 2,
                        "scope": 3,
                        "term": "(gopher (cons T9 T10) (cons X16 X17))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "173": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (gopher (cons T38 (cons T39 T40)) (cons X62 X63)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X63 X17)))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10",
                        "T38",
                        "T39",
                        "T40"
                    ],
                    "free": [
                        "X16",
                        "X17",
                        "X62",
                        "X63"
                    ],
                    "exprvars": []
                }
            },
            "174": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "35": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8",
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X14",
                        "X15",
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "36": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "58": {
                "goal": [
                    {
                        "clause": 1,
                        "scope": 3,
                        "term": "(gopher (cons T9 T10) (cons X16 X17))"
                    },
                    {
                        "clause": 2,
                        "scope": 3,
                        "term": "(gopher (cons T9 T10) (cons X16 X17))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "37": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 2,
                        "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                    },
                    {
                        "clause": 1,
                        "scope": 2,
                        "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                    },
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8",
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X14",
                        "X15",
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "59": {
                "goal": [{
                    "clause": 1,
                    "scope": 3,
                    "term": "(gopher (cons T9 T10) (cons X16 X17))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "16": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(samefringe T1 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T1",
                        "T2"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "38": {
                "goal": [
                    {
                        "clause": 1,
                        "scope": 2,
                        "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                    },
                    {
                        "clause": 2,
                        "scope": 2,
                        "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8",
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X14",
                        "X15",
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "60": {
                "goal": [{
                    "clause": 2,
                    "scope": 3,
                    "term": "(gopher (cons T9 T10) (cons X16 X17))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "61": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(true)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "62": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "63": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "20": {
                "goal": [
                    {
                        "clause": 3,
                        "scope": 1,
                        "term": "(samefringe T1 T2)"
                    },
                    {
                        "clause": 4,
                        "scope": 1,
                        "term": "(samefringe T1 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T1",
                        "T2"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "42": {
                "goal": [{
                    "clause": 1,
                    "scope": 2,
                    "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8",
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X14",
                        "X15",
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "64": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(gopher (cons T29 (cons T30 T31)) (cons X44 X45))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T29",
                        "T30",
                        "T31"
                    ],
                    "free": [
                        "X44",
                        "X45"
                    ],
                    "exprvars": []
                }
            },
            "21": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(true)"
                    },
                    {
                        "clause": 4,
                        "scope": 1,
                        "term": "(samefringe (nil) (nil))"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "43": {
                "goal": [{
                    "clause": 2,
                    "scope": 2,
                    "term": "(',' (gopher (cons T7 T8) (cons X14 X15)) (',' (gopher (cons T9 T10) (cons X16 X17)) (samefringe X15 X17)))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8",
                        "T9",
                        "T10"
                    ],
                    "free": [
                        "X14",
                        "X15",
                        "X16",
                        "X17"
                    ],
                    "exprvars": []
                }
            },
            "65": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 16,
                "to": 20,
                "label": "CASE"
            },
            {
                "from": 20,
                "to": 21,
                "label": "EVAL with clause\nsamefringe(nil, nil).\nand substitutionT1 -> nil,\nT2 -> nil"
            },
            {
                "from": 20,
                "to": 22,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 21,
                "to": 23,
                "label": "SUCCESS"
            },
            {
                "from": 22,
                "to": 35,
                "label": "EVAL with clause\nsamefringe(cons(X10, X11), cons(X12, X13)) :- ','(gopher(cons(X10, X11), cons(X14, X15)), ','(gopher(cons(X12, X13), cons(X16, X17)), samefringe(X15, X17))).\nand substitutionX10 -> T7,\nX11 -> T8,\nT1 -> cons(T7, T8),\nX12 -> T9,\nX13 -> T10,\nT2 -> cons(T9, T10)"
            },
            {
                "from": 22,
                "to": 36,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 23,
                "to": 24,
                "label": "BACKTRACK\nfor clause: samefringe(cons(U, V), cons(X, Y)) :- ','(gopher(cons(U, V), cons(U1, V1)), ','(gopher(cons(X, Y), cons(X1, Y1)), samefringe(V1, Y1)))because of non-unification"
            },
            {
                "from": 35,
                "to": 37,
                "label": "CASE"
            },
            {
                "from": 37,
                "to": 38,
                "label": "BACKTRACK\nfor clause: gopher(nil, nil)because of non-unification"
            },
            {
                "from": 38,
                "to": 42,
                "label": "PARALLEL"
            },
            {
                "from": 38,
                "to": 43,
                "label": "PARALLEL"
            },
            {
                "from": 42,
                "to": 44,
                "label": "EVAL with clause\ngopher(cons(nil, X22), cons(nil, X22)).\nand substitutionT7 -> nil,\nT8 -> T15,\nX22 -> T15,\nX14 -> nil,\nX15 -> T15"
            },
            {
                "from": 42,
                "to": 45,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 43,
                "to": 173,
                "label": "EVAL with clause\ngopher(cons(cons(X58, X59), X60), X61) :- gopher(cons(X58, cons(X59, X60)), X61).\nand substitutionX58 -> T38,\nX59 -> T39,\nT7 -> cons(T38, T39),\nT8 -> T40,\nX60 -> T40,\nX14 -> X62,\nX15 -> X63,\nX61 -> cons(X62, X63)"
            },
            {
                "from": 43,
                "to": 174,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 44,
                "to": 46,
                "label": "SPLIT 1"
            },
            {
                "from": 44,
                "to": 47,
                "label": "SPLIT 2\nnew knowledge:\nT9 is ground\nT10 is ground\nT16 is ground\nT17 is ground\nreplacements:X16 -> T16,\nX17 -> T17"
            },
            {
                "from": 46,
                "to": 48,
                "label": "CASE"
            },
            {
                "from": 47,
                "to": 16,
                "label": "INSTANCE with matching:\nT1 -> T15\nT2 -> T17"
            },
            {
                "from": 48,
                "to": 58,
                "label": "BACKTRACK\nfor clause: gopher(nil, nil)because of non-unification"
            },
            {
                "from": 58,
                "to": 59,
                "label": "PARALLEL"
            },
            {
                "from": 58,
                "to": 60,
                "label": "PARALLEL"
            },
            {
                "from": 59,
                "to": 61,
                "label": "EVAL with clause\ngopher(cons(nil, X27), cons(nil, X27)).\nand substitutionT9 -> nil,\nT10 -> T22,\nX27 -> T22,\nX16 -> nil,\nX17 -> T22"
            },
            {
                "from": 59,
                "to": 62,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 60,
                "to": 64,
                "label": "EVAL with clause\ngopher(cons(cons(X40, X41), X42), X43) :- gopher(cons(X40, cons(X41, X42)), X43).\nand substitutionX40 -> T29,\nX41 -> T30,\nT9 -> cons(T29, T30),\nT10 -> T31,\nX42 -> T31,\nX16 -> X44,\nX17 -> X45,\nX43 -> cons(X44, X45)"
            },
            {
                "from": 60,
                "to": 65,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 61,
                "to": 63,
                "label": "SUCCESS"
            },
            {
                "from": 64,
                "to": 46,
                "label": "INSTANCE with matching:\nT9 -> T29\nT10 -> cons(T30, T31)\nX16 -> X44\nX17 -> X45"
            },
            {
                "from": 173,
                "to": 35,
                "label": "INSTANCE with matching:\nT7 -> T38\nT8 -> cons(T39, T40)\nX14 -> X62\nX15 -> X63"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

gopherC(cons(X1, X2), X3, X4, X5) :- gopherC(X1, cons(X2, X3), X4, X5).
pB(nil, X1, nil, X1, X2, X3, X4, X5) :- gopherC(X2, X3, X4, X5).
pB(nil, X1, nil, X1, X2, X3, X4, X5) :- ','(gophercC(X2, X3, X4, X5), samefringeA(X1, X5)).
pB(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) :- pB(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9).
samefringeA(cons(X1, X2), cons(X3, X4)) :- pB(X1, X2, X5, X6, X3, X4, X7, X8).

Clauses:

samefringecA(nil, nil).
samefringecA(cons(X1, X2), cons(X3, X4)) :- qcB(X1, X2, X5, X6, X3, X4, X7, X8).
gophercC(nil, X1, nil, X1).
gophercC(cons(X1, X2), X3, X4, X5) :- gophercC(X1, cons(X2, X3), X4, X5).
qcB(nil, X1, nil, X1, X2, X3, X4, X5) :- ','(gophercC(X2, X3, X4, X5), samefringecA(X1, X5)).
qcB(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) :- qcB(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9).

Afs:

samefringeA(x1, x2)  =  samefringeA(x1, x2)


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

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

samefringeA_in_2: (b,b)

pB_in_8: (b,b,f,f,b,b,f,f)

gopherC_in_4: (b,b,f,f)

gophercC_in_4: (b,b,f,f)

Transforming TRIPLES into the following Term Rewriting System:

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

   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> U6_GG(X1, X2, X3, X4, pB_in_ggaaggaa(X1, X2, X5, X6, X3, X4, X7, X8))
   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> PB_IN_GGAAGGAA(X1, X2, X5, X6, X3, X4, X7, X8)
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> U2_GGAAGGAA(X1, X2, X3, X4, X5, gopherC_in_ggaa(X2, X3, X4, X5))
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> GOPHERC_IN_GGAA(X2, X3, X4, X5)
   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> U1_GGAA(X1, X2, X3, X4, X5, gopherC_in_ggaa(X1, cons(X2, X3), X4, X5))
   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> GOPHERC_IN_GGAA(X1, cons(X2, X3), X4, X5)
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_in_ggaa(X2, X3, X4, X5))
   U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_out_ggaa(X2, X3, X4, X5)) -> U4_GGAAGGAA(X1, X2, X3, X4, X5, samefringeA_in_gg(X1, X5))
   U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_out_ggaa(X2, X3, X4, X5)) -> SAMEFRINGEA_IN_GG(X1, X5)
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) -> U5_GGAAGGAA(X1, X2, X3, X4, X5, X6, X7, X8, X9, pB_in_ggaaggaa(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9))
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1, nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3, X4, X5) -> U9_ggaa(X1, X2, X3, X4, X5, gophercC_in_ggaa(X1, cons(X2, X3), X4, X5))
   U9_ggaa(X1, X2, X3, X4, X5, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

The argument filtering Pi contains the following mapping:
samefringeA_in_gg(x1, x2)  =  samefringeA_in_gg(x1, x2)

cons(x1, x2)  =  cons(x1, x2)

pB_in_ggaaggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  pB_in_ggaaggaa(x1, x2, x5, x6)

nil  =  nil

gopherC_in_ggaa(x1, x2, x3, x4)  =  gopherC_in_ggaa(x1, x2)

gophercC_in_ggaa(x1, x2, x3, x4)  =  gophercC_in_ggaa(x1, x2)

gophercC_out_ggaa(x1, x2, x3, x4)  =  gophercC_out_ggaa(x1, x2, x3, x4)

U9_ggaa(x1, x2, x3, x4, x5, x6)  =  U9_ggaa(x1, x2, x3, x6)

SAMEFRINGEA_IN_GG(x1, x2)  =  SAMEFRINGEA_IN_GG(x1, x2)

U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x1, x2, x3, x4, x5)

PB_IN_GGAAGGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  PB_IN_GGAAGGAA(x1, x2, x5, x6)

U2_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGAA(x1, x2, x3, x6)

GOPHERC_IN_GGAA(x1, x2, x3, x4)  =  GOPHERC_IN_GGAA(x1, x2)

U1_GGAA(x1, x2, x3, x4, x5, x6)  =  U1_GGAA(x1, x2, x3, x6)

U3_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGAA(x1, x2, x3, x6)

U4_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGAA(x1, x2, x3, x4, x5, x6)

U5_GGAAGGAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U5_GGAAGGAA(x1, x2, x3, x6, x7, x10)


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:

   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> U6_GG(X1, X2, X3, X4, pB_in_ggaaggaa(X1, X2, X5, X6, X3, X4, X7, X8))
   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> PB_IN_GGAAGGAA(X1, X2, X5, X6, X3, X4, X7, X8)
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> U2_GGAAGGAA(X1, X2, X3, X4, X5, gopherC_in_ggaa(X2, X3, X4, X5))
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> GOPHERC_IN_GGAA(X2, X3, X4, X5)
   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> U1_GGAA(X1, X2, X3, X4, X5, gopherC_in_ggaa(X1, cons(X2, X3), X4, X5))
   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> GOPHERC_IN_GGAA(X1, cons(X2, X3), X4, X5)
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_in_ggaa(X2, X3, X4, X5))
   U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_out_ggaa(X2, X3, X4, X5)) -> U4_GGAAGGAA(X1, X2, X3, X4, X5, samefringeA_in_gg(X1, X5))
   U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_out_ggaa(X2, X3, X4, X5)) -> SAMEFRINGEA_IN_GG(X1, X5)
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) -> U5_GGAAGGAA(X1, X2, X3, X4, X5, X6, X7, X8, X9, pB_in_ggaaggaa(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9))
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1, nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3, X4, X5) -> U9_ggaa(X1, X2, X3, X4, X5, gophercC_in_ggaa(X1, cons(X2, X3), X4, X5))
   U9_ggaa(X1, X2, X3, X4, X5, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

The argument filtering Pi contains the following mapping:
samefringeA_in_gg(x1, x2)  =  samefringeA_in_gg(x1, x2)

cons(x1, x2)  =  cons(x1, x2)

pB_in_ggaaggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  pB_in_ggaaggaa(x1, x2, x5, x6)

nil  =  nil

gopherC_in_ggaa(x1, x2, x3, x4)  =  gopherC_in_ggaa(x1, x2)

gophercC_in_ggaa(x1, x2, x3, x4)  =  gophercC_in_ggaa(x1, x2)

gophercC_out_ggaa(x1, x2, x3, x4)  =  gophercC_out_ggaa(x1, x2, x3, x4)

U9_ggaa(x1, x2, x3, x4, x5, x6)  =  U9_ggaa(x1, x2, x3, x6)

SAMEFRINGEA_IN_GG(x1, x2)  =  SAMEFRINGEA_IN_GG(x1, x2)

U6_GG(x1, x2, x3, x4, x5)  =  U6_GG(x1, x2, x3, x4, x5)

PB_IN_GGAAGGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  PB_IN_GGAAGGAA(x1, x2, x5, x6)

U2_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U2_GGAAGGAA(x1, x2, x3, x6)

GOPHERC_IN_GGAA(x1, x2, x3, x4)  =  GOPHERC_IN_GGAA(x1, x2)

U1_GGAA(x1, x2, x3, x4, x5, x6)  =  U1_GGAA(x1, x2, x3, x6)

U3_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGAA(x1, x2, x3, x6)

U4_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U4_GGAAGGAA(x1, x2, x3, x4, x5, x6)

U5_GGAAGGAA(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)  =  U5_GGAAGGAA(x1, x2, x3, x6, x7, x10)


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

(5) DependencyGraphProof (EQUIVALENT)
The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 6 less nodes.
----------------------------------------

(6)
Complex Obligation (AND)

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

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

   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> GOPHERC_IN_GGAA(X1, cons(X2, X3), X4, X5)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1, nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3, X4, X5) -> U9_ggaa(X1, X2, X3, X4, X5, gophercC_in_ggaa(X1, cons(X2, X3), X4, X5))
   U9_ggaa(X1, X2, X3, X4, X5, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)

nil  =  nil

gophercC_in_ggaa(x1, x2, x3, x4)  =  gophercC_in_ggaa(x1, x2)

gophercC_out_ggaa(x1, x2, x3, x4)  =  gophercC_out_ggaa(x1, x2, x3, x4)

U9_ggaa(x1, x2, x3, x4, x5, x6)  =  U9_ggaa(x1, x2, x3, x6)

GOPHERC_IN_GGAA(x1, x2, x3, x4)  =  GOPHERC_IN_GGAA(x1, x2)


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

(8) UsableRulesProof (EQUIVALENT)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
----------------------------------------

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

   GOPHERC_IN_GGAA(cons(X1, X2), X3, X4, X5) -> GOPHERC_IN_GGAA(X1, cons(X2, X3), X4, X5)

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

GOPHERC_IN_GGAA(x1, x2, x3, x4)  =  GOPHERC_IN_GGAA(x1, x2)


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

(10) PiDPToQDPProof (SOUND)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
----------------------------------------

(11)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   GOPHERC_IN_GGAA(cons(X1, X2), X3) -> GOPHERC_IN_GGAA(X1, cons(X2, X3))

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

(12) 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:
*GOPHERC_IN_GGAA(cons(X1, X2), X3) -> GOPHERC_IN_GGAA(X1, cons(X2, X3))
The graph contains the following edges 1 > 1


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

(13)
YES

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

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

   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> PB_IN_GGAAGGAA(X1, X2, X5, X6, X3, X4, X7, X8)
   PB_IN_GGAAGGAA(nil, X1, nil, X1, X2, X3, X4, X5) -> U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_in_ggaa(X2, X3, X4, X5))
   U3_GGAAGGAA(X1, X2, X3, X4, X5, gophercC_out_ggaa(X2, X3, X4, X5)) -> SAMEFRINGEA_IN_GG(X1, X5)
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X4, X5, X6, X7, X8, X9) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X4, X5, X6, X7, X8, X9)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1, nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3, X4, X5) -> U9_ggaa(X1, X2, X3, X4, X5, gophercC_in_ggaa(X1, cons(X2, X3), X4, X5))
   U9_ggaa(X1, X2, X3, X4, X5, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x1, x2)

nil  =  nil

gophercC_in_ggaa(x1, x2, x3, x4)  =  gophercC_in_ggaa(x1, x2)

gophercC_out_ggaa(x1, x2, x3, x4)  =  gophercC_out_ggaa(x1, x2, x3, x4)

U9_ggaa(x1, x2, x3, x4, x5, x6)  =  U9_ggaa(x1, x2, x3, x6)

SAMEFRINGEA_IN_GG(x1, x2)  =  SAMEFRINGEA_IN_GG(x1, x2)

PB_IN_GGAAGGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  PB_IN_GGAAGGAA(x1, x2, x5, x6)

U3_GGAAGGAA(x1, x2, x3, x4, x5, x6)  =  U3_GGAAGGAA(x1, x2, x3, x6)


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

(15) PiDPToQDPProof (SOUND)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
----------------------------------------

(16)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> PB_IN_GGAAGGAA(X1, X2, X3, X4)
   PB_IN_GGAAGGAA(nil, X1, X2, X3) -> U3_GGAAGGAA(X1, X2, X3, gophercC_in_ggaa(X2, X3))
   U3_GGAAGGAA(X1, X2, X3, gophercC_out_ggaa(X2, X3, X4, X5)) -> SAMEFRINGEA_IN_GG(X1, X5)
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3) -> U9_ggaa(X1, X2, X3, gophercC_in_ggaa(X1, cons(X2, X3)))
   U9_ggaa(X1, X2, X3, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

The set Q consists of the following terms:

   gophercC_in_ggaa(x0, x1)
   U9_ggaa(x0, x1, x2, x3)

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

(17) QDPQMonotonicMRRProof (EQUIVALENT)
By using the Q-monotonic rule removal processor with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented such that it always occurs at a strongly monotonic position in a (P,Q,R)-chain.

Strictly oriented dependency pairs:

   PB_IN_GGAAGGAA(nil, X1, X2, X3) -> U3_GGAAGGAA(X1, X2, X3, gophercC_in_ggaa(X2, X3))

Strictly oriented rules of the TRS R:

   U9_ggaa(X1, X2, X3, gophercC_out_ggaa(X1, cons(X2, X3), X4, X5)) -> gophercC_out_ggaa(cons(X1, X2), X3, X4, X5)

Used ordering: Polynomial interpretation [POLO]:

   POL(PB_IN_GGAAGGAA(x_1, x_2, x_3, x_4)) = 1 + 2*x_3 + x_4
   POL(SAMEFRINGEA_IN_GG(x_1, x_2)) = x_2
   POL(U3_GGAAGGAA(x_1, x_2, x_3, x_4)) = x_4
   POL(U9_ggaa(x_1, x_2, x_3, x_4)) = 1 + x_4
   POL(cons(x_1, x_2)) = 1 + 2*x_1 + x_2
   POL(gophercC_in_ggaa(x_1, x_2)) = 2*x_1 + x_2
   POL(gophercC_out_ggaa(x_1, x_2, x_3, x_4)) = 2*x_3 + x_4
   POL(nil) = 0


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

(18)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   SAMEFRINGEA_IN_GG(cons(X1, X2), cons(X3, X4)) -> PB_IN_GGAAGGAA(X1, X2, X3, X4)
   U3_GGAAGGAA(X1, X2, X3, gophercC_out_ggaa(X2, X3, X4, X5)) -> SAMEFRINGEA_IN_GG(X1, X5)
   PB_IN_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3) -> U9_ggaa(X1, X2, X3, gophercC_in_ggaa(X1, cons(X2, X3)))

The set Q consists of the following terms:

   gophercC_in_ggaa(x0, x1)
   U9_ggaa(x0, x1, x2, x3)

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

(19) DependencyGraphProof (EQUIVALENT)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 2 less nodes.
----------------------------------------

(20)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   PB_IN_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)

The TRS R consists of the following rules:

   gophercC_in_ggaa(nil, X1) -> gophercC_out_ggaa(nil, X1, nil, X1)
   gophercC_in_ggaa(cons(X1, X2), X3) -> U9_ggaa(X1, X2, X3, gophercC_in_ggaa(X1, cons(X2, X3)))

The set Q consists of the following terms:

   gophercC_in_ggaa(x0, x1)
   U9_ggaa(x0, x1, x2, x3)

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

(21) UsableRulesProof (EQUIVALENT)
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.
----------------------------------------

(22)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   PB_IN_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)

R is empty.
The set Q consists of the following terms:

   gophercC_in_ggaa(x0, x1)
   U9_ggaa(x0, x1, x2, x3)

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

(23) QReductionProof (EQUIVALENT)
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

   gophercC_in_ggaa(x0, x1)
   U9_ggaa(x0, x1, x2, x3)


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

(24)
Obligation:
Q DP problem:
The TRS P consists of the following rules:

   PB_IN_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)

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

(25) 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_GGAAGGAA(cons(X1, X2), X3, X6, X7) -> PB_IN_GGAAGGAA(X1, cons(X2, X3), X6, X7)
The graph contains the following edges 1 > 1, 3 >= 3, 4 >= 4


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

(26)
YES
