You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prog=compile_pgcl(""" const c := 42 nat x x := c : 1/2 + 2 : 1/2 x := c""")
print(prog)
gives the following output:
const c := 42;
nat x;
x := c : 1/2 + 2 : 1/2;
x := 42;
The constant in the categorical expression isn't substituted. This happens because the different subexpressions in a CategoricalExpr aren't stored as top-level attributes (sensible), but in a list of subexpressions with probabilities. This however means that the built-in walk over the expression doesn't yield these subexpressions due to the way children are discovered in mut_expr_children.
I already changed this on the brand-new branch to enable walking over the parameters of a function call. However, the problem with CategoricalExprs persists, as their subexpressions are stored in tuples, which are immutable and thus don't allow for substitution.
The text was updated successfully, but these errors were encountered:
Running the program
gives the following output:
The constant in the categorical expression isn't substituted. This happens because the different subexpressions in a
CategoricalExpr
aren't stored as top-level attributes (sensible), but in a list of subexpressions with probabilities. This however means that the built-in walk over the expression doesn't yield these subexpressions due to the way children are discovered inmut_expr_children
.I already changed this on the
brand-new
branch to enable walking over the parameters of a function call. However, the problem withCategoricalExpr
s persists, as their subexpressions are stored in tuples, which are immutable and thus don't allow for substitution.The text was updated successfully, but these errors were encountered: