]> Repositorios git - scryer-prolog.git/commitdiff
move compatibility predicates and meta_predicate/1 declarations so that they are...
authorMarkus Triska <[email protected]>
Fri, 8 Sep 2023 21:12:33 +0000 (23:12 +0200)
committerMarkus Triska <[email protected]>
Sat, 9 Sep 2023 05:46:01 +0000 (07:46 +0200)
src/lib/clpb.pl

index d2e63db064381d5b5d3cbb121f0b64c35d5f29ec..ec31b298bccd9e45e1bc8cf837d2bd5ba14d6537 100644 (file)
@@ -110,6 +110,46 @@ domain_error(Expectation, Term) :-
 type_error(Expectation, Term) :-
         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) :-
         include(Pred, Ls0, As),
         exclude(Pred, Ls0, Bs).
@@ -466,6 +506,10 @@ non_monotonic(X) :-
         ;   true
         ).
 
+:- meta_predicate(bdd_nodes(1, ?, ?)).
+:- meta_predicate(bdd_nodes_(1, ?, ?, ?)).
+:- meta_predicate(with_aux(1, ?)).
+
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Rewriting to canonical expressions.
    Atoms are converted to variables with a special attribute.
@@ -1941,44 +1985,3 @@ clpb_atom_var(Atom, Var) :-
             put_assoc(Atom, A0, Var, 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).