RecordFlux
RecordFlux copied to clipboard
Statically false links are not checked if at least one valid link exists
Messages can contain statically false links if at least one similar link exists that can become true. The following code should produce an error:
from rflx.model import Message, ModularInteger, INITIAL, FINAL, Field, Link
from rflx.expression import Number, TRUE, FALSE
message = Message(
"P.M",
[
Link(INITIAL, Field("F")),
Link(Field("F"), FINAL, condition=FALSE),
Link(Field("F"), FINAL, condition=TRUE),
],
{Field("F"): ModularInteger("P.Mod", Number(256))}
)
print(message)
It produces the following message:
type M is
message
F : Mod
then null
if False
then null;
end message;