Skip to content

Fix CIF simulator for empty initial predicates initialization

The CIF simulator generates a multiple-initial location error for the following CIF specification. Even though the automaton has exactly one initial location.

automaton X:
  disc bool var = L1;
  location L0:
    initial;
  location L1;
end
ERROR: Automaton "X" has multiple possible initial locations, which is currently not supported by the CIF simulator. Restrict the initialization using the appropriate simulation option.

Problem is that initialization code is generated for L1, because it is needed to initialize var. Since L1 has no initial statement, it has no initialization predicates. The method gencodePreds returns true for an empty predicate set, whereas it should return false. Note that gencodePreds is also used for guard predicates. In that case, a true return is correct.

Edited by Dennis Hendriks