Title: Case Study
1Case Study
- Oil Tanker Terminal Control System
2Specification
- Tanker is the set of tankers
- Berth is the set of berths
- The given set is
- Tanker, Berth
- In any particular oil terminal there will be a
certain set of berths available for tanker to use - berths P Berth
3- The definition below gives the response to an
operation - OTSResp okwaitmove-tanker
- known-tankernot-at-berth
4State Data
- Declaration
- a queue of tankers waiting for berths,
- a record of which tanker occupies which berth
- The set of tankers that are either occupying
berths or queuing for them
5Declaration for state data
Otcsys Waiting seq Tanker Docked Tanker ?
Berth Known P Tanker
6State Data
- Predicate
- A tanker cannot be both in the queue and in a
berth - The tanker queuing will all be different
- No tanker will be queuing unless all the berths
are full - Tankers occupying berths will all be different
7State Data
Otcsys waiting seq Tanker docked Tanker ?
Berth known P Tanker
ran waiting n dom docked Ø waiting (ran
waiting) waiting gt 0 ?ran docked berths ran
docked ? berths known ran waiting ? dom docked
8Initializing state data
InitOtc Otcsys waiting lt gt docked Ø
In the initial state there are no tankers queuing
and all berths are free
9Operation tankers arriving(1)
- Only tankers not already queuing or docked can
ask for permission to arrive.
Arrive0 ?Otcsys T? Tanker T? ? known
10Operation tankers arriving(2)
- If there is a free berth, the tanker is allocated
to it
ArriveNoQ Arrive0 B? Berth Res!
OTSResp ran docked ? berths Res! ok B? ?
berths \ ran docked docked docked ? T? ?
B? Waiting waiting
11Operation tankers arriving(3)
- If there is no free berth, the tanker must be
queued
ArriveQ Arrive0 Res! OTSResp ran
docked berths Res! wait B? ? berths \ ran
docked waiting waiting ltT?gt docked docked
ArriveOk ? ArriveQ ? ArriveNoQ
12Operation tankers leaving(1)
- A tanker can apply to leave if it is at berth.
Leave0 ?Otcsys T? Tanker T? ? dom docked
13Operation tankers leaving(2)
- If there is no queue, the berth is freed
LeaveNoQ Leave0 Res! OTSResp waiting
lt gt docked T? ? docked Waiting
waiting Res! ok
14Operation tankers leaving(3)
- If there is a queue, the operation must output
the berth and the tanker next to occupy it, must
update the docked function
LeaveQ Leave0 C! Tanker B! Berth Res!
OTSResp waiting ? lt gt C! head waiting B!
docked T? docked (T? ? docked) ? C! ?
B! waiting tail waiting Res! move-tanker
15Operation tankers leaving (4)
LeaveOk ? LeaveQ ? LeaveNoQ