This class is intended to explore structures that matches the and/or
graph of BACKTRACKING_NODE. The alternatives have a context that is
gotten and restored throught features 'get_context' and 'restore_context'.
See tutorial/backtracking for examples.
The instances of the BACKTRACKING childs are typically
used through lines like the following ones that enumerate the
solutions:
from
set_current_node(root)
search_first
until
is_off
loop
... -- do something
search_next
end
These features are declared to be bound to ANY but dont hesitate to
change the type of the context to what your context is.
The current state must be set. It is the
first state, the root of the search.
When the feature returns, 'search_is_success' must be
checked to know if a solution was found.
When search_is_success=False, it means that there
is no solution at all. Conversly, if search_is_success=True,
then the first solution is found and 'search_next'
can be called to get the next solution if it exists.
When the feature returns, 'search_is_success' must be
checked to know if a solution was found.
When search_is_success=False at the end, it means that there
is no more solution. Conversly, if search_is_success=True,
then a solution is found and 'search_next'
can be called again to get the next solution.