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


Left Termination of the query pattern

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


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

(0)
Obligation:
Clauses:

p(X, Y).
map(.(X, Xs), .(Y, Ys)) :- ','(p(X, Y), map(Xs, Ys)).
map([], []).


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

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

{
    "root": 16,
    "program": {
        "directives": [],
        "clauses": [
            [
                "(p X Y)",
                null
            ],
            [
                "(map (. X Xs) (. Y Ys))",
                "(',' (p X Y) (map Xs Ys))"
            ],
            [
                "(map ([]) ([]))",
                null
            ]
        ]
    },
    "graph": {
        "nodes": {
            "16": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(map T1 T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "17": {
                "goal": [
                    {
                        "clause": 1,
                        "scope": 1,
                        "term": "(map T1 T2)"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(map T1 T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [],
                    "exprvars": []
                }
            },
            "type": "Nodes",
            "143": {
                "goal": [{
                    "clause": 0,
                    "scope": 2,
                    "term": "(',' (p T7 T11) (map T8 T12))"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "155": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(map T8 T33)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T8"],
                    "free": [],
                    "exprvars": []
                }
            },
            "166": {
                "goal": [{
                    "clause": -1,
                    "scope": -1,
                    "term": "(true)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "134": {
                "goal": [
                    {
                        "clause": 0,
                        "scope": 2,
                        "term": "(',' (p T7 T11) (map T8 T12))"
                    },
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(map (. T7 T8) T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "145": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": 2,
                        "term": null
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(map (. T7 T8) T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "156": {
                "goal": [{
                    "clause": 2,
                    "scope": 1,
                    "term": "(map (. T7 T8) T2)"
                }],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "167": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "157": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "168": {
                "goal": [],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [],
                    "free": [],
                    "exprvars": []
                }
            },
            "103": {
                "goal": [
                    {
                        "clause": -1,
                        "scope": -1,
                        "term": "(',' (p T7 T11) (map T8 T12))"
                    },
                    {
                        "clause": 2,
                        "scope": 1,
                        "term": "(map (. T7 T8) T2)"
                    }
                ],
                "kb": {
                    "nonunifying": [],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": [
                        "T7",
                        "T8"
                    ],
                    "free": [],
                    "exprvars": []
                }
            },
            "104": {
                "goal": [{
                    "clause": 2,
                    "scope": 1,
                    "term": "(map T1 T2)"
                }],
                "kb": {
                    "nonunifying": [[
                        "(map T1 T2)",
                        "(map (. X5 X6) (. X7 X8))"
                    ]],
                    "intvars": {},
                    "arithmetic": {
                        "type": "PlainIntegerRelationState",
                        "relations": []
                    },
                    "ground": ["T1"],
                    "free": [
                        "X5",
                        "X6",
                        "X7",
                        "X8"
                    ],
                    "exprvars": []
                }
            }
        },
        "edges": [
            {
                "from": 16,
                "to": 17,
                "label": "CASE"
            },
            {
                "from": 17,
                "to": 103,
                "label": "EVAL with clause\nmap(.(X5, X6), .(X7, X8)) :- ','(p(X5, X7), map(X6, X8)).\nand substitutionX5 -> T7,\nX6 -> T8,\nT1 -> .(T7, T8),\nX7 -> T11,\nX8 -> T12,\nT2 -> .(T11, T12),\nT9 -> T11,\nT10 -> T12"
            },
            {
                "from": 17,
                "to": 104,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 103,
                "to": 134,
                "label": "CASE"
            },
            {
                "from": 104,
                "to": 166,
                "label": "EVAL with clause\nmap([], []).\nand substitutionT1 -> [],\nT2 -> []"
            },
            {
                "from": 104,
                "to": 167,
                "label": "EVAL-BACKTRACK"
            },
            {
                "from": 134,
                "to": 143,
                "label": "PARALLEL"
            },
            {
                "from": 134,
                "to": 145,
                "label": "PARALLEL"
            },
            {
                "from": 143,
                "to": 155,
                "label": "ONLY EVAL with clause\np(X25, X26).\nand substitutionT7 -> T31,\nX25 -> T31,\nT11 -> T32,\nX26 -> T32,\nT12 -> T33"
            },
            {
                "from": 145,
                "to": 156,
                "label": "FAILURE"
            },
            {
                "from": 155,
                "to": 16,
                "label": "INSTANCE with matching:\nT1 -> T8\nT2 -> T33"
            },
            {
                "from": 156,
                "to": 157,
                "label": "BACKTRACK\nfor clause: map([], [])because of non-unification"
            },
            {
                "from": 166,
                "to": 168,
                "label": "SUCCESS"
            }
        ],
        "type": "Graph"
    }
}

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

(2)
Obligation:
Triples:

mapA(.(X1, X2), .(X3, X4)) :- mapA(X2, X4).

Clauses:

mapcA(.(X1, X2), .(X3, X4)) :- mapcA(X2, X4).
mapcA([], []).

Afs:

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

mapA_in_2: (b,f)

Transforming TRIPLES into the following Term Rewriting System:

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

   MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> U1_GA(X1, X2, X3, X4, mapA_in_ga(X2, X4))
   MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4)

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

.(x1, x2)  =  .(x2)

MAPA_IN_GA(x1, x2)  =  MAPA_IN_GA(x1)

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


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:

   MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> U1_GA(X1, X2, X3, X4, mapA_in_ga(X2, X4))
   MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4)

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

.(x1, x2)  =  .(x2)

MAPA_IN_GA(x1, x2)  =  MAPA_IN_GA(x1)

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


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:

   MAPA_IN_GA(.(X1, X2), .(X3, X4)) -> MAPA_IN_GA(X2, X4)

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

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

   MAPA_IN_GA(.(X2)) -> MAPA_IN_GA(X2)

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:
*MAPA_IN_GA(.(X2)) -> MAPA_IN_GA(X2)
The graph contains the following edges 1 > 1


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

(10)
YES
