EastWest
:
TrafficLight
[
leftGreenArrow
]
WestEast
:
TrafficLight
[
no
leftGreenArrow
]
[
Canada
&&
no
Quebec
]
[
vertical
]
[
no
RightGreenArrow
]
[
no
countdownTimer
]
[
leftArrow
&&
no
greenFlashing
]
abstract
TrafficLight
red
:
Lamp
yellow
:
Lamp
green
:
Lamp
leftGreenArrow
:
Lamp
?
[
LeftGreenArrow
]
[
leftArrow
]
rightGreenArrow
:
Lamp
?
[
RightGreenArrow
]
arrowsOff
?
[
arrowsOff
<=>
no
leftGreenArrow
.
on
&&
no
leftGreenArrow
.
flashing
]
[
arrowsOff
<=>
no
rightGreenArrow
.
on
&&
no
rightGreenArrow
.
flashing
]
emergencyVehicle
?
xor
TrafficSignals
[
emergencyVehicle
=>
if
allWayYellow
then
some
allYellow
else
some
warning
]
proceed
[
no
emergencyVehicle
]
[
red
.
off
]
[
yellow
.
off
]
[
green
.
on
]
[
leftGreenArrow
=>
leftGreenArrow
.
on
]
[
rightGreenArrow
=>
rightGreenArrow
.
on
]
prepareToStop
[
no
emergencyVehicle
]
[
red
.
off
]
[
yellow
.
on
]
[
green
.
off
]
[
arrowsOff
]
stop
[
no
emergencyVehicle
]
[
red
.
on
]
[
yellow
.
off
]
[
green
.
off
]
[
arrowsOff
]
warning
[
red
.
off
]
[
yellow
.
flashing
]
[
green
.
off
]
[
arrowsOff
]
prepareToGo
[
no
emergencyVehicle
]
[
redAndYellowToGreen
]
[
red
.
on
]
[
yellow
.
on
]
[
green
.
off
]
[
arrowsOff
]
allStop
[
no
emergencyVehicle
]
[
allWayFlashingRedAsStop
]
[
red
.
flashing
]
[
yellow
.
off
]
[
green
.
off
]
[
arrowsOff
]
allYellow
[
allWayYellow
]
[
red
.
off
]
[
yellow
.
flashing
]
[
green
.
off
]
[
arrowsOff
]
advancedLeft
[
no
emergencyVehicle
]
[
advancedOrExtendedLeft
]
[
red
.
on
]
[
yellow
.
off
]
[
greenFlashing
=>
green
.
flashing
]
[
leftArrow
=>
leftGreenArrow
.
flashing
&&
green
.
off
]
extendedLeft
[
no
emergencyVehicle
]
[
advancedOrExtendedLeft
]
[
red
.
on
]
[
yellow
.
off
]
[
greenFlashing
=>
green
.
flashing
]
[
leftArrow
=>
leftGreenArrow
.
flashing
&&
green
.
off
]
[
EastWest
.
TrafficSignals
.
proceed
<=>
WestEast
.
TrafficSignals
.
proceed
]
[
EastWest
.
TrafficSignals
.
prepareToStop
<=>
WestEast
.
TrafficSignals
.
prepareToStop
]
[
EastWest
.
TrafficSignals
.
stop
<=>
WestEast
.
TrafficSignals
.
stop
]
[
EastWest
.
TrafficSignals
.
allStop
<=>
WestEast
.
TrafficSignals
.
allStop
]
[
EastWest
.
TrafficSignals
.
allYellow
<=>
WestEast
.
TrafficSignals
.
allYellow
]
[
EastWest
.
TrafficSignals
.
advancedLeft
=>
WestEast
.
TrafficSignals
.
stop
]
[
EastWest
.
TrafficSignals
.
extendedLeft
=>
WestEast
.
TrafficSignals
.
stop
]
TrafficLightSystem
Lamps
Red
Yellow
Green
LeftGreenArrow
?
RightGreenArrow
?
countdownTimer
?
[
no
USA
]
redAndYellowToGreen
?
allWayFlashingRedAsStop
?
allWayYellow
?
[
no
USA
]
or
advancedOrExtendedLeft
?
greenFlashing
leftArrow
[
LeftGreenArrow
]
xor
mountLocation
inFront
behind
xor
orientation
vertical
horizontal
[
Europe
=>
LeftGreenArrow
&&
RightGreenArrow
]
[
Europe
=>
redAndYellowToGreen
]
[
USA
=>
allWayFlashingRedAsStop
]
[
Canada
=>
advancedOrExtendedLeft
]
[
Canada
=>
no
redAndYellowToGreen
]
[
Canada
=>
no
allWayFlashingRedAsStop
]
[
Canada
=>
allWayYellow
]
[
Europe
=>
inFront
]
[
NorthAmerica
=>
behind
]
[
Quebec
=>
horizontal
]
xor
Jurisdiction
Europe
UK
?
mux
NorthAmerica
USA
Canada
Quebec
?
Australia
NewZealand
abstract
xor
Lamp
on
off
flashing