Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the following we will describe some basic elements using the famous ABRO example:

Column
width50%
Code Block
languagesct
linenumberstrue
@HVLayout
scchart ABRO {
  input bool A, B, R;
  output bool O = false; 
  region Main:
  initial state ABO "ABthenO" {
    entry / O = false;
    initial state WaitAandB {
      region HandleA: 
      initial state wA 
      --> dA with A;
      final state dA;
      region HandleB:
      initial state wB
      --> dB with B;
      final state dB;
    }
    >-> done with / O = true;
    final state done;
  }
  o-> ABO with R;
}           

...

  1. In the first line you see how an SCChart is defined using the scchart keyword where the ID of the SCChart will be ABRO. An optional label can be inserted after ABRO using "<LABEL>".
  2. In the next three lines variables are declared, namely, A, B, R and O, where O is initialized with the value false. A, B, and R are inputs which must not be initialized and get there valued from the environment.
  3. An SCChart typically contains concurrent regions which are introduced with the keyword region as shown in Line 69.
  4. Every region must at least have one state, and every region must exactly have one initial state. An initial state ABO is defined for region Main in Line 76.
  5. Every state is terminated by a ; as shown in line 11 for state HandleA.
  6. If you like to specify internal behavior of a state, you can add concurrent regions to a state in { <regions> } as done for state ABO or state WaitAB.
  7. Transitions outgoing from a state must be declared right before a state is terminated with ;. For example a transition from state WA wA to state DA dA is declared in Line 11.
  8. Transitions can have triggers and effects which are separated by a dash: <trigger>/<effects>. Multiple sequential effects are separated by a ;. The transition in Line 11 declares just a trigger A (a dash is not necessary in this case), while the transition from line 18 declares only an effect O = true (here the dash is mandatory).
  9. There are three types of transitions: 1. normal/weak abort transitions -->,  2. strong abort transitions o-> and 3. termination/join transitions >->.

...