Simple state restoration for backtracking search algorithms using a trail.
During a typical branching search algorithm, the search state must be cloned at each branch
point in order to explore the branches independently.
contrail provides a framework to create
search algorithms that only require a partial clone of the search state at each branch point.
This is facilitated by the trail, a struct where all search state is stored.
This library is based on the memory model used by Minion, a C++ constraint satisfaction problem solver.
The main limitation of contrail is that once a trail has been created using a trail builder, nothing can be added to the trail. This is to prevent dangling pointers.
Low-level memory management.
High-level memory management.
A reference to a fixed-length array of values stored on the trail.
An iterator over the values of an
The trail itself.
A builder to create a
A reference to a value stored on the trail.
A fixed-length array stored on the trail in backtrackable memory.
A value stored on the trail in backtrackable memory.
A fixed-length array stored on the trail in non-backtrackable memory.
A value stored on the trail in non-backtrackable memory.