The predicates drop/3, foldl/4, foldl1/3, last/2, replicate/3, split_at/4 and take/3 are inspired by the Haskell Prelude, but are implemented declaratively: They can be used to generate as well as test.
drop(N, List, Tail) :- length(Head, N), append(Head, Tail, List).
last(List, Elem) :- reverse(List, [Elem|_]).
replicate(A, Num, As) :- length(As, Num), maplist(=(A),As).
split_at(N, List, Head, Tail) :- length(Head, N), append(Head, Tail, List).
take(N, List, Head) :- length(Head, N), append(Head, _Tail, List).
pred(LHS, RHS, Result)
Thanks to Markus Triska for the definition.