Automated Reasoning 2nd Coursework
Elaine Murphy Oct 30th
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
Automated Reasoning 2nd Coursework Elaine Murphy Oct 30th Elaine - - PowerPoint PPT Presentation
Automated Reasoning 2nd Coursework Elaine Murphy Oct 30th Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th 1 Information Demonstrator: Elaine Murphy s0094243@sms.ed.ac.uk Lab sessions: AT level 5 South lab. Mon 14.10 - 15.00 Wed
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
1
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
2
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
3
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
4
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
5
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
6
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
7
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
8
#define greenForUTurns (travelling_from[PRINCES_STREET].going_to[PRINCES_STREET]==GREEN || travelling_from[LOTHIAN_ROAD].going_to[LOTHIAN_ROAD]==GREEN || travelling_from[RUTLAND_STREET].going_to[RUTLAND_STREET]==GREEN || travelling_from[SHANDWICK_PLACE].going_to[SHANDWICK_PLACE]==GREEN || travelling_from[QUEENSFERRY_STREET].going_to[QUEENSFERRY_STREET]==GREEN || travelling_from[HOPE_STREET].going_to[HOPE_STREET]==GREEN ) never { /* <>greenForUTurns */ TO_init: if :: greenForUTurns -> goto accept_all :: (1) -> goto TO_init fi; accept_all: skip } Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
9
inline setRoadRandomly(x){ if :: true -> x=PRINCES_STREET; :: true -> x=LOTHIAN_ROAD; :: true -> x=RUTLAND_STREET; :: true -> x=SHANDWICK_PLACE; :: true -> x=QUEENSFERRY_STREET; :: true -> x=HOPE_STREET fi;} Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
10
int randomRoad; active proctype setupTraffic() { setRoadRandomly(randomRoad); setupTrafficDone = true } #define roadHasGreenLightForUTurn (travelling_from[randomRoad].going_to[randomRoad] == GREEN) never { /* <> roadHasGreenLightForUTurn */ TO_init: if :: ((roadHasGreenLightForUTurn)) -> goto accept_all :: (1) -> goto TO_init fi; accept_all: skip } Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
11
typedef Route {int from, to;} inline setRouteRanomly(x) { atomic { setRoadRandomly(x.from); setRoadRandomly(x.to); } } Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
12
Route someRoute; active proctype setupTraffic() { setRouteRandomly(someRoute); setupTrafficDone = true; waitForSetupDone(); printRoute(TRAFFIC_INFO_CHECKING, someRoute);} mtype = {TRAFFIC_ERROR_U_TURN_ALLOWED}; #define uTurnHasGreenLight ((someRoute.from == someRoute.to) && LIGHT_FOR_ROUTE(someRoute)==GREEN)) never { /* <> uTurnHasGreenLight */ waitForSetupDone(); do :: uTurnHasGreenLight -> break; :: else -> skip
printRoute(TRAFFIC_ERROR_U_TURN_ALLOWED, someRoute); } Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
13
spin -a -N NeverUTurns WestEnd #Build the verifier for the model using the never claim in NeverUTurns cc -o pan pan.c #Compile the verifier ./pan -e #Find all error trails ./pan -r1|grep TRAFFIC #Simulate error trail 1, filter the
with TRAFFIC) Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
14
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
15
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
16
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
17
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
18
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th
19
Elaine Murphy Automated Reasoning 2nd Coursework Oct 30th