statechart_semantics.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?xml version="1.0" ?>
  2. <statechart>
  3. <semantics
  4. big_step_maximality="take_one, syntactic, take_many"
  5. combo_step_maximality="take_one, syntactic, take_many"
  6. input_event_lifeline="first_small_step, first_combo_step, whole"
  7. internal_event_lifeline="next_small_step, next_combo_step, remainder, queue"
  8. enabledness_memory_protocol="small_step, combo_step, big_step"
  9. assignment_memory_protocol="small_step, combo_step, big_step"
  10. same_source_priority="explicit"
  11. hierarchical_priority="source_child, source_parent"
  12. orthogonal_priority="explicit"
  13. concurrency="single"/>
  14. <datamodel>
  15. x = 0;
  16. </datamodel>
  17. <inport name="in">
  18. <event name="input0"/>
  19. <event name="bigstep1"/>
  20. </inport>
  21. <root>
  22. <parallel id="P">
  23. <state id="BigStepMaximality" initial="Initial">
  24. <state id="Initial">
  25. <transition target="../TakeOne"/>
  26. </state>
  27. <state id="TakeOne">
  28. <transition target="../Syntactic"/>
  29. </state>
  30. <state id="Syntactic" stable="true">
  31. <transition target="../TakeMany"/>
  32. </state>
  33. <state id="TakeMany">
  34. </state>
  35. </state>
  36. <state id="InputEventLifeline" initial="FirstSmallStep">
  37. <!-- because BigStepMaximality region has higher priority,
  38. it will 'consume' the input event upon FirstSmallStep -->
  39. <state id="FirstSmallStep">
  40. <transition event="input0" target="../Whole"/>
  41. </state>
  42. <state id="Whole">
  43. <transition event="not input0" target="../FirstComboStep"/>
  44. </state>
  45. <state id="FirstComboStep">
  46. </state>
  47. </state>
  48. <parallel id="InternalEventLifeline" >
  49. <state id="RegionBroadcast" initial="Initial">
  50. <state id="Initial">
  51. <transition target="../Done">
  52. <raise event="internal0"/>
  53. </transition>
  54. </state>
  55. <state id="Done"/>
  56. </state>
  57. <state id="RegionReceive1" initial="Initial">
  58. <state id="Initial">
  59. <transition event="internal0" target="../GotEvent"/>
  60. </state>
  61. <state id="GotEvent">
  62. </state>
  63. </state>
  64. <state id="RegionReceive2" initial="Initial">
  65. <state id="Initial">
  66. <transition event="internal0" target="../GotEvent"/>
  67. </state>
  68. <state id="GotEvent">
  69. </state>
  70. </state>
  71. <state id="InternalEventLifeline" initial="Initial">
  72. <!-- <state id="NonRemainder" initial="Initial"> -->
  73. <state id="Initial">
  74. <transition cond='@in("/P/InternalEventLifeline/RegionReceive1/GotEvent") and not @in("/P/InternalEventLifeline/RegionReceive2/GotEvent")' target="../NextSmallStep"/>
  75. <transition cond='@in("/P/InternalEventLifeline/RegionReceive1/GotEvent") and @in("/P/InternalEventLifeline/RegionReceive2/GotEvent")' target="../Remainder"/>
  76. <transition target="../Queue"/>
  77. </state>
  78. <state id="NextSmallStep">
  79. </state>
  80. <state id="Remainder">
  81. </state>
  82. <state id="NextComboStep">
  83. </state>
  84. <state id="Queue">
  85. <transition cond='@in("/P/InternalEventLifeline/RegionReceive1/GotEvent") and @in("/P/InternalEventLifeline/RegionReceive2/GotEvent")' target="../NextComboStep"/>
  86. </state>
  87. </state>
  88. </parallel>
  89. <parallel id="MemoryProtocol">
  90. <state id="RegionAssign" initial="Initial">
  91. <state id="Initial">
  92. <transition target="../Assigned">
  93. <code> x = 1; </code>
  94. </transition>
  95. </state>
  96. <state id="Assigned">
  97. </state>
  98. </state>
  99. <state id="MemoryProtocol" initial="Initial">
  100. <state id="Initial">
  101. <transition cond="x == 1" target="../SmallStep"/>
  102. <transition cond="x == 0" target="../BigStep"/>
  103. </state>
  104. <state id="BigStep">
  105. <transition cond="x == 1" target="../ComboStep"/>
  106. </state>
  107. <state id="ComboStep">
  108. </state>
  109. <state id="SmallStep">
  110. </state>
  111. </state>
  112. </parallel>
  113. <state id="Priority" initial="Composite">
  114. <state id="Composite">
  115. <state id="Basic">
  116. <transition target="../../SourceChild"/>
  117. </state>
  118. <transition target="../SourceParent"/>
  119. </state>
  120. <state id="SourceParent"/>
  121. <state id="SourceChild"/>
  122. </state>
  123. <parallel id="ComboStepMaximality">
  124. <state id="InputEventDeducer" initial="Initial">
  125. <!-- suppose Input Event Lifeline is first_combo_step, then the "final" state of this region will indicate combo step maximality -->
  126. <state id="Initial">
  127. <transition event="input0" target="../TakeOne"/>
  128. </state>
  129. <state id="TakeOne">
  130. <transition event="input0" target="../Syntactic"/>
  131. </state>
  132. <state id="Syntactic" stable="true">
  133. <transition event="input0" target="../TakeMany"/>
  134. </state>
  135. <state id="TakeMany">
  136. </state>
  137. </state>
  138. <state id="InternalEventDeducer" initial="Initial">
  139. <!-- suppose Internal Event Lifeline is next_combo_step, then the "final" state of this region will indicate combo step maximality -->
  140. <state id="Initial">
  141. <transition event="internal0" target="../TakeOne"/>
  142. </state>
  143. <state id="TakeOne">
  144. <transition event="internal0" target="../Syntactic"/>
  145. </state>
  146. <state id="Syntactic" stable="true">
  147. <transition event="internal0" target="../TakeMany"/>
  148. </state>
  149. <state id="TakeMany">
  150. </state>
  151. </state>
  152. <state id="MemoryProtocolDeducer" initial="Initial">
  153. <!-- suppose Memory Protocol is combo_step, then the "final" state of this region will indicate combo step maximality -->
  154. <state id="Initial">
  155. <transition cond="x == 0" target="../TakeOne">
  156. <!-- <code> y = 1; </code> y will be 1 in the next combo step -->
  157. </transition>
  158. </state>
  159. <state id="TakeOne">
  160. <transition cond="x == 0" target="../Syntactic"/>
  161. </state>
  162. <state id="Syntactic" stable="true">
  163. <transition cond="x == 0" target="../TakeMany"/>
  164. </state>
  165. <state id="TakeMany">
  166. </state>
  167. </state>
  168. <state id="ComboStepMaximality" initial="NoComboSteps">
  169. <state id="NoComboSteps">
  170. <transition event="not input0" cond='@in("/P/InputEventLifeline/FirstComboStep") and @in("/P/ComboStepMaximality/InputEventDeducer/TakeOne")' target="../TakeOne"/>
  171. <transition event="not input0" cond='@in("/P/InputEventLifeline/FirstComboStep") and @in("/P/ComboStepMaximality/InputEventDeducer/Syntactic")' target="../Syntactic"/>
  172. <transition event="not input0" cond='@in("/P/InputEventLifeline/FirstComboStep") and @in("/P/ComboStepMaximality/InputEventDeducer/TakeMany")' target="../TakeMany"/>
  173. <transition event="not internal0" cond='@in("/P/InternalEventLifeline/InternalEventLifeline/NextComboStep") and @in("/P/ComboStepMaximality/InternalEventDeducer/TakeOne")' target="../TakeOne"/>
  174. <transition event="not internal0" cond='@in("/P/InternalEventLifeline/InternalEventLifeline/NextComboStep") and @in("/P/ComboStepMaximality/InternalEventDeducer/Syntactic")' target="../Syntactic"/>
  175. <transition event="not internal0" cond='@in("/P/InternalEventLifeline/InternalEventLifeline/NextComboStep") and @in("/P/ComboStepMaximality/InternalEventDeducer/TakeMany")' target="../TakeMany"/>
  176. <transition cond='x == 1 and @in("/P/MemoryProtocol/MemoryProtocol/ComboStep") and @in("/P/ComboStepMaximality/MemoryProtocolDeducer/TakeOne")' target="../TakeOne"/>
  177. <transition cond='x == 1 and @in("/P/MemoryProtocol/MemoryProtocol/ComboStep") and @in("/P/ComboStepMaximality/MemoryProtocolDeducer/Syntactic")' target="../Syntactic"/>
  178. <transition cond='x == 1 and @in("/P/MemoryProtocol/MemoryProtocol/ComboStep") and @in("/P/ComboStepMaximality/MemoryProtocolDeducer/TakeMany")' target="../TakeMany"/>
  179. </state>
  180. <state id="TakeOne"/>
  181. <state id="Syntactic"/>
  182. <state id="TakeMany"/>
  183. </state>
  184. </parallel>
  185. </parallel>
  186. </root>
  187. </statechart>