RecordFlux icon indicating copy to clipboard operation
RecordFlux copied to clipboard

Statically false links are not checked if at least one valid link exists

Open jklmnn opened this issue 5 years ago • 0 comments

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;

jklmnn avatar Sep 10 '20 13:09 jklmnn