I am CCing squeak-dev because Stéphane Rollandin is active on that list. Stef did the Squeak implementation and can probably answer your questions.
Dave
On Sat, Mar 31, 2018 at 03:51:22PM -0700, Sean P. DeNigris wrote:
Is anyone familiar with the AMB project, installable from SqMap catalog?
I got excited by the description's assertion that "it can do incredible things" (it even provided an example. After reading the description, tests, code, and references, I have an inkling what it does, but don't quite understand what is "incredible" about it and don't want to miss the magic!!
The catalog description is:
This is the "ambigous", "nondeterminist", "angelic" operator aka amb
... more seriously described as a declarative control flow statement able to enumerate over finite domains all values that make a program terminate. It uses continuations to walk the tree of possible tuples, backtracking when the program fails.
The amazing thing is the simplicity of the code: four short or very short methods on the instance side, the class side methods only providing syntactic sugar.
And it can do incredible things such as:
AMB assert: [:string :n :char | (string occurrencesOf: char) = n] over: #('maman' 'barbapapa' 'guiliguili' 'arthur' 'chtulu') and: #(2 4 1) and: #($m $b $a $i $u)
See AMBTest for more magic.
I would have been unable to implement this by myself ! This is a port of the code by Dorai Sitaram which is the reference documentation for amb:
http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-16.html#node_cha...
Cheers, Sean -- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
I would have been unable to implement this by myself ! This is a port of the code by Dorai Sitaram which is the reference documentation for amb:
http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-16.html#node_cha...
It seems the proper address is now http://ds26gte.github.io/tyscheme/index-Z-H-16.html#node_idx_470
Everything is explained there.
Stef
Stéphane Rollandin wrote
Everything is explained there.
Thank you for the pointer. I did read the docs, and it's not that I don't understand the mechanics of using the class, it's just that I don't understand why people are excited about it. I was wondering what it enables or makes significantly easier or more powerful that one would bother loading a project with just those handful of methods. I have a sense that I'm missing some important meaning here…
----- Cheers, Sean -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
Thank you for the pointer. I did read the docs, and it's not that I don't understand the mechanics of using the class, it's just that I don't understand why people are excited about it. I was wondering what it enables or makes significantly easier or more powerful that one would bother loading a project with just those handful of methods. I have a sense that I'm missing some important meaning here…
Well the way I see it is that it allows whole classes of contraint systems to be handled in a declarative way. That's only one of its aspect, actually: like all continuation-based construct, it is not too intuitive at first.
In my own experience, in music composition, I used it for example to generate the complete set of rhythmic cells of the same length that can be composed from beats of different values.
Stef
squeak-dev@lists.squeakfoundation.org