;;;; amb-pythagorean.scm ;;;; From "Continuations by example" ..." by Matt Might (require-extension amb) (let ((a (amb 1 2 3 4 5 6 7)) (b (amb 1 2 3 4 5 6 7)) (c (amb 1 2 3 4 5 6 7))) ; We're looking for dimensions of a legal right ; triangle using the Pythagorean theorem: (amb-assert (= (* c c) (+ (* a a) (* b b)))) ; And, we want the second side to be the shorter one: (amb-assert (< b a)) ; Print out the answer: (print " a = " a ", b = " b ", c = " c))