Bandera Intermediate Representation BIR - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Bandera Intermediate Representation BIR

Description:

Used to represent models of concurrent object-oriented systems. Guarded ... true, one of the transitions leading out of loc0 is chosen non-deterministically ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 21
Provided by: Rai92
Category:

less

Transcript and Presenter's Notes

Title: Bandera Intermediate Representation BIR


1
Bandera Intermediate Representation (BIR)
Raivo Piirat LAP M
2
Bogor Modeling Language - BIR
  • Used to represent models of concurrent
    object-oriented systems
  • Guarded command language
  • when ltconditiongt do ltcommandgt
  • Native support for a variety of object-oriented
    language features
  • dynamically created objects and threads,
  • exceptions, methods, inheritance, etc.

3
A BIR system modeling 2-dining-philosophers
  • system TwoDiningPhilosophers
  • boolean fork1 boolean fork2
  • active thread Philosopher1( )
  • loc loc0 // take first fork
  • when !fork1 do fork1 true
    goto loc1
  • loc loc1 //take second fork
  • when !fork2 do fork2 true goto
    loc2
  • loc loc2 / / put second fork
  • do fork2 false goto loc3
  • loc loc3 // put first fork
  • do fork1 false goto loc0
  • active thread Philosopher2( )
  • loc loc0 // take second fork
  • when !fork2 do fork2 true goto
    loc1
  • loc loc1 // take first fork
  • when !fork1 do fork1 true goto loc2
  • loc loc2 // put first fork

4
BIR Execution
  • A BIR execution can be viewed as sequence of
    atomic steps or transitions between system
    states.
  • State holds all information that is necessary to
    carry on computation starting from a particular
    point in the system's execution
  • State consists of values of system variables and
    current control location (program counter) of
    each thread

5
Notation for BIR State
  • System State
  • pc1 -gt 0, pc2 -gt 2, fork1 -gt false, fork2 -gt
    true
  • pc for Philospher1 is loc0
  • pc for Philosopher2 is loc2
  • value of fork1 is false
  • value of fork2 is true
  • sometimes we will abbreviate as
  • 0, 1, false, true
  • ...if the ordering of variable values is clear
    from the context

6
BIR Transition Notation
  • The notation represents the fact that thread t
    has executed a transition out of location l.

7
State Transition System
  • A state transition system is a mathematical
    structure that will allow us to reason precisely
    about the behavior of simple concurrent systems.
  • S (S,T,S0,L)
  • describes the behavior of a particular system
  • S is a set of system states
  • T is a set of transitions
  • each transition d is a relation between states
  • S0 is a set of initial states
  • L maps a state s to a set of primitive
    properties that are
  • true of s.

8
Transitions as Relations/Functions
  • Formally, a is a subset of S x S, i.e.,
  • a is a relation between states given an input
    state s, a (s) yields the states output by the
    transition.
  • A transition is deterministic if for every state
    s there is at most one state s such that a(s,
    s).
  • When a is non-deterministic (i.e., when a can be
    viewed as a function from states to states), we
    write s a (s).
  • Example
  • loc loc1 // take second fork
  • when !fork2 do fork2 true goto
    loc2

9
Intra-Thread Non-determinism
  • Sometimes there can be more than one enabled
    transition for a particular thread
  • loc loc0
  • when A do x x 1 goto loc1
  • when B do y y 1 goto loc2
  • when both A and B are true, one of the
    transitions leading out of loc0 is chosen
    non-deterministically

10
Enabled/Disabled Transitions
  • a transition a is enabled for a state s if there
    exists a state s such that a( s) s (i.e., a
    is defined on s)
  • a transition a is disabled for a state s if a is
    undefined on s.
  • Notation for enabled/diabled
  • enabled(s) - the set of transitions enabled at s
  • enabled(s,t) - the set of transitions from
    thread t that are enabled at s
  • disabled(s), disabled(s,t) - similar to above
  • pc(s,t) - the value in s of the program counter
    for t
  • current(s), current(s,t) - the set of all
    transitions (whether enabled or
  • disabled) associated with the current program
    counters of s.

11
Examples
12
Visualizing the possible schedules (computational
tree)
13
(No Transcript)
14
Computation tree for SumToN
15
  • Assertion will fail when N is set to 2.

16
(No Transcript)
17
(No Transcript)
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com