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 generates code with non-existent out-of-scope variable #208

Open
Programmerino opened this issue Sep 28, 2022 · 0 comments
Open

Expect generates code with non-existent out-of-scope variable #208

Programmerino opened this issue Sep 28, 2022 · 0 comments

Comments

@Programmerino
Copy link

The following code:

expect x <~ categorical([0.5, 0.5]):
    x

generates

(summate x4
 from 0
 to size
      (array x3 of size(x1):
       x1[x3]
       * (x1 = [1/2, 1/2]
          x2 = summate x0 from 0 to size(x1): x1[x0]
          if 0/1 < x2: nat2prob(x3) else: 0/1)):
   (array x3 of size(x1):
    x1[x3]
    * (x1 = [1/2, 1/2]
       x2 = summate x0 from 0 to size(x1): x1[x0]
       if 0/1 < x2: nat2prob(x3) else: 0/1))
     [x4])
/ x2

which is incorrect because:

Name not in scope: x1

4|       (array x3 of size(x1):
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

1 participant