Micromodels of Software

Slides:



Advertisements
Similar presentations
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
Advertisements

Model Checking Lecture 2. Three important decisions when choosing system properties: 1automata vs. logic 2branching vs. linear time 3safety vs. liveness.
1 Reasoning with Promela Safety properties bad things do not happen can check by inspecting finite behaviours Liveness properties good things do eventually.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 2.
Verification of DSMLs Using Graph Transformation: A Case Study with Alloy Zekai Demirezen 1, Marjan Mernik 1,2, Jeff Gray 1, Barrett Bryant 1 1 Department.
Example: Binary Adder We want to construct a finite state machine that will add two numbers. The input is two binary numbers, (xn…x1x0)2 and (yn…y1y0)2.
Introducing JavaScript
Global States.
– Seminar in Software Engineering Cynthia Disenfeld
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
Alan Shaffer, Mikhail Auguston, Cynthia Irvine, Tim Levin The 7th OOPSLA Workshop on Domain-Specific Modeling October 21-22, 2007 Toward a Security Domain.
One Dimensional Arrays
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Alloy Vatche Ishakian Boston University- CS511 March/24/2008 Contributors: Andrei Lapets, Michalis Potamias, Mark Reynolds.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
1 Programming Languages (CS 550) Lecture Summary Functional Programming and Operational Semantics for Scheme Jeremy R. Johnson.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
So What Does it All Mean? Geospatial Semantics and Ontologies Dr Kristin Stock.
Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson.
1 A UML Class Diagram Analyzer Tiago Massoni Rohit Gheyi Paulo Borba Software Productivity Group Informatics Center – UFPE October 2004.
Introduction to Databases
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
 Let A and B be any sets A binary relation R from A to B is a subset of AxB Given an ordered pair (x, y), x is related to y by R iff (x, y) is in R. This.
Formal Modeling of an Openflow Switch using Alloy Natali Ruchansky and Davide Proserpio.
 We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is.
Author: Graham Hughes, Tevfik Bultan Computer Science Department, University of California, Santa Barbara, CA 93106, USA Source: International Journal.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
LDK R Logics for Data and Knowledge Representation PL of Classes.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Arjav Dave Jitendra Gupta Nishit Shah. Agenda  Overview  Alloy Architecture  Alloy Specification Language  Alloy Analyzer Demo  Comparisons  Conclusion.
ECSE Software Engineering 1I HO 4 © HY 2012 Lecture 4 Formal Methods A Library System Specification (Continued) From Specification to Design.
CS6133 Software Specification and Verification
Systems Analysis and Design in a Changing World, 6th Edition
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Verification & Validation By: Amir Masoud Gharehbaghi
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 3: An introduction to Alloy Rob DeLine 5 Apr 2004.
Properties as Processes : FORTE slide Properties as Processes: their Specification and Verification Joel Kelso and George Milne School of Computer.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
Predicate Calculus CS 270 Math Foundations of Computer Science Jeremy Johnson Presentation uses material from Huth and Ryan, Logic in Computer Science:
Operational Semantics of Scheme
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Automatic Test Generation
Security analysis of COM with Alloy
Input Space Partition Testing CS 4501 / 6501 Software Testing
September 4, 1997 Programming Languages (CS 550) Lecture 6 Summary Operational Semantics of Scheme using Substitution Jeremy R. Johnson TexPoint fonts.
IS 2935: Developing Secure Systems
Formal Methods in software development
Formal Methods in software development
MA/CSSE 474 More Math Review Theory of Computation
Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract, Computer,
Formal Methods in software development
Translating Linear Temporal Logic into Büchi Automata
Dichotomies in CSP Karl Lieberherr inspired by the paper:
Presentation transcript:

Micromodels of Software Formal Methods in Verification of Computer Systems Jeremy Johnson

Outline Semantic Entailment Model checking Given a set of formulas , is  ⊨  valid  encodes requirements and  as a property that all valid implementations should have Undecidable Model checking Given a formula  and a matching model M determine whether M ⊨l  holds Requirements encoded in model Fixes too many implementation choices

Outline Combination Small scope hypothesis Alloy (alloy.mit.edu) Set of models (bounded size) Negative answer provides counter example Positive answer gives confidence Small scope hypothesis Negative answers tend to occur in small models Alloy (alloy.mit.edu)

Models Let F be a set of functions and P a set of predicates. A model M for (F,P) consists of A non-empty set A [universe] of concrete values For each nullary f  F an element of A = fM For each n-ary f  F a function fM : An  A For each n-ary P  P a subset PM  An

Satisfaction Given a model M for (F,P) and given an environment l : var  A the satisfaction relation M ⊨l  P(t1,…,tn)  (a1,…,an) and M ⊨l  iff (a1,…,an)  RM M ⊨l x  iff M ⊨l [x  a] holds for all a  A M ⊨l x  iff M ⊨l [x  a] holds for some a  A

Satisfaction Given a model M for (F,P) and given an environment l : var  A the satisfaction relation M ⊨l  M ⊨l  iff M ⊨l  does not hold M ⊨l 1  2 iff M ⊨l 1 and M ⊨l 2 holds M ⊨l 1  2 iff M ⊨l 1 or M ⊨l 2 holds M ⊨l 1  2 iff M ⊨l 2 holds whenever M ⊨l 1 holds

Semantic Entailment Let  be a set of formulas (possibly infinite) and  be a formula from predicate calculus  ⊨  holds iff for all models M and lookup tables l, whenever M ⊨l  holds for all  then M ⊨l  holds as well  is satisfiable iff there is some model M and lookup table l such that M ⊨l  holds  is valid iff M ⊨l  holds for all models M and lookup tables l

Example 1 F = {i} and P = {R,F} i a constant function, R binary and F unary predicates Model – A set of states, initial state i, state transitions R, final states F A = {a,b,c} iM = a RM = {(a,a),(a,b),(a,c),(b,c), (c,c)} FM = {b,c}

Example 1 y R(i,y) F(i) x y z (R(x,y)  R(x,z)  y = z ) x y R(x,y)

Software Micromodels Want description M of all compliant implementations Mi of some software system. Given a property  Assertion checking: does  hold in all implementations Mi  M Consistency checking: does  hold in some implementations Mi  M

Alloy (alloy.mit.edu) “Alloy is a language for describing structures and a tool for exploring them. It has been used in a wide range of applications from finding holes in security mechanisms to designing telephone switching networks.” Declarative (language based on logic) Bounded queries Implemented using SAT solver Illustrate by describing concrete models of state machines (example 1) and checking assertion that “final states are not initial states) and consistency there are state machines that contain a non-final state that is deadlocked

Alloy Implementation module AboutStateMachines sig State {} -- simple states sig StateMachine { -- composite state machines A : set State, -- set of states of a state machine i : A, -- initial state of a state machine F : set A, -- set of final states of a state machine R : A -> A -- transition relation of a state machine }

Alloy Implementation -- E.G. assertion checking -- Claim that final states are never initial: false. assert FinalNotInitial { all M : StateMachine | no M.i & M.F } check FinalNotInitial for 3 but 1 StateMachine S0 S1 (F) S2 (I,F) R

Alloy Implementation -- E.G. consistency checking -- Is there a three-state machine with a non-final deadlock? True. pred AGuidedSimulation(M : StateMachine, s : M.A) { no s.(M.R) not s in M.F # M.A = 3 } run AGuidedSimulation for 3 but 1 StateMachine S0 S1 (F) R R S2 (I)

Example 2 F = {alma} and P = {loves} P is a binary predicates, alma constant function Model – A set of states, A = {a,b,c} almaM = a lovesM = {(a,a),(b,a),(c,a)}

Example 2 almaM = a lovesM = {(a,a),(b,a),(c,a)} lovesM’ = {(b,a),(c,b)} Does the model satisfy None of Alma’s lovers’ lovers love her xy (loves(x,alma)  loves(y,x)   loves(y,alma)

Alloy Implementation R module AboutAlma sig Person {} sig SoapOpera { cast : set Person, alma : cast, loves : cast -> cast } assert OfLovers { all S : SoapOpera | all x, y : S.cast | S.alma in x.(S.loves) && x in y.(S.loves) => not S.alma in y.(S.loves) check OfLovers for 2 but 1 SoapOpera Person0 Alma Person1 R

Underspecified System Add the following constaint Fact NoSelfLove { all S : SoapOpera, p : S.cast | not p in p.(S.loves) } No there are no counter examples Increase the number of persons to 3 provides the smallest counter example check OfLovers for 3 but 1 SoapOpera

Exercise Install alloy Go through the tutorial (file system example) Study package dependency example from section 2.7 of the text www.cs.bham.ac.uk/research/projects/lics Look under ancillary materials Note that code is for an older version of alloy and some changes are necessary