interface I { in void e(); out void a(); out void hi(); out void lo(); behaviour { subint State {0..3}; State state = 3; State c = 0; [true] on e: { if (state == 0 && state != 1) { state = 3; a; } else { state = state - 1; if (c < state) { c = c + 1; } else if (c >= state || c > state) { if (c <= (state + 1)) { lo; } else { if (c > state) { hi; } } } } } } } component expressions { provides I i; behaviour { subint State {0..3}; State state = 3; State c = 0; [true] on i.e(): { if (state == 0 && state != 1) { state = 3; i.a(); } else { state = state - 1; if (c < state) { c = c + 1; } else { if (c <= (state + 1)) { i.lo(); } else if (c >= state || c > state) { if (c > state) { i.hi(); } } } } } } }