McCarthy's Ambiguous Operator (2005)
randomhacks.net
McCarthy's Ambiguous Operator (2005)
1–10 of 43 posts
Re: McCarthy's Ambiguous Operator (2005)
#2Re: McCarthy's Ambiguous Operator (2005)
#3 do x
which can be equivalently reworded as the list comprehension: [(x, y) | x
i.e., the underlying structure of amb without side-effects can also be understood as just a search of the input space for values that fulfill some criteria, rather than as backtracking via continuations.Re: McCarthy's Ambiguous Operator (2005)
#4amb without side-effects can also be expressed in terms of the List monad, e.g.: do x which can be equivalently reworded as the list comprehension: [(x, y) | x i.e., the underlying structure of amb without side-effects can also be understood as just a search of the input space for values that fulfill some criteria, rather than as backtracking via continuations.
Re: McCarthy's Ambiguous Operator (2005)
#5"Here, have some inputs. From those, find me the ones that satisfy this goal."
Re: McCarthy's Ambiguous Operator (2005)
#6Re: McCarthy's Ambiguous Operator (2005)
#7This actually sounds very Prologesque. "Here, have some inputs. From those, find me the ones that satisfy this goal."
Re: McCarthy's Ambiguous Operator (2005)
#8Re: McCarthy's Ambiguous Operator (2005)
#9amb without side-effects can also be expressed in terms of the List monad, e.g.: do x which can be equivalently reworded as the list comprehension: [(x, y) | x i.e., the underlying structure of amb without side-effects can also be understood as just a search of the input space for values that fulfill some criteria, rather than as backtracking via continuations.
`amb` merges the assignments and predicate - this is important because you may not know your argument count statically, i.e. if your arguments are a list. But beyond that, `amb` may backtrack an arbitrarily deep call stack, so the the error return does not need to be expressed explicitly. You may think that is good or bad but it is not the same as the Haskell solution.
Re: McCarthy's Ambiguous Operator (2005)
#10SICP spends many pages on this.
https://mitpress.mit.edu/sites/default/files/sicp/full-text/...