http://www.perlmonks.org?node_id=612622


in reply to Re: How implement AMB in perl?
in thread How implement AMB in perl?

...we perform a depth-first search of the amb choice tree, and whenever we brush against failure, we backtrack to the most recent node of the tree that offers a further choice

That statement screams, regexes, or rather a creative use of them, akin to:

The N-queens problem using pure regexes
Pure regex Hamiltonian Circuit solution


-Enlil