Merge pull request #1997 from triska/countall
Corrections to countall/2
This commit is contained in:
@@ -359,10 +359,10 @@ call_nth_nesting(C, ID) :-
|
|||||||
bb_put(ID, 0),
|
bb_put(ID, 0),
|
||||||
bb_put(i_call_nth_counter, C).
|
bb_put(i_call_nth_counter, C).
|
||||||
|
|
||||||
%% countall(Goal, N).
|
%% countall(G_0, N).
|
||||||
%
|
%
|
||||||
% countall(Goal, N) counts all solutions of Goal and unifies N with
|
% countall(G_0, N) is true iff N unifies with the total number of
|
||||||
% this number of solutions. This predicate always succeeds once.
|
% answers of call(G_0).
|
||||||
|
|
||||||
:- meta_predicate(countall(0, ?)).
|
:- meta_predicate(countall(0, ?)).
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ countall(Goal, N) :-
|
|||||||
( integer(N) ->
|
( integer(N) ->
|
||||||
( N < 0 ->
|
( N < 0 ->
|
||||||
domain_error(not_less_than_zero, N, countall/2)
|
domain_error(not_less_than_zero, N, countall/2)
|
||||||
; N > 0
|
; true
|
||||||
)
|
)
|
||||||
; true
|
; true
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user