1

Conceputally I understand the part that the success and failure continuation callbacks play in the overall process. It seems that the success continuations kind of "sink down" and push things forward while the failure continuations "pop up" from the bottom (the latest amb expression) and has this effect of last in(found) first out(called) agenda(stack). Strikingly though the fail callback magically ends up as the second argument of the success callback! I mean they are clearly going different ways and how something like this is designed in the first place. Then when it comes to interpretation context I find it hard to follow the process step by step. For instance:

((amb foo bar) (amb 10 20) (amb 'well 'ok))

Are there other ways to implement this amb evaluator in the book?

user1206899
  • 1,196
  • 1
  • 7
  • 14
  • for some different ways to code up non-deterministic computations see e.g. [this my answer](https://stackoverflow.com/questions/50086393/representing-an-amount-of-money-with-specific-bills/50087510#50087510) and also the links in it. there's also [tag:recursive-backtracking]. also some discussion in [another answer](https://stackoverflow.com/questions/61215062/why-after-pressing-semicolon-program-is-back-in-deep-recursion/61216006#61216006) of mine. – Will Ness Apr 28 '20 at 18:36

0 Answers0