// Backtracking-enabled stacks (BStacks) are very useful for AI // computation because they allow inserting a branching point anywhere // in a computation, even deep inside nested function calls and loops. // // They normally operate serially, always exploring the main branch first // and then optionally backtracking afterwards. // // However, the only thing preventing a BStack from backtracking in // parallel to the main computation is the use of external mutable // objects. With sufficient cloning and/or use immutable data structures, // there is no obstacle to parallelizing. // // A further evolution of BStacks are PStacks. In PStacks, at any poin // in time, every ongoing or potential computation is listed with a // probability value p (usually 0 < p <= 1). // // Computations with higher probability are always pursued first.