next up previous contents
Next: Entering a specification using Up: Pipeline Example Previous: The structure of the

Writing a specification using the Bandera Specification Language

In the implementation of Pipeline system, a useful requirement would be that if the main method of the PipeInt class is done (i.e., issues a stop to its down-stream connector), then each of the remaining stages in the pipeline shuts down. Let's concentrate on formalizing and checking this requirement for the first stage: if the main method of the PipeInt issues a stop on its down-stream connector c1, then Stage1 will eventually shutdown. The source code features mentioned in this requirement are the control point associated with the call to the stop method of c1 and the control point associated with the printing of the shutdown message in the run method of Stage1. We can use Bandera's LOCATION observable form to define predicates that become true when control reaches these points. To declare the observable control point in PipeInt's main method, we will (a) introduce a Java label (e.g., c1StopCallLoc) at the line of the control point (i.e., the line where Heap.c1.stop() appears), and (b) give the following Javadoc comment immediately above the method declaration.

  /**
   * @observable
   *   LOCATION[c1StopCallLoc] c1StopCall;
   */

Similarly, to declare the observable control point in Stage1's run method, you would (a) introduce a Java label (e.g., stage1ShutdownLoc) at the line of the control point (i.e., the line where System.out.println("Stage1 shutdown") appears, and (b) give the following Javadoc comment immediately above the method declaration.

  /**
   * @observable
   *   LOCATION[stage1ShutdownLoc] stage1Shutdown;
   */

Now that we have identified the relevant control points (one can also think of the execution of these control points as observable events) and declared predicates that hold true when execution reaches these control points, we are ready to state the temporal relationship between these events using Bandera's temporal specification pattern system. Note the example requirement has the following form:

if P occurs then eventually Q occurs
where P corresponds to the predicate PipeInt.main.c1StopCall and Q corresponds to the predicate Stage1.run.stage1Shutdown. In Bandera's pattern system, temporal properties that have this form are called response properties -- because Q must respond to P. Each pattern use must include a scope specification which delineates the segments of the execution trace where the property should hold. The example requirement should hold throughout the entire execution so it is said to have global scope. The actual rendering of the requirement in BSL is as follows.
     Response:  forall [s:Stage1].
                {Stage1.run.stage1Shutdown(s)}
                  responds to {PipeInt.main.c1StopCall} globally
Let's look at several aspects of this specification.

When processing this specification for Spin, Bandera will compile the response property above down to an LTL property of the following form

     [](P -> <>S)
where P is replaced with a lower-level predicates on internal representations that hold true at event of calling Heap.c1.stop() (similarly for S). The compiled formula for Spin also includes some additional structure needed to properly implement the quantification. Section 6 gives additional information about the syntax, semantics, and implementation of BSL specifications and object quantification.


next up previous contents
Next: Entering a specification using Up: Pipeline Example Previous: The structure of the

Roby Joehanes
Wed Mar 7 18:30:51 CST 2001