test_expressions.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" ?>
  2. <test>
  3. <statechart>
  4. <semantics big_step_maximality="take_many"/>
  5. <inport name="in">
  6. <event name="start"/>
  7. </inport>
  8. <outport name="out">
  9. <event name="all_good"/>
  10. </outport>
  11. <root initial="comparisons">
  12. <state id="comparisons" initial="s1">
  13. <state id="s1">
  14. <transition cond="1 == 1" target="../s2"/>
  15. </state>
  16. <state id="s2">
  17. <transition cond="1 != 2" target="../s3"/>
  18. </state>
  19. <state id="s3">
  20. <transition cond="1 &lt; 2" target="../s4"/>
  21. </state>
  22. <state id="s4">
  23. <transition cond="2 &gt; 1" target="../s5"/>
  24. </state>
  25. <state id="s5">
  26. <transition target="/arithmetic"/>
  27. </state>
  28. </state>
  29. <state id="arithmetic" initial="s1">
  30. <state id="s1">
  31. <transition cond="1 + 1 == 2" target="../s2"/>
  32. </state>
  33. <state id="s2">
  34. <transition cond="42 == 52 - 11 + 1" target="../s3"/>
  35. </state>
  36. <state id="s3">
  37. <transition cond="2 * 3 == 6" target="../s4"/>
  38. </state>
  39. <state id="s4">
  40. <transition cond="21 // 3 == 7" target="../s6"/>
  41. </state>
  42. <state id="s5">
  43. <!-- support for exponent operator dropped -->
  44. <!-- <transition cond="256 == 2 ** 2 ** 3" target="../s6"/> -->
  45. </state>
  46. <state id="s6">
  47. <transition cond="5 % 2 == 1" target="../s7"/>
  48. </state>
  49. <state id="s7">
  50. <transition target="/boolean_logic"/>
  51. </state>
  52. </state>
  53. <state id="boolean_logic" initial="s1">
  54. <state id="s1">
  55. <transition cond="True" target="../s2"/>
  56. </state>
  57. <state id="s2">
  58. <transition cond="False or True" target="../s3"/>
  59. </state>
  60. <state id="s3">
  61. <transition cond="True and not False" target="../s4"/>
  62. </state>
  63. <state id="s4">
  64. <transition cond="not (True and False or False)" target="../s5"/>
  65. </state>
  66. <state id="s5">
  67. <transition cond="not (False or False and True)" target="../s6"/>
  68. </state>
  69. <state id="s6">
  70. <transition target="/final"/>
  71. </state>
  72. </state>
  73. <state id="final">
  74. <onentry>
  75. <raise event="all_good" port="out"/>
  76. </onentry>
  77. </state>
  78. </root>
  79. </statechart>
  80. <input>
  81. <event name="start" port="in" time="0 d"/>
  82. </input>
  83. <output>
  84. <big_step>
  85. <event name="all_good" port="out"/>
  86. </big_step>
  87. </output>
  88. </test>