Merge pull request #1743 from triska/rely_on_indexing
rely on first instantiated argument indexing
This commit is contained in:
@@ -220,31 +220,23 @@ partition_([X|Xs], Pred, Ls0, Es0, Gs0) :-
|
|||||||
|
|
||||||
:- meta_predicate(include(1, ?, ?)).
|
:- meta_predicate(include(1, ?, ?)).
|
||||||
|
|
||||||
include(Goal, Ls0, Ls) :-
|
include(_, [], []).
|
||||||
include_(Ls0, Goal, Ls).
|
include(Goal, [L|Ls0], Ls) :-
|
||||||
|
|
||||||
include_([], _, []).
|
|
||||||
include_([L|Ls0], Goal, Ls) :-
|
|
||||||
( call(Goal, L) ->
|
( call(Goal, L) ->
|
||||||
Ls = [L|Rest]
|
Ls = [L|Rest]
|
||||||
; Ls = Rest
|
; Ls = Rest
|
||||||
),
|
),
|
||||||
include_(Ls0, Goal, Rest).
|
include(Goal, Ls0, Rest).
|
||||||
|
|
||||||
|
|
||||||
:- meta_predicate(exclude(1, ?, ?)).
|
:- meta_predicate(exclude(1, ?, ?)).
|
||||||
|
|
||||||
exclude(Goal, Ls0, Ls) :-
|
exclude(_, [], []).
|
||||||
exclude_(Ls0, Goal, Ls).
|
exclude(Goal, [L|Ls0], Ls) :-
|
||||||
|
|
||||||
exclude_([], _, []).
|
|
||||||
exclude_([L|Ls0], Goal, Ls) :-
|
|
||||||
( call(Goal, L) ->
|
( call(Goal, L) ->
|
||||||
Ls = Rest
|
Ls = Rest
|
||||||
; Ls = [L|Rest]
|
; Ls = [L|Rest]
|
||||||
),
|
),
|
||||||
exclude_(Ls0, Goal, Rest).
|
exclude(Goal, Ls0, Rest).
|
||||||
|
|
||||||
|
|
||||||
%:- discontiguous clpz:goal_expansion/5.
|
%:- discontiguous clpz:goal_expansion/5.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user