Domain-specific Model Checking with Bogor SAnToS Laboratory, Kansas State University, USA US Army Research Office (ARO)

Slides:



Advertisements
Similar presentations
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Advertisements

Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
Chapter 1: Computer Systems
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Analyzing Interaction Orderings with Model Checking Support US National Science Foundation (NSF CISE/SEL) US Department of Defense Advanced Research Projects.
Software Model Checking for Embedded Systems PIs: Matthew Dwyer 1, John Hatcliff 1, and George Avrunin 2 Post-docs: Steven Seigel 2, Radu Iosif 1 Students:
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
1 BOGOR – A Flexible Framework For Creating Model Checkers Presented by : Roli Shrivastava 20 March 2007.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Bogor Support US Army Research Office (ARO) US National Science Foundation (NSF) US Department of Defense Advanced Research Projects Agency (DARPA) Rockwell-Collins.
Outline Java program structure Basic program elements
Programming Languages Structure
C#: Project Cool Arthur Ketchel II Keith Francisco Chris McInnis.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
VB in Context Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh Pittsburgh, Pa 15260
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion.
Java: Chapter 1 Computer Systems Computer Programming II.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
Automated Software Engineering with Concurrent Class Machines Radu Grosu SUNY at Stony Brook joint work with Y. Liu, S. Smolka, S.Stoller, J. Yan SUNY.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Bogor-Simulation: Executing (Simulating) Concurrent Systems in Bogor Copyright.
Model construction and verification for dynamic programming languages Radu Iosif
An extensible and highly-modular model checking framework SAnToS Laboratory, Kansas State University, USA Matt Dwyer.
CIS 842: Specification and Verification of Reactive Systems Lecture 1: Course Overview Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
1 Bogor – Software Model Checking Framework Presented by: Arpita Gandhi.
 Programming - the process of creating computer programs.
August 2003 At A Glance The IRC is a platform independent, extensible, and adaptive framework that provides robust, interactive, and distributed control.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
Devanshu Bawa Customization Specialist Logo Business Solutions.
Session 02 Module 3: Statements and Operators Module 4: Programming constructs Module 5: Arrays.
Domain-specific Model Checking with Bogor SAnToS Laboratory, Kansas State University, USA US Army Research Office (ARO)
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Object Oriented Programming in
Working with Java.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Model Checking Software Using The Bogor Framework
Space-Reduction Strategies for Model Checking Dynamic Software
Model Checking Software Using The Bogor Framework
Behavioral Models for Software Development
Ada – 1983 History’s largest design effort
Introduction to Computer Science for Majors II
Units with – James tedder
Units with – James tedder
Review CSE116 2/21/2019 B.Ramamurthy.
(Computer fundamental Lab)
Presented By: Darlene Banta
ICOM 4029 Fall 2003 Lecture 2 (Adapted from Prof. Necula UCB CS 164)
The Bogor Model Checking Framework
Presentation transcript:

Domain-specific Model Checking with Bogor SAnToS Laboratory, Kansas State University, USA US Army Research Office (ARO) US National Science Foundation (NSF) US Department of Defense Advanced Research Projects Agency (DARPA) Boeing Honeywell Technology Center IBM Intel Lockheed Martin NASA Langley Rockwell-Collins ATC Sun Microsystems Support Session I: Bogor Overview Matthew B. Dwyer John Hatcliff Robby Matthew Hoosier

Goals of This STRESS Lecture Introduction to the primary features/functions of Bogor Overview of Bogor APIs that will allow you to easily modify Bogor or to add new functionality requires some effort to learn …but a number of people have already implemented Bogor extensions Overview of some of the more sophisticated customizations of Bogor Get feedback from you as to what features/support you might want to have in Bogor that would make it more useful for you

Lecture Organization Lecture I: Bogor Overview Bogor Features Motivation BIR Overview Bogor UI Demo Lecture II: DFS in Explicit State Model Checking schedules and traces computation tree exhaustive search using DFS DFS basic data structures Break

Lecture Organization (Cont’d) Lecture III: Bogor Architecture Bogor configuration & initialization DFS in Bogor (extensibility) state representation DFS stack seen state set Lecture IV: Bogor Customizations language extension customization domains Cadena models (avionics mission control system) Java (.Net) contract-reasoning using symbolic execution

Bogor

Bogor – Software Model Checking Framework

Bogor – Direct support for OO software unbounded dynamic creation of threads and objects automatic memory management (garbage collection) virtual methods, … …, exceptions, etc. supports virtually all of Java thread & heap symmetry compact state representation partial order reduction techniques driven by object escape analysis locking information Extensive support for checking concurrent OO software Direct support for… Software targeted algorithms…

Bogor – Domain Specific Model-Checking Extensible modeling language and plug-in architecture allows Bogor to be customized to a variety of application domains Modeling language and Algorithms easily customized to different domains Domain YDomain Z Domain X

Bogor Web Site Build Your Own Model Checker! Significant “out of the box” capabilities for supporting modern software systems Novel extension and customization facilities used by us used by others Documentation and support Pedagogical material and courseware

System Modeling Problem — Variety of Application Domains Hardware Device Drivers Avionics Automotive Telephony GUI

Model Checker System Modeling Problem — Variety of System Descriptions Design Notations Byte code State Machines Source code Different levels of abstraction!

Abstract machine tailored to domain and level of abstraction The Goal Model-checking Engine Avionics State Machines Domain & Abstraction Extensions

Abstract machine tailored to domain and level of abstraction The Goal Model-checking Engine Domain & Abstraction Extensions Device Drivers Source code Domain & Abstraction Extensions

Abstract machine tailored to domain and level of abstraction The Goal Model-checking Engine Domain & Abstraction Extensions Domain & Abstraction Extensions Automotive Design Notations Domain & Abstraction Extensions

Customization Mechanisms Bogor -- Extensible Modeling Language Core Modeling Language Threads, Objects, Methods, Exceptions, etc. Domain-Specific Scheduler Domain- Specific Search Domain-Specific State Rep. Bogor -- Customizable Checking Engine Modules Scheduling Strategy State-space Exploration State Representation Core Checker Modules Customized Checker Modules …existing modules… Domain-Specific Abstractions +

Domain Customizations Component-based avionics systems in Cadena Checking Java Modeling Language (JML) specifications Compositional Reasoning using Symbolic Execution Test Case Generation Multiagent System Modeling MPI (U Mass) Model checking Motorola M68HC11 machine code (BYU) We are aware of more than 31 substantive extensions to Bogor that have been built by 19 people, only one of whom was the primary Bogor developer. Examples

Bogor Modeling Language and UI Example: Dining philosophers Demo: Bogor UI in Eclipse Modeling Java programs Java classes and methods Dynamic dispatch of methods Exceptions Overview Other BIR Features High-level constructs Functional sub-language Example Extension: Channels Outline

Bogor Modeling Language — BIR Used as the intermediate language for the Bandera Tool Set for model-checking Java programs Guarded command language when do Native support for a variety of object- oriented language features dynamically created objects and threads, exceptions, methods, inheritance, etc. BIR = Bandera Intermediate Representation

An Example — 2 Dining Philosophers left right

A BIR Example — 2 Dining Philosophers system TwoDiningPhilosophers { record Fork { boolean isHeld; } main thread MAIN() { Fork fork1; Fork fork2; loc loc0: do { // create forks fork1 := new Fork; fork2 := new Fork; // start philosophers start Phil(fork1, fork2); start Phil(fork2, fork1); } return; } thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; }

A BIR Example — 2 Dining Philosophers system TwoDiningPhilosophers { record Fork { boolean isHeld; } main thread MAIN() { Fork fork1; Fork fork2; loc loc0: do { // create forks fork1 := new Fork; fork2 := new Fork; // start philosophers start Phil(fork1, fork2); start Phil(fork2, fork1); } return; } thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; } Uses a record to model forks

A BIR Example — 2 Dining Philosophers system TwoDiningPhilosophers { record Fork { boolean isHeld; } main thread MAIN() { Fork fork1; Fork fork2; loc loc0: do { // create forks fork1 := new Fork; fork2 := new Fork; // start philosophers start Phil(fork1, fork2); start Phil(fork2, fork1); } return; } thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; } Thread declarations

A BIR Example — 2 Dining Philosophers system TwoDiningPhilosophers { record Fork { boolean isHeld; } main thread MAIN() { Fork fork1; Fork fork2; loc loc0: do { // create forks fork1 := new Fork; fork2 := new Fork; // start philosophers start Phil(fork1, fork2); start Phil(fork2, fork1); } return; } thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; } Local variable declarations

A BIR Example — 2 Dining Philosophers system TwoDiningPhilosophers { record Fork { boolean isHeld; } main thread MAIN() { Fork fork1; Fork fork2; loc loc0: do { // create forks fork1 := new Fork; fork2 := new Fork; // start philosophers start Phil(fork1, fork2); start Phil(fork2, fork1); } return; } thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; } Control locations

Guarded transformations A BIR Example — 2 Dining Philosophers thread Phil(Fork left, Fork right) { loc loc0: // take left fork when !left.isHeld do { left.isHeld := true; } goto loc1; loc loc1: // take right fork when !right.isHeld do { right.isHeld := true; } goto loc2; loc loc2: // put right fork do { right.isHeld := false; } goto loc3; loc loc3: // put left fork do { left.isHeld := false; } goto loc0; } …aka “guarded transitions”, “guarded commands” When condition is true When condition is true Trivially true guards Trivially true guards Execute these statement(s) atomically Execute these statement(s) atomically

A BIR Example — 2 Dining Philosophers Demo Bogor BIR Editor syntax highlighting well-formed-ness checker Bogor Counter-example Display states and transitions navigation heap visualization BIR Session Wizard creating new sessions configuring Bogor

Bogor Online Resources Project website Bogor User Manual Distribution & Licensing Freely downloadable from the Bogor project website registration is required Cannot redistribute the Bogor package, but you can redistribute Bogor extensions

Rich collection of documentation and support facilities

RSS Newsfeed showing Bogor enhancements

Bogor Modeling Language and UI Example: Dining philosophers Demo: Bogor UI in Eclipse Modeling Java programs Java classes and methods Dynamic dispatch of methods Exceptions Overview Outline Other BIR Features High-level constructs Functional sub-language Example Extension: Channels

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Java classes and methods record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} }

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Additional BIR identifiers record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } (|…|), /|…|\, \|…|/, {|…|}, and +|…|+ are all BIR identifiers used to avoid name clashes (|…|), /|…|\, \|…|/, {|…|}, and +|…|+ are all BIR identifiers used to avoid name clashes

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Records for Java classes record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } records are used to model Java classes (inheritance)

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Static fields record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } static fields are modeled as global variables static fields are modeled as global variables

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Java methods as functions record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } Java methods are modeled as functions Java methods are modeled as functions

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } Dynamic dispatch of methods record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } Virtual tables are used to resolve dynamic dispatch of methods Virtual tables are used to resolve dynamic dispatch of methods

Modeling Java Programs public class A { public static int N; public int x; protected int y; public A() {…} public void foo() {…} } class B extends A {} class C extends B { public void foo() {…} } record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } Dynamic dispatch of methods

Modeling Java Programs function bar((|A|) a) { loc loc0: // invokespecial invoke {|A.foo()|} (a) goto loc0; loc loc1: // invokevirtual invoke virtual +|A.foo()|+ (a) goto loc1; } record (|A|) extends (|java.lang.Object|) { int /|A.x|\; int /|A.y|\; } int \|A.N|/; function {|A. ()|} ((|A|) [|this|]) … function {|A.foo()|} ((|A|) [|this|]) … record (|B|) extends (|A|) {} record (|C|) extends (|B|) {} function {|C.foo()|} ((|C|) [|this|]) … virtual +|A.foo()|+ { (|A|) -> {|A.foo()|} (|B|) -> {|A.foo()|} (|C|) -> {|C.foo()|} } BIR function invocations models Java method invocations (static, special, virtual, or interface) BIR function invocations models Java method invocations (static, special, virtual, or interface) Dynamic dispatch of methods

Modeling Java Programs public static void baz() { try { … } catch (Throwable t) { … } throwable record (|java.lang.Throwable|) extends (|java.lang.Object|) {…} function {|baz|}() { (|java.lang.Throwable|) [|t|]; loc loc0: do { … } goto loc1; loc loc1: do { … } return; loc loc2: do { … } goto loc1; catch (|java.lang.Throwable|) [|t|] at loc0 goto loc2; } Exceptions Throwable record Catch tables are used to keep track try-catch regions (order of declarations) Catch tables are used to keep track try-catch regions (order of declarations)

Other BIR Features High-level constructs Functional sub-language Example Extension: Channels Bogor Modeling Language and UI Example: Dining philosophers Demo: Bogor UI in Eclipse Modeling Java programs Java classes and methods Dynamic dispatch of methods Exceptions Overview Outline

High-level BIR Motivation while low-level BIR is suitable as a target for automatic translation, it is too cumbersome to use for manual modeling provides high-level constructs similar to most modern programming languages such as loops, try-catch, etc. high-level BIR constructs are translated to low-level BIR before model checking starts

High-level BIR: Example throwable record NullPointerException { } throwable record IllegalArgumentException {} record ListNode { ListNode next; int data; } function sumAllElementsOver5(ListNode head) returns int { int firstElementData; int total; firstElementData := head.data; while head != null do choose when 5> do total := total + head.data; else do skip; end head := head.next; end return total; } Statement sequencing, while loop, choose block, atomic expression, etc. Statement sequencing, while loop, choose block, atomic expression, etc.

High-level BIR: Example NullPointerException npe; IllegalArgumentException iae; ListNode n; int length; try length := sumAllElementsOver5( createNode(5, createNode(7, null))); length := sumAllElementsOver5(null); catch (IllegalArgumentException iae) skip; catch (NullPointerException npe) assert false; end try-catch block

BIR Functional Sub-language Motivation wants to allow complex queries of states while guaranteeing purity very useful for specification purposes Syntax and semantics similar to other functional languages (SML, etc.) currently only support first-order function

BIR Functional Sub-language: Example record ListNode { Node next; int data; } fun sortedList(ListNode n) returns boolean = let ListNode next = n.next in next == null ? true : (n.data <= next.data ? sortedList(next) : false); A recursive function to determine whether a given list is sorted (in ascending order) A recursive function to determine whether a given list is sorted (in ascending order)

BIR Extensions extension Channel for MyChannel { // declaration of abstract types typedef type ; // declaration of abstract expresions expdef Channel.type create (int); expdef boolean isEmpty (Channel.type ); expdef 'a getFirst (Channel.type ); // declaration of abstract actions/commands actiondef send (Channel.type, 'a); actiondef removeFirst (Channel.type ); } BIR allows introduction of new abstract types and operations BIR allows introduction of new abstract types and operations Channel.type chan; int x; … chan := Channel.create (5); // ch 5 slots … Channel.send (chan, 0); // send 0 … x := Channel.getFirst (chan); // recv 1st Channel.removeFirst (chan); Sample usage

BIR Assessment Variety of application domains and system level descriptions often work at different level of abstractions BIR provides features commonly found in modern programming languages Dynamic creation of objects and threads, automatic memory management, etc. BIR provides extension mechanism to bridge the gap between system descriptions and BIR can be extended on-demand basis minimize changes of Bogor components parser/lexer, symbol table, AST, type system, etc.