Term Rewriting System R:
[xs, ys, x, y, f]
app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(lt, app(s, x)), app(s, y)) -> app(app(lt, x), y)
app(app(lt, 0), app(s, y)) -> true
app(app(lt, y), 0) -> false
app(app(eq, x), x) -> true
app(app(eq, app(s, x)), 0) -> false
app(app(eq, 0), app(s, x)) -> false
app(app(merge, xs), nil) -> xs
app(app(merge, nil), ys) -> ys
app(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> app(app(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))), app(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))))
app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(app(mult, 0), x) -> 0
app(app(mult, app(s, x)), y) -> app(app(plus, y), app(app(mult, x), y))
app(app(plus, 0), x) -> 0
app(app(plus, app(s, x)), y) -> app(s, app(app(plus, x), y))
list1 -> app(app(map, app(mult, app(s, app(s, 0)))), hamming)
list2 -> app(app(map, app(mult, app(s, app(s, app(s, 0))))), hamming)
list3 -> app(app(map, app(mult, app(s, app(s, app(s, app(s, app(s, 0))))))), hamming)
hamming -> app(app(cons, app(s, 0)), app(app(merge, list1), app(app(merge, list2), list3)))

Termination of R to be shown.



   R
Dependency Pair Analysis



R contains the following Dependency Pairs:

APP(app(lt, app(s, x)), app(s, y)) -> APP(app(lt, x), y)
APP(app(lt, app(s, x)), app(s, y)) -> APP(lt, x)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))), app(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys))))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(if, app(app(lt, x), y))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(lt, x), y)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(lt, x)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, xs), app(app(cons, y), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(merge, xs)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(if, app(app(eq, x), y))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(eq, x), y)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(eq, x)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, x), app(app(merge, xs), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, xs), ys)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, app(app(cons, x), xs)), ys)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(cons, app(f, x)), app(app(map, f), xs))
APP(app(map, f), app(app(cons, x), xs)) -> APP(cons, app(f, x))
APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
APP(app(mult, app(s, x)), y) -> APP(app(plus, y), app(app(mult, x), y))
APP(app(mult, app(s, x)), y) -> APP(plus, y)
APP(app(mult, app(s, x)), y) -> APP(app(mult, x), y)
APP(app(mult, app(s, x)), y) -> APP(mult, x)
APP(app(plus, app(s, x)), y) -> APP(s, app(app(plus, x), y))
APP(app(plus, app(s, x)), y) -> APP(app(plus, x), y)
APP(app(plus, app(s, x)), y) -> APP(plus, x)
LIST1 -> APP(app(map, app(mult, app(s, app(s, 0)))), hamming)
LIST1 -> APP(map, app(mult, app(s, app(s, 0))))
LIST1 -> APP(mult, app(s, app(s, 0)))
LIST1 -> APP(s, app(s, 0))
LIST1 -> APP(s, 0)
LIST1 -> HAMMING
LIST2 -> APP(app(map, app(mult, app(s, app(s, app(s, 0))))), hamming)
LIST2 -> APP(map, app(mult, app(s, app(s, app(s, 0)))))
LIST2 -> APP(mult, app(s, app(s, app(s, 0))))
LIST2 -> APP(s, app(s, app(s, 0)))
LIST2 -> APP(s, app(s, 0))
LIST2 -> APP(s, 0)
LIST2 -> HAMMING
LIST3 -> APP(app(map, app(mult, app(s, app(s, app(s, app(s, app(s, 0))))))), hamming)
LIST3 -> APP(map, app(mult, app(s, app(s, app(s, app(s, app(s, 0)))))))
LIST3 -> APP(mult, app(s, app(s, app(s, app(s, app(s, 0))))))
LIST3 -> APP(s, app(s, app(s, app(s, app(s, 0)))))
LIST3 -> APP(s, app(s, app(s, app(s, 0))))
LIST3 -> APP(s, app(s, app(s, 0)))
LIST3 -> APP(s, app(s, 0))
LIST3 -> APP(s, 0)
LIST3 -> HAMMING
HAMMING -> APP(app(cons, app(s, 0)), app(app(merge, list1), app(app(merge, list2), list3)))
HAMMING -> APP(cons, app(s, 0))
HAMMING -> APP(s, 0)
HAMMING -> APP(app(merge, list1), app(app(merge, list2), list3))
HAMMING -> APP(merge, list1)
HAMMING -> LIST1
HAMMING -> APP(app(merge, list2), list3)
HAMMING -> APP(merge, list2)
HAMMING -> LIST2
HAMMING -> LIST3

Furthermore, R contains two SCCs.


   R
DPs
       →DP Problem 1
Narrowing Transformation
       →DP Problem 2
Remaining


Dependency Pairs:

APP(app(plus, app(s, x)), y) -> APP(app(plus, x), y)
APP(app(mult, app(s, x)), y) -> APP(app(mult, x), y)
APP(app(mult, app(s, x)), y) -> APP(app(plus, y), app(app(mult, x), y))
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(map, f), xs)
APP(app(map, f), app(app(cons, x), xs)) -> APP(f, x)
APP(app(map, f), app(app(cons, x), xs)) -> APP(app(cons, app(f, x)), app(app(map, f), xs))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, app(app(cons, x), xs)), ys)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, xs), ys)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, x), app(app(merge, xs), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(eq, x), y)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(merge, xs), app(app(cons, y), ys))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(lt, x), y)
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys))))
APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))), app(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))))
APP(app(lt, app(s, x)), app(s, y)) -> APP(app(lt, x), y)


Rules:


app(app(app(if, true), xs), ys) -> xs
app(app(app(if, false), xs), ys) -> ys
app(app(lt, app(s, x)), app(s, y)) -> app(app(lt, x), y)
app(app(lt, 0), app(s, y)) -> true
app(app(lt, y), 0) -> false
app(app(eq, x), x) -> true
app(app(eq, app(s, x)), 0) -> false
app(app(eq, 0), app(s, x)) -> false
app(app(merge, xs), nil) -> xs
app(app(merge, nil), ys) -> ys
app(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> app(app(app(if, app(app(lt, x), y)), app(app(cons, x), app(app(merge, xs), app(app(cons, y), ys)))), app(app(app(if, app(app(eq, x), y)), app(app(cons, x), app(app(merge, xs), ys))), app(app(cons, y), app(app(merge, app(app(cons, x), xs)), ys))))
app(app(map, f), nil) -> nil
app(app(map, f), app(app(cons, x), xs)) -> app(app(cons, app(f, x)), app(app(map, f), xs))
app(app(mult, 0), x) -> 0
app(app(mult, app(s, x)), y) -> app(app(plus, y), app(app(mult, x), y))
app(app(plus, 0), x) -> 0
app(app(plus, app(s, x)), y) -> app(s, app(app(plus, x), y))
list1 -> app(app(map, app(mult, app(s, app(s, 0)))), hamming)
list2 -> app(app(map, app(mult, app(s, app(s, app(s, 0))))), hamming)
list3 -> app(app(map, app(mult, app(s, app(s, app(s, app(s, app(s, 0))))))), hamming)
hamming -> app(app(cons, app(s, 0)), app(app(merge, list1), app(app(merge, list2), list3)))





On this DP problem, a Narrowing SCC transformation can be performed.
As a result of transforming the rule

APP(app(merge, app(app(cons, x), xs)), app(app(cons, y), ys)) -> APP(app(eq, x), y)
no new Dependency Pairs are created.
The transformation is resulting in one new DP problem:



   R
DPs
       →DP Problem 1
Nar
       →DP Problem 2
Remaining Obligation(s)




The following remains to be proven:


   R
DPs
       →DP Problem 1
Nar
       →DP Problem 2
Remaining Obligation(s)




The following remains to be proven:

Termination of R could not be shown.
Duration:
0:02 minutes