# 2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.1 CSC 4504 : Langages formels et applications (La méthode Event-B)

## Presentation on theme: "2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.1 CSC 4504 : Langages formels et applications (La méthode Event-B)"— Presentation transcript:

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.1 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/ DataStructures http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/DataStructures.pdf

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.2 TO DO : Answer the Questions As Best You Can 1)Stacks 2)Queues Work in groups of 1, 2 or 3 people

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.3 Question 1: A Stack – typical behaviour of a machine 2525 Add(2) 5 Add has no result to return : it just changes the stack state by pushing the element onto the head of the stack Add(3) 325325 empty Add(5)

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.4 Question 1: A Stack – typical behaviour of a machine 2525 Add(2) 5 Remove returns the head of the stack as the result and changes the state of the stack by popping this head from the top of the stack Add(3) 325325 empty Add(5) Remove = 3 Remove = 2 Remove = 5

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.5 Question 1: A Stack Abstract Context (a) TO DO: Add this context to a RODIN project DataStructures All proof obligations should be automatically discharged

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.6 Question 1: A Stack Abstract Machine (a) TO DO: Add this machine to the project DataStructures Use the interactive prover to prove any Proof Obligation that RODIN has not done automatically

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.7 Question 1: A Stack – add a Length operator 2525 Add(2) 5 Length returns the number of elements on the stack but does not change its state (we write this as a skip action in Event-B). Add(3) 325325 empty Add(5) Remove = 3 Remove = 2 Remove = 5 Length = 0 Length = 1Length = 2 Length = 3 TO DO: Update the Stack context and Machine to include Length

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.8 Question 1: A Stack – add a Length operator To validate your specification 1) Add and prove the following theorems in the context:

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.9 Question 2: A Queue Abstract Machine 2525 Add(2) 5 Add(3) 325325 empty Add(5) 3232 Remove = 5 Remove = 2 3 Remove = 3

2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.10 Question 2: A Queue Abstract Machine TO DO: 1.Specify a Queue Context in the DataStructures Project 2.Specify a Queue Machine in the DataStructures Project Structure/Notation: push, pop and head - in the Context add and remove - in the Machine

Download ppt "2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.1 CSC 4504 : Langages formels et applications (La méthode Event-B)"

Similar presentations