Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: How implement AMB in perl?

by Enlil (Parson)
on Apr 29, 2007 at 09:30 UTC ( #612622=note: print w/ replies, xml ) Need Help??


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


Comment on Re^2: How implement AMB in perl?
Re^3: How implement AMB in perl?
by dk (Chaplain) on Apr 29, 2007 at 09:40 UTC
    That'd be also interesting indeed, except that regexes should operate on the OP-tree, not a string. Shouldn't be a too big problem with (??{}) and friends though.
      I tried hard to use a regex (??{}) solution for my Pentominos Solving Quine, but in a recursion scenario, there are some issues with re-entrancy which can cause (at least some versions of) perl's interpreter to crash.

      If you don't have to recurse, then by all means, any backtracking problem you can implement in the regex engine is fiendishly clever. Of course, "clever code" is for fun, not generally for maintainable code.

      --
      [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://612622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2014-07-31 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls