Handbook
Glossary
amb-all ( quot -- )
Simple backtracking non-determinism
Prev:
if-amb ( true false -- ? )
Next:
bag-of ( quot -- seq )
Vocabulary
backtrack
Inputs
quot
a
quotation
with stack effect
( -- )
Outputs
None
Word description
Execute all the alternatives in the quotation by calling
fail
repeatedly at the end.
See also
bag-of
,
fail
Definition
USING:
backtrack.private
kernel
;
IN:
backtrack
:
amb-all
( quot -- )
[
{
t
f
}
amb
[
call
fail
]
[
drop
]
if
]
amb-preserve
;
inline