Wiki source code of Comparison of the textual description language
Last modified by wah on 2023/09/11 16:17
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | |=((( | ||
| 2 | |||
| 3 | )))|=((( | ||
| 4 | KIELER SyncCharts | ||
| 5 | )))|=((( | ||
| 6 | YAKINDU SCT | ||
| 7 | )))|=((( | ||
| 8 | |||
| 9 | ))) | ||
| 10 | |(% colspan="1" %)(% colspan="1" %) | ||
| 11 | ((( | ||
| 12 | **Declarations** | ||
| 13 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 14 | ((( | ||
| 15 | **Pure Signals**: signals have a present status: | ||
| 16 | |||
| 17 | * absent or present | ||
| 18 | * must be set for input signals | ||
| 19 | * computed for local and output signals:\\ | ||
| 20 | ** for each tick absent by default unless signal is emitted | ||
| 21 | * Example:\\ | ||
| 22 | ** Emit signal S: S | ||
| 23 | ** Test for presence: S | ||
| 24 | |||
| 25 | **Valued Signals**: | ||
| 26 | |||
| 27 | * are pure signals than additionally are able to store a value | ||
| 28 | * values are persistent across ticks | ||
| 29 | * Example: | ||
| 30 | ** Emit signal V with value 3: V(3) | ||
| 31 | ** Test for presence: V | ||
| 32 | ** Get the last emitted value of V: ?V | ||
| 33 | \\ | ||
| 34 | |||
| 35 | (% style="color: rgb(0,0,0);" %)**Variables: ** | ||
| 36 | |||
| 37 | * (% style="color: rgb(0,0,0);" %)Are not(%%) shared between concurrent regions | ||
| 38 | * Currently implemented by host type variables | ||
| 39 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 40 | ((( | ||
| 41 | **Events**: | ||
| 42 | |||
| 43 | * (% style="color: rgb(0,0,0);" %)interface scope: events can either be ingoing (in event event)(%%) | ||
| 44 | (% style="color: rgb(0,0,0);" %)or outgoing (out event event). | ||
| 45 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)local scope: events are able to store a value.{{code language="none"}}internal: event localEvent : bool{{/code}}(%%) | ||
| 46 | |||
| 47 | {{{}}} | ||
| 48 | |||
| 49 | (% style="color: rgb(0,0,0);" %)**Variables:** | ||
| 50 | |||
| 51 | * variable:{{code language="none"}}var variable: string{{/code}} | ||
| 52 | |||
| 53 | {{{}}}(% style="color: rgb(0,0,0);" %)** ** | ||
| 54 | * read-only variable:{{code language="none"}}var readonly size: int = 10 {{/code}} | ||
| 55 | |||
| 56 | {{{}}} | ||
| 57 | * external variable: can be referenced by the environment | ||
| 58 | {{code language="none"}}var external variable: int = 44External variables are not used at the moment.{{/code}} | ||
| 59 | |||
| 60 | {{{}}} | ||
| 61 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 62 | ((( | ||
| 63 | |||
| 64 | ))) | ||
| 65 | |((( | ||
| 66 | **Types** | ||
| 67 | )))|((( | ||
| 68 | * **int** | ||
| 69 | * **bool** | ||
| 70 | * **string** | ||
| 71 | \\ | ||
| 72 | * **pure**: only makes sense for Signals. Signals are absent or present. | ||
| 73 | * **unsigned** | ||
| 74 | * **float** | ||
| 75 | * **double** | ||
| 76 | * **host: **no actual type is given. The given type in the hostType attribute is used. | ||
| 77 | )))|((( | ||
| 78 | * **integer** | ||
| 79 | * **boolean ** | ||
| 80 | * **string** | ||
| 81 | \\ | ||
| 82 | * **real** | ||
| 83 | * **void** | ||
| 84 | New types are going to be added. A type system abstraction is present. | ||
| 85 | \\ | ||
| 86 | )))|((( | ||
| 87 | |||
| 88 | ))) | ||
| 89 | |((( | ||
| 90 | **Expressions** | ||
| 91 | )))|((( | ||
| 92 | * **Logical AND:** var1 && var2 | ||
| 93 | * **Logical OR:** var1 || var2 | ||
| 94 | * **Logical NOT:** !var1 | ||
| 95 | |||
| 96 | |||
| 97 | {{{(A and B) or ((not C) and D) }}} | ||
| 98 | )))|((( | ||
| 99 | * **Logical AND:** var1 && var2 | ||
| 100 | * **Logical OR:** var1 || var2 | ||
| 101 | * **Logical NOT:** !var1 | ||
| 102 | * **Conditional Expression:** var1 ? var2 : var3 | ||
| 103 | )))|((( | ||
| 104 | |||
| 105 | ))) | ||
| 106 | |((( | ||
| 107 | **Operations** | ||
| 108 | )))|((( | ||
| 109 | * **Equal**: '=' | ||
| 110 | * (% style="color: rgb(0,0,0);" %)**Less Than**(%%)**: '**<' | ||
| 111 | * (% style="color: rgb(0,0,0);" %)**Equal Or Less Than**(%%)**: '**<=' | ||
| 112 | * (% style="color: rgb(0,0,0);" %)**Greater Than**(%%)**:** '>' | ||
| 113 | * (% style="color: rgb(0,0,0);" %)**Equal Or Greater Than**(%%)**:** '>=' | ||
| 114 | * **NOT: '**!=' | ||
| 115 | * **Add**: '+' | ||
| 116 | * **Minus** : '-' | ||
| 117 | * **Multiply**: '*' | ||
| 118 | * **Divide**: '/' | ||
| 119 | * **Modulo**: 'mod' | ||
| 120 | * **Value**: '?' | ||
| 121 | |||
| 122 | {{{?B = 3}}}((( | ||
| 123 | |||
| 124 | ))) | ||
| 125 | * **PRE**: 'pre': | ||
| 126 | |||
| 127 | {{{pre(S):gives the presence status of S at}}} | ||
| 128 | |||
| 129 | {{{the previous tick. }}} | ||
| 130 | |||
| 131 | {{{pre(?S):returns the value of S at the}}} | ||
| 132 | |||
| 133 | {{{previous tick.}}} | ||
| 134 | * **NE**: '<>' | ||
| 135 | )))|((( | ||
| 136 | * **Equal**: '==' | ||
| 137 | * **less than:** '<' | ||
| 138 | * **Equal Or Less Than**: '<=' | ||
| 139 | * **Greater Than**: '>' | ||
| 140 | * **Equal Or Greater Than** '>=' | ||
| 141 | * **Not Equal:** '!=' | ||
| 142 | * **Plus:** '+' | ||
| 143 | * **Minus:** '-' | ||
| 144 | * **Multiply:** '*' | ||
| 145 | * **Divide:** '/' | ||
| 146 | * **Modulo:** '%' | ||
| 147 | * **valueof()** | ||
| 148 | **\\** | ||
| 149 | * **Shift Left**: '<<' | ||
| 150 | * **Shift Right**: '>>' | ||
| 151 | * **Positive: '**+' | ||
| 152 | * **Negative: '**-' | ||
| 153 | * **Complement: **'~~' | ||
| 154 | )))|((( | ||
| 155 | |||
| 156 | ))) | ||
| 157 | |(% colspan="1" %)(% colspan="1" %) | ||
| 158 | ((( | ||
| 159 | **Trigger** | ||
| 160 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 161 | ((( | ||
| 162 | * Simple signal reference: I / O | ||
| 163 | * Boolean expression: | ||
| 164 | |||
| 165 | {{{(A and B) or ((not C) and D)}}} | ||
| 166 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Valued Signals and Variables can be used in conditions in these boolean expressions(% style="color: rgb(0,0,0);" %) | ||
| 167 | |||
| 168 | {{{variable > 1}}} | ||
| 169 | |||
| 170 | {{{?A = 1}}} | ||
| 171 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Comparison(% style="color: rgb(0,0,0);" %) | ||
| 172 | |||
| 173 | {{{?A > (variable + 1)}}} | ||
| 174 | |||
| 175 | {{{A and (3 > ?B) or ((var5 + 2) = 6)}}} | ||
| 176 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Pre | ||
| 177 | |||
| 178 | {{{A and pre(B)}}} | ||
| 179 | |||
| 180 | {{{3 < pre(?A)}}} | ||
| 181 | * ((( | ||
| 182 | Immediate, #S: the trigger is satisfied as soon as the state is entered.. | ||
| 183 | ))) | ||
| 184 | * ((( | ||
| 185 | Count Delays, 3 S | ||
| 186 | |||
| 187 | {{{ }}} | ||
| 188 | ))) | ||
| 189 | * ((( | ||
| 190 | Time in SyncCharts: Multiform notion of time, | ||
| 191 | e.g., signal SECOND appears every second (depending on the physical tick length). | ||
| 192 | |||
| 193 | |||
| 194 | ))) | ||
| 195 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 196 | ((( | ||
| 197 | * **event:** | ||
| 198 | {{code language="none"}}I / raise O{{/code}} | ||
| 199 | |||
| 200 | {{{}}} | ||
| 201 | * **after**:{{code language="none"}}after 20 s{{/code}} | ||
| 202 | |||
| 203 | {{{}}} | ||
| 204 | * **every**{{code language="none"}}every 200 ms{{/code}} | ||
| 205 | |||
| 206 | {{{}}} | ||
| 207 | * **always: ** | ||
| 208 | (% style="color: rgb(0,0,0);" %)enables a reaction to be executed in every run to completion step | ||
| 209 | * (% style="color: rgb(0,0,0);" %)**default: **(%%) | ||
| 210 | (% style="color: rgb(0,0,0);" %)enables a reaction to be executed in every run to completion step | ||
| 211 | * (% style="color: rgb(0,0,0);" %)**else**: (%%) | ||
| 212 | (% style="color: rgb(0,0,0);" %)used in transitions and implies the lowest evaluation priority for that transition. | ||
| 213 | * (% style="color: rgb(0,0,0);" %)**entry** | ||
| 214 | * (% style="color: rgb(0,0,0);" %)**exit** | ||
| 215 | * (% style="color: rgb(0,0,0);" %)**oncycle**(%%) | ||
| 216 | {{code language="none"}}{{/code}} | ||
| 217 | |||
| 218 | {{{}}} | ||
| 219 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 220 | ((( | ||
| 221 | |||
| 222 | ))) | ||
| 223 | |(% colspan="1" %)(% colspan="1" %) | ||
| 224 | ((( | ||
| 225 | **Effects** | ||
| 226 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 227 | ((( | ||
| 228 | * Emission of a simple signal | ||
| 229 | |||
| 230 | {{{/ A}}} | ||
| 231 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Emission of value of a valued Signal | ||
| 232 | |||
| 233 | {{{/ A(3)}}} | ||
| 234 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Assignment of a variable(% style="color: rgb(0,0,0);" %) | ||
| 235 | |||
| 236 | {{{/ varA := 42}}} | ||
| 237 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)Multiple effects get comma- or whitespace separated(% style="color: rgb(0,0,0);" %) | ||
| 238 | |||
| 239 | {{{/ A, B, C(25), varA := 2}}} | ||
| 240 | * (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)New values may use value expressions as explained above | ||
| 241 | |||
| 242 | {{{/ A(3 + pre(?B)), varC := (varD + 1)}}} | ||
| 243 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 244 | ((( | ||
| 245 | * **Assignment of a variable:** S / varA = 5 | ||
| 246 | * **raise** myvar | ||
| 247 | * **myvar = valueof(event)**: (% style="color: rgb(0,0,0);" %)Returns the value of an valued event(%%) | ||
| 248 | (% style="color: rgb(0,0,0);" %) that it passed to the function as parameter. | ||
| 249 | * **mybool = active(StateA)**: (% style="color: rgb(0,0,0);" %)Returns „true” if a state is active or „false” otherwise. | ||
| 250 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 251 | ((( | ||
| 252 | |||
| 253 | ))) | ||
| 254 | |||
| 255 | |||
| 256 | \\ |