Associativity ignored on indirect SDF sort
This syntax, where the
Add
constructor is indirectly (throughBinOp
) defined onExp
:Exp.Var = <<ID>> Exp = BinOp BinOp.Add = <<Exp> + <Exp>> {left}
parses the following example:
x + y + z
ambiguously:
amb([ Add(Add(Var("x"), Var("y")), Var("z")), Add(Var("x"), Add(Var("y"), Var("z"))) ])
because the associativity is ignored.
However, defining the
Add
constructor directly onExp
:Exp.Var = <<ID>> Exp.Add = <<Exp> + <Exp>> {left}
works as expected.
Submitted by D. Pelsmaeker on 14 August 2014 at 14:31