plum-umd / abstracting-definitional-interpreters

Abstracting Definitional Interpreters
67 stars 2 forks source link

monad for nd and finite store #13

Closed dvanhorn closed 8 years ago

dvanhorn commented 8 years ago

Can someone implement a monad with non-determinism and a set-based store (that joins)? Basically it should be like monad-pdcfa minus all the cache stuff.

philnguyen commented 8 years ago

Is this already achievable by existing units? (Using monad-nd.rkt and state-nd.rkt)

Example:

#lang monadic-eval (monad-nd@ alloc-0cfa@ state-nd@ δ@ ev!@) (fix ev!)

((λ (f) (+ (f 1) (f 2))) (λ (x) x))

;; ==>
;; (set '(2 . (("x" . #<set: 1 2>) ("f" . #<set: ((lam x (vbl x)) . ())>)))
;;      '(3 . (("x" . #<set: 1 2>) ("f" . #<set: ((lam x (vbl x)) . ())>))))
dvanhorn commented 8 years ago

Thanks!

On Mon, Mar 14, 2016 at 6:43 PM, Phil Nguyen notifications@github.com wrote:

Is this already achievable by existing modules?

Example:

lang monadic-eval (monad-nd@ alloc-0cfa@ state-nd@ δ@ ev!@) (fix ev!)

((λ (f) (+ (f 1) (f 2))) (λ (x) x)) ;; ==>;; (set '(2 . (("x" . #<set: 1 2>) ("f" . #<set: ((lam x (vbl x)) . ())>)));; '(3 . (("x" . #<set: 1 2>) ("f" . #<set: ((lam x (vbl x)) . ())>))))

— Reply to this email directly or view it on GitHub https://github.com/dvanhorn/monadic-eval/issues/13#issuecomment-196552622 .

labichn commented 8 years ago

Pushed in bff24202b096db0517ba421998e1b029db598425.