move compatibility predicates and meta_predicate/1 declarations so that they are correctly taken into account
This commit is contained in:
@@ -110,6 +110,46 @@ domain_error(Expectation, Term) :-
|
|||||||
type_error(Expectation, Term) :-
|
type_error(Expectation, Term) :-
|
||||||
type_error(Expectation, Term, unknown(Term)-1).
|
type_error(Expectation, Term, unknown(Term)-1).
|
||||||
|
|
||||||
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
Compatibility predicates.
|
||||||
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||||
|
|
||||||
|
:- meta_predicate(include(1, ?, ?)).
|
||||||
|
|
||||||
|
include(_, [], []).
|
||||||
|
include(Goal, [L|Ls0], Ls) :-
|
||||||
|
( call(Goal, L) ->
|
||||||
|
Ls = [L|Rest]
|
||||||
|
; Ls = Rest
|
||||||
|
),
|
||||||
|
include(Goal, Ls0, Rest).
|
||||||
|
|
||||||
|
:- meta_predicate(exclude(1, ?, ?)).
|
||||||
|
|
||||||
|
exclude(_, [], []).
|
||||||
|
exclude(Goal, [L|Ls0], Ls) :-
|
||||||
|
( call(Goal, L) ->
|
||||||
|
Ls = Rest
|
||||||
|
; Ls = [L|Rest]
|
||||||
|
),
|
||||||
|
exclude(Goal, Ls0, Rest).
|
||||||
|
|
||||||
|
:- meta_predicate(partition(2,?,?,?,?)).
|
||||||
|
|
||||||
|
partition(_, [], [], [], []).
|
||||||
|
partition(Pred, [H|T], L, E, G) :-
|
||||||
|
call(Pred, H, Diff),
|
||||||
|
partition_(Diff, H, Pred, T, L, E, G).
|
||||||
|
|
||||||
|
partition_(<, H, Pred, T, [H|Rest], E, G) :-
|
||||||
|
partition(Pred, T, Rest, E, G).
|
||||||
|
partition_(=, H, Pred, T, L, [H|Rest], G) :-
|
||||||
|
partition(Pred, T, L, Rest, G).
|
||||||
|
partition_(>, H, Pred, T, L, E, [H|Rest]) :-
|
||||||
|
partition(Pred, T, L, E, Rest).
|
||||||
|
|
||||||
|
:- meta_predicate(partition(1,?,?,?)).
|
||||||
|
|
||||||
partition(Pred, Ls0, As, Bs) :-
|
partition(Pred, Ls0, As, Bs) :-
|
||||||
include(Pred, Ls0, As),
|
include(Pred, Ls0, As),
|
||||||
exclude(Pred, Ls0, Bs).
|
exclude(Pred, Ls0, Bs).
|
||||||
@@ -466,6 +506,10 @@ non_monotonic(X) :-
|
|||||||
; true
|
; true
|
||||||
).
|
).
|
||||||
|
|
||||||
|
:- meta_predicate(bdd_nodes(1, ?, ?)).
|
||||||
|
:- meta_predicate(bdd_nodes_(1, ?, ?, ?)).
|
||||||
|
:- meta_predicate(with_aux(1, ?)).
|
||||||
|
|
||||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Rewriting to canonical expressions.
|
Rewriting to canonical expressions.
|
||||||
Atoms are converted to variables with a special attribute.
|
Atoms are converted to variables with a special attribute.
|
||||||
@@ -1941,44 +1985,3 @@ clpb_atom_var(Atom, Var) :-
|
|||||||
put_assoc(Atom, A0, Var, A),
|
put_assoc(Atom, A0, Var, A),
|
||||||
b_setval('$clpb_atoms', A)
|
b_setval('$clpb_atoms', A)
|
||||||
).
|
).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
Compatibility predicates.
|
|
||||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
|
||||||
|
|
||||||
|
|
||||||
:- meta_predicate(include(1, ?, ?)).
|
|
||||||
|
|
||||||
include(_, [], []).
|
|
||||||
include(Goal, [L|Ls0], Ls) :-
|
|
||||||
( call(Goal, L) ->
|
|
||||||
Ls = [L|Rest]
|
|
||||||
; Ls = Rest
|
|
||||||
),
|
|
||||||
include(Goal, Ls0, Rest).
|
|
||||||
|
|
||||||
:- meta_predicate(exclude(1, ?, ?)).
|
|
||||||
|
|
||||||
exclude(_, [], []).
|
|
||||||
exclude(Goal, [L|Ls0], Ls) :-
|
|
||||||
( call(Goal, L) ->
|
|
||||||
Ls = Rest
|
|
||||||
; Ls = [L|Rest]
|
|
||||||
),
|
|
||||||
exclude(Goal, Ls0, Rest).
|
|
||||||
|
|
||||||
:- meta_predicate(partition(2,?,?,?,?)).
|
|
||||||
|
|
||||||
partition(_, [], [], [], []).
|
|
||||||
partition(Pred, [H|T], L, E, G) :-
|
|
||||||
call(Pred, H, Diff),
|
|
||||||
partition_(Diff, H, Pred, T, L, E, G).
|
|
||||||
|
|
||||||
partition_(<, H, Pred, T, [H|Rest], E, G) :-
|
|
||||||
partition(Pred, T, Rest, E, G).
|
|
||||||
partition_(=, H, Pred, T, L, [H|Rest], G) :-
|
|
||||||
partition(Pred, T, L, Rest, G).
|
|
||||||
partition_(>, H, Pred, T, L, E, [H|Rest]) :-
|
|
||||||
partition(Pred, T, L, E, Rest).
|
|
||||||
|
|||||||
Reference in New Issue
Block a user