120 likes | 140 Views
Join Model Checking 2007 with Barbara Jobstmann for theoretical and practical exercises using MOCHA software. Homework handed in Thursdays and discussed Fridays. Explore examples like Boat, Lock, Sunscreen, Cabbage, Goat, Wolf.
E N D
Model Checking 2007Exercises Barbara Jobstmann
Today • General • Mocha • Examples
Contact • Email: barbara.jobstmann@epfl.ch • Office: BC 358 • Mailing list: modelchecking2007@listes.epfl.ch • For all participants • subscribe • http://mtc.epfl.ch/courses/ModelChecking-2007/
Homework • Theoretical: • Examples and proofs on paper • Practical • Using MOCHA • Schedule • Given out: Thursday afternoon • Handed in: Thursday morning (before the lecture) or send an email • Discussed: Friday afternoon (from 13:15 to 15:00)
MOCHA • “MOCHA is a growing interactive software environment for system specification and verification.” • Three universities: • University of California at Berkeley • University of Pennsylvania • State University of New York at Stony Brook • Versions: • cmocha, jmocha • We will use jmocha 2.0
MOCHA • Systems written in RML (finite-state subset) • Specifications as invariants • Provides • Simulator • Checkers (enumerative, symbolic)
MOCHA • Where to find MOCHA? • http://embedded.eecs.berkeley.edu/research/mocha/ • Information and Help • MOCHA manual • Collection of “Do’s and Don’ts” at homepage of the lecture
Examples • Tiny examples • Boat example • Lock example • Sunscreen example
Lock Example int got_lock = 0; do{ 1 if (*) { 2 lock();} 3 got_lock = got_lock + 1; 4 if (got_lock != 0) { 5 unlock(); 6 got_lock = got_lock - 1;} 7 } while(*) void lock() { 11 assert(L = 0); 12 L = 1; } void unlock(){ 21 assert(L = 1); 22 L = 0; }
Buggy Sunscreen ws Window doOpen buttondown doClose buttonup Control goup open Screen godown close ss