220 likes | 300 Views
CSC 4504 : Langages formels et applications (La méthode Event-B) J Paul Gibson, A207 paul.gibson@it-sudparis.eu http://www-public. it-sudparis.eu /~gibson/Teaching/Event-B/. TrafficLights http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/TrafficLights.pdf.
E N D
CSC 4504 : Langages formels et applications (La méthode Event-B) J Paul Gibson, A207 paul.gibson@it-sudparis.eu http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/ TrafficLights http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/TrafficLights.pdf Thanks to Ken Robinson: System Modelling and Design - Traffic Lights 2008 T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Safe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Safe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Safe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Safe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Safe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South UnSafe State T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Inconsistent State: Safe or Unsafe? T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South Inconsistent State: Safe or Unsafe? T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction, No Turns Representing State of the System: level of abstraction of junction SafeInconsistentUnsafe North South East West G G A A G G A A G A G A G A G A R R R A G R R R A G R A G R R R A G R R R R G G A A X X X X X X G A R A R G X X X X X X X X X X X X R R G G A A X X X X X X G A R A R G T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction, No Turns Representing State of the System: level of abstraction of junction SafeUnsafe NorthSouth EastWest R R R A G R A G R R G G A A G A G A This is a better starting level of abstraction: we can refine the model to add detail later (and additional invariants to ensure consistency) T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction, No Turns Representing State of the System: level of abstraction of each light Off Off Off On Off Off ? R Off On On Off On Off ? A Off Off On Off On On G ? Which level is best for representing the state of each light? How do we cope with problems due to inconsistency T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns North West East South State Represented in diagrams as RG T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns – Safe Systems 1 Safe System: but not useful 2 Safe System: but not fair RR RR RG 3 Safe System: fair but not correct RR GR RG T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns – Safe Systems 4 Safe System: correct but is it fair? RG RA RR GR AR T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns – Safe Systems 5 Safe System: correct and fair (and deterministic) but requires splitting abstract state RR into 2 different concrete RR states RG RA RR GR AR RR T&MSP-CSC 4504 : Langages formels et applications
System0: 2-Way Junction No Turns – A refinement removes nondeterminism RG RA RR GR AR refinement RG RA RR GR AR RR T&MSP-CSC 4504 : Langages formels et applications
System0: TrafficLights_ctx0 in RODIN T&MSP-CSC 4504 : Langages formels et applications
System0: TrafficLights_ctx0 in RODIN T&MSP-CSC 4504 : Langages formels et applications
System0: TrafficLights_ctx0 in RODIN T&MSP-CSC 4504 : Langages formels et applications
System0: TrafficLights_ctx0 in RODIN Add axioms to define function OppositeDirection Now we can model the system transitions in a machine that sees this context T&MSP-CSC 4504 : Langages formels et applications
System0: TrafficLights_mch0 in RODIN T&MSP-CSC 4504 : Langages formels et applications