Subject: Re: [SWIPL] choicepoints from flag/3

From: "Richard A. O'Keefe" <[email-masked]>
Date: Mon, 26 Feb 2001 10:33:54 +1300 (NZDT)

"Bernd Fischer" <[email-masked]> wrote:
	using flag/3 leaves my with unwanted (and redundant)
	choicepoints which I can't cut away.

But why do you think there are any such choicepoints?  The transcript
you provided provides *ABSOLUTELY NO EVIDENCE* for that belief.

Try the following instead.

% pl
?- flag(test, _, 3).
?- [user].
q :- statistics, fail; flag(test, X, X), statistics, fail; true.
end_of_file.
?- q.

I'll chop out the irrelevant bits.  I get
Local  stack :     2,048,000       16,384          628 Bytes
Global stack :     4,096,000       16,384          676 Bytes
Trail  stack :     4,096,000       16,384          232 Bytes

Local  stack :     2,048,000       16,384          628 Bytes
Global stack :     4,096,000       16,384          676 Bytes
Trail  stack :     4,096,000       16,384          236 Bytes

The only change is one trail entry for X.
The call to flag/3 has left *NO* choice-point of its own.