state transition with different guard condition

寵の児 提交于 2019-12-04 16:50:43

That's pretty standard see e.g. this example.

[Edited on basis it's not homework!]

Assuming I understand right:

  • You have one event (X) which can trigger one of two possible transitions
  • Selecting which transition to fire is made according to which condition holds true (C1 or C2)

If so that's a standard case for using guard conditions. The syntax would be:

  • X[C1] as the label on the transition A->B, and
  • X[C2] on the transition A->C.

C1 & C2 must evaluate to booleans, so it would be fine to substitute var==2 as per your comment. i.e. the labels would become X[var==2] and X[var==3].

For it to be semantically correct, C1 & C2 must be mutually exclusive in state A - otherwise you have non-determinism.

hth.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!