summaryrefslogtreecommitdiff
path: root/tests/source/updown_fail.scade
blob: b6280ef2506d4bbd289d813725242d08ffed8d4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const bound: int = 7;

node updown() returns(probe x: int)
let
    automaton
        initial state UP
        let x = (0 -> pre x) + 1; tel
        until if x >= bound resume DOWN;

        state DOWN
        let x = (0 -> pre x) - 1; tel
        until if x <= -bound resume UP;

    returns x;
tel

node test(i: int) returns(a, b, c: int; exit: bool)
let
    exit = i >= 30;
    a = updown();
    b = 0;
    c = 0;
tel