Institute of Computer Science
  1. Courses
  2. 2018/19 fall
  3. Systems Modelling (MTAT.03.083)
ET
Log in

Systems Modelling 2018/19 fall

Home
Lectures
Practicals
Assessment

Submit
Extra credit

Message Board
Readings

Lecture Exercises

Fairness: Traffic Light

Begin with this code:

------------------------------ MODULE traffic ------------------------------
NextColor(c) == CASE c = "red" -> "green"
                  [] c = "green" -> "red"

(*--algorithm traffic
variables
  at_light = TRUE,
  light = "red";

process light = "light"
begin Cycle:
  while at_light do
    light := NextColor(light);
  end while;
end process;

process car = "car"
begin Drive:
  when light = "green";
  at_light := FALSE;
end process;
end algorithm;*)
=============================================================================
  • Create a model and add/check "Termination" under Model Overview > What to Check? > Properties.
  • Make both processes fair.
  • Make the car process strongly fair.

Dekker's algorithm

Copy/Download the starting point: threads.tla.

  • Write a safety condition that "only one thread should enter the critical section at a time."
  • Run the model checker with and without the await-condition.
  • Apply the this fix. Check if this works!
  • Now liveness: State that both threads will be able to access critial section! Final Version.

Hillel Wayne's eSpark example

https://medium.com/espark-engineering-blog/formal-methods-in-practice-8f20d72bce4f

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment