McMaster University**We aren't endorsed by this school
Course
SFWR ENG 3BB4
Subject
Industrial Engineering
Date
Dec 18, 2024
Pages
6
Uploaded by MajorWolfMaster107
LIFT = LIFT[0],LIFT[n:0..10] = (when (n < 10) enter -> LIFT[n+1]|when (n > 0) exit -> LIFT[n-1]).property CAPACITY_CHECK = CHECK[0],CHECK[i:0..10] = (when(i<10) enter -> CHECK[i+1] |when(i>0) exit -> CHECK[i-1] |when(i==0 )exit -> CHECK[0]).CARPARKCONTROL(N=4) = SPACES[N],SPACES[i:0..N] = (when(i>0) arrive->SPACES[i-1]|when(i<N) depart->SPACES[i+1]).ARRIVALS = (arrive->ARRIVALS).DEPARTURES = (depart->DEPARTURES).property SAFE_CARPARK(N=4) = SPACES[N],SPACES[i:0..N] = (when (i > 0) arrive -> SPACES[i-1]|when (i < N) depart -> SPACES[i+1]|when (i == N) depart -> SPACES[N]).progress CARS_ENTER = {arrive}||CARPARK =(ARRIVALS||CARPARKCONTROL(4)||DEPARTURES|| SAFE_CARPARK).If car departure (depart) has lower prioritythan car arrival (arrive), starvation does not occur. Lower priority for depart means that arrive actions will always take precedence whenever both actions are enabled, but, the arrive action depends on there being at least one free space in the car park (when(i > 0) in CARPARKCONTROL). Once the car park is full, the arrive action is blocked until a depart action frees up space. Since arrive actions cannot occur forever without corresponding depart actions freeing up space, depart is eventually executed. This guarantees that space is made available, allowing cars to enter, and prevents starvation.Assignment 3Thursday, November 28, 20245:29 PM3bb4 Page 1