summaryrefslogblamecommitdiff
path: root/tests/source/updown.scade
blob: c736dd8c4e9119d94726a5e41942dec217246777 (plain) (tree)
1
2
3
4
5
6
7
8
9





                                   


                               
                                        


                               
                                       

              
                                                    








                                                   
const bound: int = 7;

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

        state DOWN
        let x = last_x - 1; tel
        until if x <= -bound resume UP;

    returns x;
    guarantee x_bounded: x >= -bound and x <= bound;
tel

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