A Demonstration of Basic Aspects of the Bandera
A Demonstration of Basic Aspects of the Bandera Tool Set SAn. To. S Laboratory, Kansas State University, USA Faculty Students and Post-docs Matthew Dwyer John Hatcliff Radu Iosif Hongjun Zheng Shawn Laubach Corina Pasareanu Robby Roby Joehanes Venkatesh Ranganath Oksana Tkachuk http: //www. cis. ksu. edu/santos/bandera
Notes Demo examples are chosen to be simple and to illustrate tool components l For more examples with interesting specifications, see… l – Bandera tutorial… – STTT paper • complete presentation of Bounded. Buffer example • Doug Lea’s Readers/Writers • Publish/Subscribe framework from java. util
Outline l Concept of a session – configuring Bandera for a run l Simple deadlock example – illustrates session, code display, counterexample navigation, and slicing l Pipeline example – illustrates creating a temporal specification, slicing, and abstraction
Configuring Bandera A run of Bandera is configured by a session specification l A session specifies. . . – which Java files to take as input – which property to check – which tool components (e. g. , slicer, abstraction) to invoke – which backend model-checker to use – …other options l A session file holds several related sessions – sessions in session file can be executed in batch mode or individually selected in the BUI.
Simple Deadlock Example Process 1 Process 2 acquisition Lock 1 Lock 2 blocked acquisition
Simple Deadlock Example public class Deadlock { static Lock lock 1; static Lock lock 2; static int state; public static void main(String[] args) { lock 1 = new Lock(); lock 2 = new Lock(); Process 1 p 1 = new Process 1(); Process 2 p 2 = new Process 2(); p 1. start(); p 2. start(); } class Lock {} class Process 1 extends Thread { public void run() { Deadlock. state++; synchronized (Deadlock 1) { synchronized (Deadlock 2) { Deadlock. state++; }}}} class Process 2 extends Thread { public void run() { Deadlock. state++; synchronized (Deadlock 2) { synchronized (Deadlock 1) { Deadlock. state++; }}}}
Deadlock Example Artifacts Point. basl Property Tool Point. java Abstracted Java Abstraction Analyses Engine BIRC Translators BIR SPIN. trail d. SPIN Java Jimple Parser SMV Slicer Error Trace Display Sliced Java Simulator JPF
Simple Deadlock Example /** * @observable * LOCATION[p 1 startlabel] p 1 start(); */ public static void main(String[] args) { lock 1 = new Lock(); lock 2 = new Lock(); Process 1 p 1 = new Process 1(); Process 2 p 2 = new Process 2(); p 1 startlabel: p 1. start(); p 2. start(); } Bandera predicate (used as proposition in temporal logic specification)
Simple Deadlock Example Bandera predicate (used as proposition in temporal logic specification) /** * @observable * EXP x 1 is. Two(this): (x 1 == 2); */ class Process 1 extends Thread { Integer variables that int x 1, y 1; interact with public void run() { Deadlock. state Deadlock. Abs. state++; synchronized (Deadlock. Abs. lock 1) { synchronized (Deadlock. Abs. lock 2) { x 1 = Deadlock. Abs. state++; y 1 = Deadlock. Abs. state++ + x 1; } }
Tool Status Available for download with user manual, example repository, BIR backend developers guide l Major additions over next 3 months to allow treatment of almost all of Java l – minor releases throughout fall l Complete rewrite of code-base is underway and new version will be incorporated into IBM’s Eclipse open source IDE. – target for release: March 2003
- Slides: 10