1 BOGOR – A Flexible Framework For Creating Model Checkers Presented by : Roli Shrivastava 20 March 2007.

Slides:



Advertisements
Similar presentations
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Advertisements

Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Model Checker In-The-Loop Flavio Lerda, Edmund M. Clarke Computer Science Department Jim Kapinski, Bruce H. Krogh Electrical & Computer Engineering MURI.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
1 Spin Model Checker Samaneh Navabpour Electrical and Computer Engineering Department University of Waterloo SE-464 Summer 2011.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Programming Languages Structure
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Data Structures and Programming.  John Edgar2.
Formal Techniques for Verification Using SystemC By Nasir Mahmood.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
MT311 Java Application Programming and Programming Languages Li Tak Sing ( 李德成 )
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
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.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Lec 6 Data types. Variable: Its data object that is defined and named by the programmer explicitly in a program. Data Types: It’s a class of Dos together.
Generative Programming. Automated Assembly Lines.
Introduction to Exception Handling and Defensive Programming.
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.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS251 – Software Engineering Lecture 9: Software Design Slides by Mohammad El-Ramly, PhD
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Domain-specific Model Checking with Bogor SAnToS Laboratory, Kansas State University, USA US Army Research Office (ARO)
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
1 Bogor – Software Model Checking Framework Presented by: Arpita Gandhi.
 Programming - the process of creating computer programs.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Automated Formal Verification of PLC (Programmable Logic Controller) Programs
( = “unknown yet”) Our novel symbolic execution framework: - extends model checking to programs that have complex inputs with unbounded (very large) data.
Session 02 Module 3: Statements and Operators Module 4: Programming constructs Module 5: Arrays.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
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.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Types for Programs and Proofs
The Development Process of Web Applications
Model Checking Software Using The Bogor Framework
Model Checking Software Using The Bogor Framework
Over-Approximating Boolean Programs with Unbounded Thread Creation
Introduction to Data Structure
(Computer fundamental Lab)
The Bogor Model Checking Framework
Presentation transcript:

1 BOGOR – A Flexible Framework For Creating Model Checkers Presented by : Roli Shrivastava 20 March 2007

2 Model Checking What is Model Checking?

3 Model checking is a process of checking whether a given model satisfies a given logical formula Effective technology for verification and debugging in hardware and more recently in software domains. Detecting coding flaws that are hard to detect using existing quality assurance methods Verifying that system models and implementations satisfy crucial temporal properties MODEL CHECKING Model checking

4 WHATS WRONG with EXISTING TOOLS?? Motivation for domain-specific model checking…..  Existing Model Checkers tools are Spin, FDR and NuSMV support fixed input languages state-space representations reduction and exploration algorithms.  Model-driven development : Domain-specific model checkers are more effective than general purpose model checkers.  Product-line architectures and reusable middleware infrastructure. Model checking

5 Continued… Synergistic blending of automated quality assurance technique. Sheer variety of application domains and computation models. Model checking

6 SOLUTION to the ABOVE PROBLEM BOGOR Developed by the SAnToS Group at Kansas State University and the ESQuaReD Group at University of Nebraska (Lincoln). Bogor is an extensible and customizable software model checking framework  state of the art software model checking algorithms  Visualizations  user interface designed to support both general purpose and domain-specific software model checking. BOGOR

7 WHY BOGOR? In contrast to many model checkers, Bogor is a highly modular and extensible software model checking framework well-designed API using design patterns make it possible to add/replace/refine module implementations crucial features for domain-specific customizations BOGOR -Features

8 WHY BOGOR continues… Features:  Direct Support of OOL  Extensible Modeling Language  Open Modular Architecture  Design for Encapsulation  Pedagogical Materials BOGOR -Features

9 FEATURES in DETAIL Direct support of features (object-oriented)  dynamic creation of threads and objects  object inheritance  virtual methods  exceptions, garbage collection, etc. Bogor's modeling language can be extended  new primitive types  expressions, and commands associated with a particular domain (e.g, multi-agent systems, avionics, security protocols, etc.)  a particular level of abstraction (e.g., design models, source code, byte code, etc.). BOGOR -Features

10 FEATURES contd… Bogor's open architecture well-organized module facility allows new algorithms  for state-space exploration, state storage, etc  new optimizations (e.g., heuristic search strategies, domain- specific scheduling, etc.) Bogor has a robust feature-rich graphical interface implemented as a plug-in for Eclipse Bogor is an excellent pedagogical vehicle for teaching foundations and applications of model checking  it allows students to see clean implementations of basic model checking algorithms  to easily enhance and extend these algorithms in course projects BOGOR -Features

11 Cited:

12 BIR : BOGOR Intermediate Representation Supported types - basic: boolean, int, long, float, double - range types: int (lower, upper), long (lower, upper) - enumeration types: enum cards {spades, hearts, clubs, diamonds} - Non-primitive types  record, array, string, lock, extensions All types in BIR are bounded (finite) (e.g., int: to ) have a default value (e.g., int, long: 0) BIR

13 BIR Cont’d Scope: functions and threads have own namespace, but can’t hide with global declarations Locations: control pts in threads Jump and Catch statements Actions: assign, assert, assume, lock, throw, exit BIR

14 BIR: HIGH LEVEL / LOW LEVEL SYNTAX High level Syntax  Used for manual understanding and model construction  Includes high-level programming constructs: atomic, while, if, else-if, else, try, catch, skip, return, choose  During model checking, converted to low level Low level Syntax  Used for automatic model extraction  Interleaving only happen between locations  Basic syntax: loc[ation], live, do, when, visible, goto, catch, return BIR

15 Example: CounterExample High-level system CounterExample { int i := 0; active[3] thread MAIN() { atomic choose when do i := i + 1; when do i := i + 2; else do i := i + 3; end } Cited: BIR

16 BIR Low Level system CounterExample { int i := 0; active [3] thread MAIN() { boolean temp$0; boolean temp$1; boolean temp$2; ANY_THROWABLE atomicCatch$Local; loc loc0: do { Atomic.beginAtomic(); } goto loc1; loc loc1: do invisible { temp$0 := i < 1; temp$1 := i < 2; temp$2 := !((temp$0 || temp$1)); } goto loc2; loc loc2: when temp$0 do invisible { } goto loc3; when temp$1 do invisible { } goto loc5; when temp$2 do invisible { } goto loc7; loc loc3: do { i := i + 1; } goto loc4; loc loc4: do { } goto loc9; loc loc5: do { i := i + 2; } goto loc6; loc loc6: do { } goto loc9; loc loc7: do { i := i + 3; } goto loc8; loc loc8: do { } goto loc9; loc loc9: do { Atomic.endAtomic(); } goto loc10; loc loc10: do { } return; loc atomicCatch: do { Atomic.endAtomic(); throw atomicCatch$Local; } goto atomicCatch; catch ANY_THROWABLE atomicCatch$Local at loc1, loc2, loc3, loc4, loc5, loc6, loc7, loc8 goto atomicCatch; } extension Atomic for edu.ksu.cis.bogor.projects.bogor.ext.atomicity.AtomicModule { actiondef beginAtomic (); actiondef endAtomic (); } throwable record ANY_THROWABLE {} } Cited: BIR

17 Cited:

18 COMPONENTS and MODULES Front-End Components provide access to in-memory representations of BIR models Interpretative Components provide access methods and data structures to interpret BIR models Model Checking Components provide implementations of model checking algorithms Modular Architecture - BOGOR

19 Tier1 : Front End Module The following slides discuss about the Front End Module

20 Cited:

21 Cited:

22 Cited:

23 SUMMARY OF TIER-1 Bogor, like an Interpreter/compiler has front-end module  to process a BIR model textual representation  Build an in-memory representation suitable for analysis/model checking The basic front-end has  Lexer  Parser  Well-formed-ness checke  + some data structures ( AST, symbol table etc) Tier-1 Summary - BOGOR

24 TIER 2 : Interpretative Component Module The slides following would discuss this component

25 Cited:

26 Cited:

27 I-VALUE FACTORY Values are created using the I-Value Factory Provide access methods to :- i) get the type of the value. ii) create the default value of a certain type. iii) create new int values, with or without types. Tier-2 I-value - BOGOR

28 I-STATE FACTORY provide methods to: create the initial state i) needs to provide an interface to wrap state data: for example, global values, the local values of each thread, and the location of each thread, and the thread ids ii) can be extended to provide additional information create thread descriptors (guaranteed to be unique) Tier-2 I-state - BOGOR

29 IExpEVALUATOR MODULE evaluates an expression in a given context ISchedulingStrategyContext  contains methods to access the state and the executing thread id Tier-2 I-expEval - BOGOR

30 I-ACTION EVALUATOR MODULE execute an action in a given context ignore the array of IBacktrackingInfo for now action executions usually change the state Tier-2 I-action - BOGOR

31 SUMMARY OF TIER-2 BOGOR Interpretative components are similar to an imperative Language interpreter’s  has a module to evaluate expressions  Has a module to evaluate actions Factories are used to create Values and States, thus decoupling usage and creation Several Data-structures are generated/ used for model checking Tier-2 summary - BOGOR

32 Tier 3 : Model Checking Module The coming slides discusses Model checking Module in detail.

33 Cited:

34 I-SEARCHER MODULE Navigating the State Space I-Searcher controls how we traverse the state space graph. Tier-3 I-searcher - BOGOR

35 Cited: Tier-3 I-searcher - BOGOR

36 Cited:

37 I-SCHEDULER MODULE Cited: Tier-3 I-scheduler - BOGOR

38 STEPS FOR SCHEDULING Cited: Tier-3 I-scheduler - BOGOR

39 Continues…. Cited: Tier-3 I-scheduler - BOGOR

40 WHY Do We Need I-Scheduler Used to:  determine enabled transitions  determine which transition to take  create strategy information DefaultSchedulingStrategist  Full state-space exploration the scheduling policy ensure that each state is visited  At each choice point, the info contains the number of enabled transitions, and the last chosen transition index  advise() simply increase the last chosen transition index until all are chosen Tier-3 I-scheduler - BOGOR

41 I-BACKTRACKING Since the analyzer is not holding states in the stack, if it needs to back-track and return to a previously encountered state, it needs an “undo” operation to run the transitions in the reverse direction. Information needed to backtrack  state, thread ID, etc. scheduling information like  which nondeterministic choice was made, if any  specific info for each kind of action, transformation, etc. Tier-3 I-backtracking - BOGOR

42 I-STATE MANAGER MODULE Used to keep track states that have been visited before storing the states Also, assigns a unique number for each stored state (state id) Hence uses the number instead of the actual state in the DFS stack. Tier-3 I-state-manager - BOGOR

43 SUMMARY FOR TIER-3 Implementations of Model checking functional aspects are modular Can be customized to a specific-domain application:  Search algorithms can be customized to used heuristics to find bugs faster  Scheduler can be customized to enforce a specific scheduling policy  State manager can be customized to allow different encodings Tier-3 Summary- BOGOR

44 IS BOGOR FLEXIBLE ?? ( KIASAN ) Kiasan – A Verification and Test-Case Generation Framework for Java based on Symbolic Execution Built by customizing the following Bogor Modules: 1. IValueFactory: Concrete value representations symbolic value representations. 2. IStateFactory: State representations of the data structure symbolic data values and to include data constraints. 3. IStateManager: Kiasan’s symbolic execution engine performs stateless Search. The traditional state matching is changed to never store states stage. 4. JVM Extension Interpretation: The JVM code in Bogor a code that interprets byte codes including exploration of conditional paths as well. Kiasan

45 Capabilities of KIASAN automatic checking of code against user-supplied contracts flexible control over the depth/coverage of checking by adjusting tool parameters automatic generation of both abstract and concrete execution path automatic generation of JUnit test cases Kiasan

46 Bogor within the development Process Eclipse-Based Graphical user Interface  Eclipse like Bogor is implemented in JAVA => tight integration of Bogor and its GUI contents and extensions. Encapsulation in other tools  Developing Bandera, Cadena ( for CORBA ) by customizing BOGOR.  Helped in space and time improvements (more than 3 times as compared to SPIN / dSPIN) Placement of model checking in a development process  Model checking at design time Space state will be smaller

47 SUMMARY of EXPERIENCE using BOGOR In 1 year Bogor has been downloaded more than 1000 times by individuals in 32 countries. Till date, more than 35 substantive extensions of Bogor. Has around approx 23 APIs  Extensions requires generally few 100 lines of code  Mostly modeled from the already existing extensions It is a robust and well-reasoned foundation : used for modern Software systems. Summary of Exp

48 ANY QUESTIONS??

49