diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-16 09:56:14 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-16 09:56:14 +0200 |
commit | b5fd9598302b3e7ac8ab75c36d5a7290d1ad0d78 (patch) | |
tree | 7c77be891d558ce8dfed8a92f61dda43f8a3d533 /tests/source | |
parent | a1eb0c8e58495358e96d864c72613de162a32f38 (diff) | |
download | scade-analyzer-b5fd9598302b3e7ac8ab75c36d5a7290d1ad0d78.tar.gz scade-analyzer-b5fd9598302b3e7ac8ab75c36d5a7290d1ad0d78.zip |
Implement automata and activate blocks in interpret.
Diffstat (limited to 'tests/source')
-rw-r--r-- | tests/source/train.scade | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/source/train.scade b/tests/source/train.scade index c51971e..0b93b2f 100644 --- a/tests/source/train.scade +++ b/tests/source/train.scade @@ -9,8 +9,7 @@ let else 0); tel -node train(beacon, second: bool) returns (early, late: bool) -var probe advance: int; +node train(beacon, second: bool) returns (early, late: bool; probe advance: int) let advance = diff(beacon, second); @@ -50,9 +49,9 @@ let returns alarm; tel -node train_check(beacon, second: bool) returns (early, late, alarm: bool) +node train_check(beacon, second: bool) returns (early, late, alarm: bool; adv: int) let - early, late = train(beacon, second); + early, late, adv = train(beacon, second); alarm = observer(early, late); guarantee ok : not alarm; tel @@ -61,9 +60,8 @@ node test(i: int) returns(a, b, c: int; exit: bool) var early, late, alarm: bool; let exit = i >= 100; - early, late, alarm = train_check((i+1) mod 2 = 0, i mod 3 = 0); + early, late, alarm, a = train_check((i+1) mod 2 = 0, i mod 3 = 0); c = if alarm then 1 else 0; - a = if early then 1 else 0; - b = if late then 1 else 0; + b = if early then 1 else if late then 2 else 0; tel |