-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathTransitionTrigger.lf
54 lines (45 loc) · 1.07 KB
/
TransitionTrigger.lf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* The modal model fails to transition to mode B.
* Uncommenting an irrelevant reaction, however, makes the test pass.
*/
target C
reactor Source {
output x:bool;
output y:bool;
reaction(startup) -> x, y {=
lf_set(y, true);
=}
}
reactor Destination {
input x:bool;
input y:bool;
state reached_b:bool(false);
// FIXME: Uncommenting the following causes this test to pass.
// reaction(y, x) {= =}
// FIXME: Uncommenting the following does NOT cause this test to pass.
// reaction(y) {= =}
initial mode A {
reaction(y) -> B {=
if (y->value) {
lf_set_mode(B);
}
=}
}
mode B {
reaction(reset) {=
lf_print("*** Reached B.");
self->reached_b = true;
=}
}
reaction(shutdown) {=
if (!self->reached_b) {
lf_print_error_and_exit("Failed to reach mode B!");
}
=}
}
main reactor {
ui = new Source()
dlc = new Destination()
ui.x -> dlc.x
ui.y -> dlc.y
}