Ethan Jackson, Nikolaj Bjørner and Wolfram Schulte Research in Software Engineering (RiSE), Microsoft Research 1. A FORMULA for Abstractions and Automated.

Slides:



Advertisements
Similar presentations
Demand-driven inference of loop invariants in a theorem prover
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
First Order Logic Logic is a mathematical attempt to formalize the way we think. First-order predicate calculus was created in an attempt to mechanize.
Software Model Checking with SMT Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A.
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
SMT Solvers (an extension of SAT) Kenneth Roe. Slide thanks to C. Barrett & S. A. Seshia, ICCAD 2009 Tutorial 2 Boolean Satisfiability (SAT) ⋁ ⋀ ¬ ⋁ ⋀
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
1 How to transform an analyzer into a verifier. 2 OUTLINE OF THE LECTURE a verification technique which combines abstract interpretation and Park’s fixpoint.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Logic as the lingua franca of software verification Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A Joint work with Andrey Rybalchenko.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 19: Minding Ps & Qs: Axiomatic.
ISBN Chapter 3 Describing Syntax and Semantics.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
CS 355 – Programming Languages
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
Nikolaj Bjørner Microsoft Research Lecture 3. DayTopicsLab 1Overview of SMT and applications. SAT solving, Z3 Encoding combinatorial problems with Z3.
Model Checking. Used in studying behaviors of reactive systems Typically involves three steps: Create a finite state model (FSM) of the system design.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Review: forward E { P } { P && E } TF { P && ! E } { P 1 } { P 2 } { P 1 || P 2 } x = E { P } { \exists … }
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Describing Syntax and Semantics
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Finding Minimum Type Error Sources Zvonimir Pavlinovic Tim King Thomas Wies New York University.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
Planning: Wrap up CSP Planning. Logic: Intro CPSC 322 – Planning 3 Textbook §8.4, §5.1 March 2, 2011.
Formal Methods: Three suggestions for rapid adoption Wolfram Schulte RiSE, MSR Workshop on Usable Verification 11/15/2010.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
1 Introduction to Software Engineering Lecture 1.
Ethan Jackson, Nikolaj Bjørner and Wolfram Schulte Research in Software Engineering (RiSE), Microsoft Research 3. FORMULA : Composing and Transforming.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Semantics In Text: Chapter 3.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
1 Typing XQuery WANG Zhen (Selina) Something about the Internship Group Name: PROTHEO, Inria, France Research: Rewriting and strategies, Constraints,
12/9/20151 Programming Languages and Compilers (CS 421) Elsa L Gunter 2112 SC, UIUC Based in part on slides by Mattox.
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015Information Security, CS 5261.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
R-Verify: Deep Checking of Embedded Code James Ezick † Donald Nguyen † Richard Lethin † Rick Pancoast* (†) Reservoir Labs (*) Lockheed Martin The Eleventh.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
1 Ontological Foundations For SysML Henson Graves September 2010.
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Sub-fields of computer science. Sub-fields of computer science.
Automatic Test Generation
From Classical Proof Theory to P vs. NP
Matching Logic An Alternative to Hoare/Floyd Logic
Objective of This Course
CSE 311 Foundations of Computing I
Formal Methods in software development
Instructor: Aaron Roth
Presentation transcript:

Ethan Jackson, Nikolaj Bjørner and Wolfram Schulte Research in Software Engineering (RiSE), Microsoft Research 1. A FORMULA for Abstractions and Automated Analysis Dirk Seifert, Markus Dahlweid and Thomas Santen European Microsoft Innovation Center (EMIC), Microsoft Research

Abstractions let us formally reason using about properties using only the relevant details. Why Abstractions? For example, we don’t reason about functional properties of software with an oscilloscope…

The Right Abstraction Pays Off… Can apply axioms to automatically reason about a model of a program Trace showing a reachable bug Axioms of machineInitial Configuration x = 2; y = 2 * x; x y IP 00 Traces

Of course, tradeoffs between precision and analyzability of programs. Also, modern software systems have new problems where: 1.The axioms of the machine are insufficient to express the property. 2.The property is not easily phrased in terms of execution traces of programs. Why More Than One Abstraction?

Example 1 – Data Center Configuration How can a set of services be feasibly deployed in a data center? (Functional correctness of services doesn’t help) HBI DatabaseWeb serverVoice rec. service Can’t do this; literally illegal in some cases. Can’t do this; may overload CPU. Need some model of conflicts between services, but not necessarily implementation details.

Example 2 – Web-Service Integration When (correct) web-services are mashed-up can new vulnerabilities arise? Genealogy data to make friend recommendations Policy for computing genealogical relationships Policy for computing friend recommendations Full static verification would be very difficult. Abstracting to the data policies focuses the problem. Genealogy site Social networking site Can Evil Eve get recommended as friend to Bob?

A FORMULA for Abstractions Algebraic data types (ADTs) and strongly typed constraint logic programming (CLP) Queries - Yes/no questions about the model The FORMULA language is a general framework for specifying abstractions. My Abstraction A finite set of facts over which the logic program reasons My Model Can Eve trick Bob? Is the data center correctly configured ? The class of CLP means axioms are a subclass of FPL over background theories

A FORMULA for Analysis Assume the logic program does not state all the facts (open world assumption). The FORMULA solver provides general state-of-the-art automated analysis by finite model finding. My Abstraction Require a query to hold My Model Can Eve trick Bob? = Yes My Model Model k Model 2 Model 1 Search for models (worlds) where the query holds Can encode design space exploration, bounded model checking, schedulability analysis etc… as finite model finding over OWA programs.

Typically, CLP semantics state a proposition is false if it is false in the least model of the logic program. This assumption hinders our desire to search over worlds where a query holds. It requires the programmer to define search strategies, thereby losing the declarative nature of CLP. The Closed World Assumption (CWA)

Example: N-Queens with CWA Can we write a set of rules that inductively generates and tests board configurations until it places n queens so they do not attack? ? ? ? ? ? ? ? ? ? ?

Example: N-Queens with CWA

Closed World Query Operation Use the query operation to search for board configurations

Example: N-Queens with OWA Give semantics of “attack”. Is there a world containing N queens where none can attack? ? ? ? ? ? ? ? ? ? ?

Example: N-Queens with OWA

Open World Query Operation Use the query operation to search for board configurations May further constraint the query operation so every W is a subset of regular Herbrand set.

Finding Models model Queens8_1 of NQueens at "../NQueens.4ml" { Size(8) Queen(0,4) Queen(1,0) Queen(2,3) Queen(3,5) Queen(4,7) Queen(5,1) Queen(6,6) Queen(7,2) }

Need semantic types to explain the shape of worlds, otherwise we search many erroneous words: Types in OWA Use a sub-class of regular types admitting canonical forms. Lift interpreted functions into the type system via Galois approximations. Also want to know if the OWA program is meaningful over all well-typed worlds. Must deal with constraints.

Type Language Given the declarations: Then this is a type term: And its canonical form is:

Constraint-Level Type Inference Need to determine if a rule is meaningful over all possible worlds. Over-approximate the satisfying assignments of the body with regular types Check that the head is a sub-type of the declared type.

Model Finding By Symbolic Execution

(= (+ _ !23) (* -1 _ !25))) -2) (= (+ _ !23) (* -1 _ !26))) -3) (= (+ _ !24) (* -1 _ !25))) -1) (= (+ _ !24) (* -1 _ !26))) -2) (= (+ _ !25) (* -1 _ !26))) -1) (= (+ _ !22) (* -1 _ !23))) 1) (= (+ _ !22) (* -1 _ !24))) 2) (= (+ _ !22) (* -1 _ !25))) 3) (= (+ _ !22) (* -1 _ !26))) 4) (= (+ _ !23) (* -1 _ !24))) 1) (= (+ _ !23) (* -1 _ !25))) 2) (= (+ _ !23) (* -1 _ !26))) 3) (= (+ _ !24) (* -1 _ !25))) 1) (= (+ _ !24) (* -1 _ !26))) 2) (= (+ _ !25) (* -1 _ !26))) 1))) (not (or (>= _ !22) 5) (>= _ !23) 5) (>= _ !24) 5) (>= _ !25) 5) (>= _ !26) 5) (= _ !22 _ !23) (= _ !22 _ !24) (= _ !22 _ !25) (= _ !22 _ !26) (= _ !23 _ !24) (= _ !23 _ !25) (= _ !23 _ !26) (= _ !24 _ !25) (= _ !24 _ !26) (= _ !25 _ !26) (= (+ _ !22) (* -1 _ !23))) -1) (= (+ _ !22) (* -1 _ !24))) -2) (= (+ _ !22) (* -1 _ !25))) -3) (= (+ _ !22) (* -1 _ !26))) -4) (= (+ _ !23) (* -1 _ !24))) -1) Boolean connectives Type coercions Symbolic constants Arithmetic functions

Solving and Search FORMULA Specification Symbolic Execution SMT Formula Guess symbolic world Add symmetry breaking Z3 Solver Pick next region Encode solution region Try something new Use state-of-the-art satisfiability modulo theories (SMT) solver Z3 to solve quantifier-free formulas. Get solution, reconstruct model

Solving and Search