Based on chapters 23 and 24 in The Way of Z.
Links to more Z lectures.
This page looks best when this and this X are about the same size: X. See these viewing tips.
Large systems are composed of components collected into subsystems. Complex components can be built up from simpler ones using schema inclusion.
Param | |||
preset, setpoint, value: SIGNAL | |||
PS | |||
Param | |||
contactor: SWITCH | |||
faults: FAULT | |||
faults setpoint = 0 | |||
contactor = open setpoint = 0 | |||
... | |||
On [ PS | contactor = closed ... ] |
TurnOn Off (On' Error') |
Servo [ Param; enable: MODE; ... | ... ] |
COMBINING COMPONENTS
Each component has a name. Components have different types but they all have the same type of name. Names of similar components are collected into sets. The state of the entire system is a collection of functions from names to bindings of the component types.
[NAME] |
ps = { rf, mainfld, ... } |
s = { mainprb, deflprb, ... } |
Cyclotron | |||
supply: ps PS | |||
servo: s Servo | |||
... | |||
... | |||
PROMOTION
Operations on single components can be promoted to operations on the whole system. First define a framing schema.
CycloFramePS | |||
Cyclotron | |||
PS | |||
ps?: ps | |||
{ ps? } supply' = { ps? } supply | |||
PS = supply ps? PS' = supply' ps? | |||
Then combined the component operation with the frame, identifying the component of interest.
TurnOnMainfld | |||
CycloFramePS | |||
TurnOn | |||
ps? = mainfld | |||
SUBSYSTEMS
Subsystems can be modelled by sets of names of dissimilar objects. States and operations can be defined on subsystems.
rfsys, cyclo, bla, blb, blc, iso, fix: NAME | ||
TurnOnBLA | |||
Cyclotron | |||
p: ps bla TurnOn | |||
PS = supply p PS' = supply' p | |||
BLAReady | |||
Cyclotron | |||
supply ps bla On | |||
WHOLE SYSTEMS
Complex operations can be described compactly.
SafeTurnOnBeam | |||
TurnOnBeam | |||
IsoTest CycloReady BLAReady | |||
IsoReady | |||
IsoTreat CycloReady BLAReady | |||
IsoSafe | |||
Preconditions for other modes ... | |||
T_TurnOnBeam SafeTurnOnBeam (Interlocked Cyclotron) |
OBJECT-ORIENTED STYLE IN Z
Schema inclusion is much like inheritance in object-oriented programming languages, but every schema type is distinct (no ``subtypes'').
Param [ preset, setpoint, value: SIGNAL ] |
PS [ Param; contactor: SWITCH; ... ] |
panel: Param | ||
mainfld: PS | ||
panel.setpoint = mainfld.setpoint | ||
offset == ( Param value - setpoint) | Definition |
offset panel | Type correct |
offset mainfld | Type error! |
Use a projection function to extract the Param.
offset (( PS Param) mainfld) | Type correct |
Back to Z lectures.