Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect transformation lost a binder #203

Open
ccshan opened this issue Sep 10, 2019 · 3 comments
Open

Expect transformation lost a binder #203

ccshan opened this issue Sep 10, 2019 · 3 comments

Comments

@ccshan
Copy link
Member

ccshan commented Sep 10, 2019

$ cat try.hk
expect
  _ <~
    x <~ y <~ lebesgue(-inf,inf)
         if 0<y: dirac(y) else: reject.measure(real)
    dirac(x)
  : 1
$ pretty try.hk 
x3 = -prob2real(∞)
x4 = prob2real(∞)
if nat2real(0) < x5: nat2prob(1) else: 0/1

The variable x5 produced above is unbound.

@zaxtax
Copy link
Member

zaxtax commented Sep 13, 2019

The correct output should be the following right?

x3 = -prob2real(∞)
x4 = prob2real(∞)
integrate x5 from x3 to x4:
    if nat2real(0) < x5: nat2prob(1) else: 0/1

@ccshan
Copy link
Member Author

ccshan commented Sep 13, 2019

That output is correct!

@zaxtax
Copy link
Member

zaxtax commented Sep 13, 2019

Ok I think my recent change fixed the problem, but I'm not entirely confident if my change is the correct thing to do. I'm looking over Preserving Sharing in the Partial Evaluation of Lazy Functional Programs to see if I should have residualized the heap somewhere else instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants