Skip to content
Snippets Groups Projects
activation2.lus 542 B
-- nonreg: --expand-nodes

node up(in: int) returns (out: int);
let
  out = pre(in) + 1 ;
tel

node down(in: int) returns (out: int);
let
  out = pre(in) - 1 ;
tel

node activation2(evt: bool) returns (scie: int);
var
  go_up : bool;
let
  go_up = true -> if (pre(scie)>=5) then false
                  else if (pre(scie)<=0) then true
                       else pre(go_up);
  
  scie = 0 -> if evt then ( if (go_up)
                            then up(scie)
                            else down(scie) )
              else pre(scie) ;

tel