fail_guard_readonly.xml 827 B

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0" ?>
  2. <test>
  3. <!-- A guard condition's evaluation is not allowed to write to the statechart's variables -->
  4. <statechart>
  5. <semantics
  6. big_step_maximality="take_many"/>
  7. <datamodel>
  8. x = 0;
  9. inc_x = func {
  10. x += 1;
  11. # to make the type checker happy (expression 'inc_x()' should evaluate to boolean so it is a valid guard condition):
  12. return False;
  13. };
  14. </datamodel>
  15. <inport name="in">
  16. <event name="start"/>
  17. </inport>
  18. <root>
  19. <state id="s1">
  20. <!-- Guard condition will write to the statechart's variable 'x'.
  21. This results in a runtime error -->
  22. <transition cond="inc_x()" target="."/>
  23. </state>
  24. </root>
  25. </statechart>
  26. <input>
  27. <event name="start" port="in" time="0 d"/>
  28. </input>
  29. </test>