type_error(Expectation, Term, unknown(Term)-1).
+:- meta_predicate(partition(1, ?, ?, ?)).
+
partition(Pred, Ls0, As, Bs) :-
include(Pred, Ls0, As),
exclude(Pred, Ls0, Bs).
include/3 and exclude/3
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+:- meta_predicate(include(1, ?, ?)).
+
include(Goal, Ls0, Ls) :-
include_(Ls0, Goal, Ls).
include_(Ls0, Goal, Rest).
+:- meta_predicate(exclude(1, ?, ?)).
exclude(Goal, Ls0, Ls) :-
exclude_(Ls0, Goal, Ls).