The typechecker should issue warnings (not errors!) in cases where a sub-action of a parallel operation that uses namesets might assign to a variable that is not in its corresponding nameset.
This should only be a warning; it's perfectly valid to assign to a variable not in your corresponding nameset, but any changes will be thrown away. This is analogous to shadowed variables in regular VDM.
In the below example, there should be warnings at the interleave construct for AssignOp and AssignAct: AssignOp modifies y and AssignAct modifies x, but neither have those variables in their namesets. The last assignment to z is fine, as the corresponding nameset contains z.
process A = begin state x : int := 0 y : int := 0 z : int := 0 operations AssignOp : () ==> () AssignOp == y := 1 actions AssignAct = x := 1 @ AssignOp() [|| {} | {} ||] AssignAct [|| {} | {z} ||] z := 1 end
I'm not sure what the problem is here. The errors reported are defiantly right:
1: This "AssignOp == y := 1" is not a valid input for the parser. It is missing the "()"
2: When this is fixed then AssignOp is used in a place where only an action is allowed.
The fixed model does not contain any errors or warnings so I'm not sure what error it is that is reported wrong.
Does this then mean that the type checker should have a more strict check that detects the cases mentioned above where warnings should have been generated
Don't set this to cannot-reproduce --- it is a new feature request. Talk to me about what is required.
Example code above fixed.
Last edit: Joey Coleman 2014-01-03
Diff: