I just discovered an article about an implementation of McCarthy's amb operator in Ruby, written by Erid Kidd. What a gem, it's a beautiful construction.
It uses continuations to implement backtracking and provides a straight-forward way of representing constraint satisfaction problems in Ruby.
Find the details, implementation and article here: www.randomhacks.net.
It's also the subject of a Ruby Quiz. Here is an other implementation in scheme with a detailed description.
Friday, June 8, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment