class BACKTRACKING_ALTERNATIVE_LIST

Features exported to ABSTRACT_BACKTRACKING

An alternative of a list of nodes.

Direct parents

conformant parents

ABSTRACT_BACKTRACKING_ALTERNATIVE

non-conformant parents

BACKTRACKING_GLOBALS

Summary

exported features

the pools

Details

list: BACKTRACKING_NODE_OR_LIST

Iterator on the next item of the list.

set_list (value: BACKTRACKING_NODE_OR_LIST)

require

  • value_not_void: value /= Void

ensure

  • definition: list = value
  • list_not_void: list /= Void

next_alternative (explorer: BACKTRACKING)

Called by ABSTRACT_BACKTRACKING to let the current object switch to the next alternative to explore. Two actions must be performed by that feature:

  - make iteration actions and then call
     'continue_alternative' if iteration is not ended
     and that current object must be called again to
     switch to an other alternative or else call
     'pop_alternative' if this is the last alternative
     to be explored.
  - select the state to be evaluated or
     call 'continue' or call 'backtrack'.

require

    previous: ABSTRACT_BACKTRACKING_ALTERNATIVE

    For the linked stack of alternatives. Managed by ABSTRACT_BACKTRACKING.

    continuation: ABSTRACT_BACKTRACKING_SEQUENCE

    The sequence to continue after a success in exploration of the current alternative. Managed by ABSTRACT_BACKTRACKING.

    set_continuation (value: ABSTRACT_BACKTRACKING_SEQUENCE)

    ensure

    • definition: continuation = value

    top_sequence: ABSTRACT_BACKTRACKING_SEQUENCE

    Record of the top of the stack of sequence to restore the state of the exploration after that all alternatives were explored. Managed by ABSTRACT_BACKTRACKING.

    set_top_sequence (value: ABSTRACT_BACKTRACKING_SEQUENCE)

    ensure

    • definition: top_sequence = value

    release

    Called by ABSTRACT_BACKTRACKING to release current instance to the pool.

    require

    • pool /= Void

    get_twin: BACKTRACKING_ALTERNATIVE_LIST

    Return a twin of current from the pool

    require

    • pool /= Void

    ensure

    • Result.is_equal(Current)

    deferred pool: ABSTRACT_BACKTRACKING_POOL[BACKTRACKING_ALTERNATIVE_LIST]

    The pool that will record Current

    pool_of_sequence: BACKTRACKING_POOL_OF_SEQUENCE
    pool_of_sequence_list: BACKTRACKING_POOL_OF_SEQUENCE_LIST
    pool_of_alternative: BACKTRACKING_POOL_OF_ALTERNATIVE
    pool_of_alternative_list: BACKTRACKING_POOL_OF_ALTERNATIVE_LIST