diff options
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 |