A2b_v1 fertig
This commit is contained in:
parent
cf0f988c9c
commit
e41bd51c77
4
mCRL2/TrafiicLights/v1/v1.mcrl2proj
Normal file
4
mCRL2/TrafiicLights/v1/v1.mcrl2proj
Normal file
@ -0,0 +1,4 @@
|
||||
<root>
|
||||
<spec>v1_spec.mcrl2</spec>
|
||||
<properties/>
|
||||
</root>
|
BIN
mCRL2/TrafiicLights/v1/v1_spec.lps
Normal file
BIN
mCRL2/TrafiicLights/v1/v1_spec.lps
Normal file
Binary file not shown.
BIN
mCRL2/TrafiicLights/v1/v1_spec.lts
Normal file
BIN
mCRL2/TrafiicLights/v1/v1_spec.lts
Normal file
Binary file not shown.
32
mCRL2/TrafiicLights/v1/v1_spec.mcrl2
Normal file
32
mCRL2/TrafiicLights/v1/v1_spec.mcrl2
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
sort
|
||||
CardinalDirection = struct north | east | south | west;
|
||||
|
||||
|
||||
sort
|
||||
Colour = struct red | green | yellow;
|
||||
|
||||
map
|
||||
nextColour: Colour -> Colour;
|
||||
|
||||
eqn
|
||||
nextColour(red) = green;
|
||||
nextColour(green) = yellow;
|
||||
nextColour(yellow) = red;
|
||||
|
||||
act
|
||||
show : CardinalDirection # Colour;
|
||||
|
||||
proc
|
||||
TrafficLight(direction : CardinalDirection) = TF(direction, red);
|
||||
|
||||
TF(direction : CardinalDirection, colour : Colour) =
|
||||
show(direction, colour).
|
||||
TF(direction, nextColour(colour))
|
||||
;
|
||||
|
||||
|
||||
|
||||
init
|
||||
TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west)
|
||||
;
|
Loading…
Reference in New Issue
Block a user