Arjav Dave Jitendra Gupta Nishit Shah. Agenda  Overview  Alloy Architecture  Alloy Specification Language  Alloy Analyzer Demo  Comparisons  Conclusion.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 2.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2013 Lecture 4.
– Seminar in Software Engineering Cynthia Disenfeld
Micromodels of Software
Semantics Static semantics Dynamic semantics attribute grammars
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Alan Shaffer, Mikhail Auguston, Cynthia Irvine, Tim Levin The 7th OOPSLA Workshop on Domain-Specific Modeling October 21-22, 2007 Toward a Security Domain.
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.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
ISBN Chapter 3 Describing Syntax and Semantics.
1 Simulator-Model Checker for Reactive Real-Time Abstract State Machines Anatol Slissenko University Paris 12 Pavel Vasilyev University Paris 12 University.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Towards a Lightweight Model of BGP Safety Matvey Arye Princeton University Joint work with: Rob Harrison, Richard Wang, Jennifer Rexford (Princeton) Pamela.
1 A UML Class Diagram Analyzer Tiago Massoni Rohit Gheyi Paulo Borba Software Productivity Group Informatics Center – UFPE October 2004.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Using UML and Alloy to Specify and Analyze Access Control Features Eunjee Song, Xi Hua SP05-CS681 Project Proposal.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Describing Syntax and Semantics
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
272: Software Engineering Fall 2008 Instructor: Tevfik Bultan Lectures 5, 6, and 7: Alloy and Alloy Analyzer.
1 Relational Algebra and Calculus Chapter 4. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.
Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems.
Intro. to Logic CS402 Fall Propositional Calculus - Semantics (2/3) Propositional Calculus - Semantics (2/3) Moonzoo Kim CS Division of EECS Dept.
1 COSC 4406 Software Engineering COSC 4406 Software Engineering Haibin Zhu, Ph.D. Dept. of Computer Science and mathematics, Nipissing University, 100.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Paper by: A. Pnueli O. Shtrichman M. Siegel Course: Served to: Professor Orna Grumberg Served By: Yehonatan Rubin.
1 Relational Algebra and Calculas Chapter 4, Part A.
Analyzing relational logic Daniel Jackson, MIT WG 2.3 · Newcastle April 2000.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
DL Overview Second Pass Ming Fang 06/19/2009. Outlines  Description Languages  Knowledge Representation in DL  Logical Inference in DL.
1 Formal Methods in SE Abstract Model Specification Lecture # 19.
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.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Formal Specification: a Roadmap Axel van Lamsweerde published on ICSE (International Conference on Software Engineering) Jing Ai 10/28/2003.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
1 Abstract Model Specification. 2 Explicitly describes behavior in terms of a model using well-defined types (viz. set, sequences, relations, functions)
UW CSE 503 ▪ Software Engineering ▪ Spring 2004 ▪ Rob DeLine1 CSE 503 – Software Engineering Lecture 3: An introduction to Alloy Rob DeLine 5 Apr 2004.
This Week Lecture on relational semantics Exercises on logic and relations Labs on using Isabelle to do proofs.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
On Combining Multi-formalism Knowledge to Select Models for Model Transformation Testing Sagar Sen (1 st year PhD student), Benoit Baudry, Jean-Marie Mottu.
Debugging declarative models using core extraction Robert Seater with Ilya Shlyakhter, Daniel Jackson, Manu Sridharan, Mana Taghdiri December 20, 2005.
Alloy Analyzer 4 Tutorial Session 3: Static Modeling Greg Dennis and Rob Seater Software Design Group, MIT.
Security analysis of COM with Alloy
Logical architecture refinement
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
Model the non-negative even integers
Over-Approximating Boolean Programs with Unbounded Thread Creation
Dichotomies in CSP Karl Lieberherr inspired by the paper:
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Arjav Dave Jitendra Gupta Nishit Shah

Agenda  Overview  Alloy Architecture  Alloy Specification Language  Alloy Analyzer Demo  Comparisons  Conclusion

History The Alloy language was designed by Daniel Jackson, with help from Ilya Shlyakhter and Manu Sridharan at MIT. Analyzer developed by Software Design Group Alloy 1.0 [1999] Alloy 2.0 [2001] Alloy 3.0 [2004] Alloy 4.0 [2006]

Overview  Alloy is a Light-weight, structural modeling language which is based on First Order Logic  Z has a major influence on Alloy  Alloy has its own automatic analysis tool  Alloy is similar to OCL but it has a more conventional syntax and a simpler semantics

Key Concepts 1.Alloy consists of atoms and relations:  An atom is a primary entity with indivisible, immutable and un- interpreted as its properties.  Relations are structures that relate atoms where each relation is a set of ordered tuples. 2. Non-specialized Logic:  Alloy does not need special logic for state machines, traces, synchronization and concurrency.  Here everything can be represented by relations and atoms.

3. Alloy has counter examples and finite scope  provides counter examples for invalid models  checks models for finite scope only 4. Alloy analyzes using SAT:  SAT – Boolean Satisfiability Problem  Analyzer based on KODKOD (Alloy 4.0)  KODKOD – an efficient SAT-based constraint solver  Allows analyzing of partial models Key Concepts

Difference Between Alloy Analyzer and Model Checkers The Alloy Analyzer is designed for analyzing state machines with operations over complex states Model checkers are designed for analyzing state machines that are composed of several state machines running in parallel, each with relatively simple state

Difference Between Alloy Analyzer and Theorem Provers The Alloy Analyzer’s analysis is fully automatic, and when an assertion is found to be false, the Alloy Analyzer generates a counterexample. It’s a “refuter” rather than a “prover”. When a theorem prover fails to prove a theorem, it can be hard to tell what’s gone wrong: whether the theorem is invalid, or whether the proof strategy failed.

 Conversion to negation normal form and removing all the existential quantifiers from the formula.  The formula is translated for a chosen scope to a boolean formula.  Boolean formula is converted to a conjunctive normal form  Boolean formula is presented to the SAT solver.  Incase the solver finds a model, a model of the relational formula is then reconstructed from it. Alloy Architecture

Alloy formula Instance Broad scope Translate formula Mapping Translate Model Boolean Formula SAT solver Boolean instance

1. Signature Declarations  Declaration of sets and relation 2. Constraint Paragraphs  Consists of facts, predicates and functions to form constraints 3. Assertions  Properties expected to hold 4. Commands  Run and check which instruct the analyzer to perform verification Module Elements

 Signatures represent sets of objects in the system  Relations are defined in the signature body  Relation=Field of Class  Example: sig FSObject{ parent: lone Dir } Signature

sig FSObject{} sig dir extends FSObject{contents : set FSObject} sig file extends FSObject{} Extends means File is a subset of all FSObjects Files are disjoint from Dir Signature FSObject DirFile

 Avoid examples that violate fact  d must be the parent of o  Example: fact{ all d: Dir, o: d.contents | o.parent = d } Fact

 Claims something must be true due to the behavior of the system  Example: assert acyclic { no d: Dir | d in d.^contents } check acyclic for 5  No directory is a content of itself Assertion

 Given an assertion we can check it as follows:  Negate the assertion and conjunct it with the rest of the specification  Look for a model for the resulting formula, if there exists such a model (i.e., the negation of the formula is consistent) then we call such a model a counterexample Assertion

Fact and Assert Fact Force a constraint If false then no model is generated All facts can be validated together Assert Check for a condition If false counterexample are generated Each assert statement is done at a time

 Over-Constrained: Eliminate possibilities intended to allow  Under-Constrained: Specification allows some unintended behaviors  Run Command finds both over-constraint and under-constraint errors Constraint Problems

 Constraints to be used in different contexts are packaged as predicates  A predicate is similar to function except that its output is true or false and not an expression or term  Pred move [fs,fs’: FileSystem, x:FSObject, d:Dir]{ (x+d) in fs.objects fs’.parent = fs.parent – x->(x.(fs.parent)) + x->d } Predicates

Run:  Run is executed on the predicate  Run shows the instance for which predicate is true Check:  Check is written for assertion statement  Outcome is counterexample if check is false. Run and Check

 Maximum number of objects for which model is evaluated  Maximum scope 2^32  Keyword “exactly” can be used in scope specification  Example  Check A for 5  Check A for exactly 3 Directory, exactly 5 File Scope

 Constants  Set Operators noneempty set univuniversal set idenidentity relation +union &intersection -difference insubset =equality  product operator Relational Operators

 Join operators  Unary operators.dot join [ ]box join ~transpose ^transitive closure *reflexive transitive closure Relational Operators

 Boolean operators !notnegation &&andconjunction | ordisjunction =>impliesImplication,elsealternative  iffbi-implication Relational Operators

 quantifiers  set declarations allF holds for every x in e someF holds for at least one x in e noF holds for no x in e loneF holds for at most one x in e oneF holds for exactly one x in e setany number oneexactly one lonezero or one someone or more Relational Operators

sig FSObject { parent: lone Dir }// A file system object sig Dir extends FSObject { contents: set FSObject }// A directory sig File extends FSObject { }// A file in the file system fact { all d: Dir, o: d.contents | o.parent = d } //directory is parent of its contents fact { File + Dir = FSObject }// All FSO are files or directories one sig Root extends Dir { } { no parent }// There exists one root directory fact { FSObject in Root.*contents }// File system is connected assert oneRoot { one d: Dir | no d.parent }// File system has one root check oneRoot for 5// Now check it for a scope of 5 File System Example

ALLOY ANALYSER DEMO

Two types of analysis: Simulation, in which consistency of an invariant or an operation is demonstrated by generating an environment that models it Checking, in which a consequence of the specification is tested by attempting to generate a counter-example Simulation is for determining consistency (i.e., satisfiability) and Checking is for determining validity Type of Analysis

 If a formula has at least one model then the formula is consistent (i.e., satisfiable)  If every (well-formed) environment is a model of the formula, then the formula is valid  Alloy analyzer restricts the simulation and checking operations to a finite scope  Validity and consistency problem within a finite scope are decidable problems Type of Analysis (2)

Comparison with UML Has similarities (graphical notation, OCL constraints) but it is neither lightweight, nor precise UML includes many modeling notions omitted from Alloy

Comparison with OCL ALLOY Simple but less expressive semantics No support for data types such as Strings, Real no., etc Support for Partial Models Automatic tool support OCL More expressive but challenging semantics Supports different data types unlike Alloy Does not support partial models Lacks Automatic tool support

Comparison with Z ALLOY Written in ASCII format and notations are easily available Simple and restrictive semantics Tool support is readily available for free Finite Scope checking Z Z notations are not available easily Complex and expressive semantics Different tools in the market but not free Scope need not be known

 Scheduling  Document structuring  Cryptography  File System synchronization  Network configuration protocols Applications

Application In Industry Animating requirements (Venkatesh, Tata) Military simulation (Hashii, Northtrop Grumman) Generating network configurations (Narain, Telcordia)

Application In Research Exploring design of switching systems (Zave, AT&T) Checking refinements (Bolton, Oxford) Security features (Pincus, MSR)

Good Things conceptual simplicity and minimalism very little to learn WYSIWYG: no special semantics (e.g., for state machines) High Level Notation constraints -- can build up incrementally relations flexible and powerful Automatic Analysis counterexamples are never spurious visualization a big help

Limitations (Bad Things) Poor scaling No notion of time and hence unsuitable for reachability analysis or chain of operations Since the analyzer depends on user specifications and scope, false positives are possible The only primitive type supported is integers Recursive functions hard to express Module system doesn’t offer real encapsulation

 Easy to understand paragraph structure  Graphical representation of the Analyzer is really helpful in easily understanding instances  We found that Tool support for static variables is easily available but the Dynamic variables are left neglected  Alloy has limited expressiveness and is designed for semantic analysis Conclusion

pdf 9.pdf References

Thank You QUESTIONS???