Train Gate
Train Gate is a railway control system which controls access to a bridge for several trains. The bridge is a critical shared resource that may be accessed only by one train at a time. The scheduling of the trains to access the bridge follows the first-in-first-out (FIFO) strategy. When a train approaches the bridge, if the bridge is occupied or there are trains have arrived earlier, the controller informs the train to stop and wait until its previous trains have left the bridge. Otherwise, the train starts to reach the bridge (within 7-15 time units) and cross the bridge (within 3-5 time units). We consider the following properties on the train gate system (the number of trains is 3).
A1. Two trains can not cross the bridge at the same time.
cross0 is if c[0] then ac else nc;
cross1 is if c[1] then ac else nc;
cross0 excludes(p=0.96) cross1;
A2. The time for all trains to cross the bridge should be greater than 120 time units.
infClk1 is appr[0] inf appr[1];
infClk2 is appr[2] inf infClk2;
supClk1 is leave[0] sup leave[1];
supClk2 is leave[2] sup supClk1;
de is infClk2 delayFor 120 on tu;
de causes(p=0.96) supClk2;
A3. The time for a single train from approaching the gate to completely cross the gate should be within [40, 250] time units.
de1 is appr[1] delayFor 40 on tu;
de2 is appr[1] delayFor 250 on tu;
de1 causes leave[1];
leave[1] causes(p=0.95) de2;
A4. The waiting time for a train (from stop to go) should be less than 200 units of time.
The PrCCSL specifications of the above properties of train gate system is illustrated below:
de3 is stop[0] delayFor 200 on tu;
go[0] causes(p=0.95) de;