Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries Richard Uhler (MIT-CSAIL) and Nirav Dave (SRI International) CAV 2013.

Slides:



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

Introduction to Compilation of Functional Languages Wanhe Zhang Computing and Software Department McMaster University 16 th, March, 2004.
50.530: Software Engineering
Finding bugs: Analysis Techniques & Tools Symbolic Execution & Constraint Solving CS161 Computer Security Cho, Chia Yuan.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke September 1976.
Satisfiability Modulo Theories (An introduction)
SCIP Optimization Suite
Software Engineering & Automated Deduction Willem Visser Stellenbosch University With Nikolaj Bjorner (Microsoft Research, Redmond) Natarajan Shankar (SRI.
1 Symbolic Execution for Model Checking and Testing Corina Păsăreanu (Kestrel) Joint work with Sarfraz Khurshid (MIT) and Willem Visser (RIACS)
1/20 Generalized Symbolic Execution for Model Checking and Testing Charngki PSWLAB Generalized Symbolic Execution for Model Checking and Testing.
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
Assurance through Enhanced Design Methodology Orlando, FL 5 December 2012 Nirav Davé SRI International This effort is sponsored by the Defense Advanced.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
0 PROGRAMMING IN HASKELL Chapter 5 - List Comprehensions.
Functional Design and Programming Lecture 1: Functional modeling, design and programming.
Nikolaj Bjørner Microsoft Research Lecture 3. DayTopicsLab 1Overview of SMT and applications. SAT solving, Z3 Encoding combinatorial problems with Z3.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Validating High-Level Synthesis Sudipta Kundu, Sorin Lerner, Rajesh Gupta Department of Computer Science and Engineering, University of California, San.
An Overview of Programming Logic and Design
BİL744 Derleyici Gerçekleştirimi (Compiler Design)1.
End-to-End Design of Embedded Real-Time Systems Kang G. Shin Real-Time Computing Laboratory EECS Department The University of Michigan Ann Arbor, MI
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
Bridging the chasm between MDE and the world of compilation Nondini Das 1.
1 Yolanda Gil Information Sciences InstituteJanuary 10, 2010 Requirements for caBIG Infrastructure to Support Semantic Workflows Yolanda.
Using Mathematica for modeling, simulation and property checking of hardware systems Ghiath AL SAMMANE VDS group : Verification & Modeling of Digital systems.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Chapter 1. Introduction.
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.
Dimensions in Synthesis Part 3: Ambiguity (Synthesis from Examples & Keywords) Sumit Gulwani Microsoft Research, Redmond May 2012.
HAMPI A Solver for String Constraints Vijay Ganesh MIT (With Adam Kiezun, Philip Guo, Pieter Hooimeijer and Mike Ernst)
Lexical Analysis - An Introduction. The Front End The purpose of the front end is to deal with the input language Perform a membership test: code  source.
Regular Expressions and Finite State Automata Themes –Finite State Automata (FSA) Describing patterns with graphs Programs that keep track of state –Regular.
Testing Grammars For Top Down Parsers By Asma M Paracha, Frantisek F. Franek Dept. of Computing & Software McMaster University Hamilton, Ont.
0 REVIEW OF HASKELL A lightening tour in 45 minutes.
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
Advanced Functional Programming 2009 Ulf Norell (lecture by Jean-Philippe Bernardy)
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Page 1 Advanced Technology Center HCSS 03 – April 2003 vFaat: von Neumann Formal Analysis and Annotation Tool David Greve Dr. Matthew Wilding Rockwell.
Lexical Analysis: Finite Automata CS 471 September 5, 2007.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Compiler Design Introduction 1. 2 Course Outline Introduction to Compiling Lexical Analysis Syntax Analysis –Context Free Grammars –Top-Down Parsing –Bottom-Up.
Formal Verification of Synchronization Issues of SpecC Description with Automatic Abstraction Thanyapat Sakunkonchak Masahiro Fujita Department of Electronics.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Compositional Program Synthesis from Natural Language and Examples Mohammad Raza, Sumit Gulwani & Natasa Milic-Frayling Microsoft.
Compiler Construction By: Muhammad Nadeem Edited By: M. Bilal Qureshi.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
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.
CS416 Compiler Design1. 2 Course Information Instructor : Dr. Ilyas Cicekli –Office: EA504, –Phone: , – Course Web.
Decision Procedures for String Constraints Pieter Hooimeijer 2.
Deploying an Intelligent Pairing Assistant for Air Operation Centers Jeremy Ludwig, Ph.D. June 21, Distribution A: Approved for public release.
An Evaluation of Automata Algorithms for String Analysis Pieter Hooimeijer University of Virginia Margus Veanes Microsoft Research VMCAI 2011.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Functional Programming
Hardware Acceleration of A Boolean Satisfiability Solver
A lightening tour in 45 minutes
课程名 编译原理 Compiling Techniques
CS416 Compiler Design lec00-outline September 19, 2018
Introduction CI612 Compiler Design CI612 Compiler Design.
A Design Structure for Higher Order Quotients
Lecture 4: Lexical Analysis & Chomsky Hierarchy
CS416 Compiler Design lec00-outline February 23, 2019
Sub-system interfaces
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Rich Model Toolkit – An Infrastructure for Reliable Computer Systems
Presentation transcript:

Smten: Automatic Translation of High-level Symbolic Computations into SMT Queries Richard Uhler (MIT-CSAIL) and Nirav Dave (SRI International) CAV 2013 Saint Petersburg, Russia This work was sponsored by the Defense Advanced Research Projects Agency (DARPA) and the Air Force Research Laboratory (AFRL), under contract FA C-0237 and supported by National Science Foundation under Grant No. CCF The views, opinions, and/or findings contained in this report are those of the authors and should not be interpreted as representing the official views of policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense.

Verification Tool – With SMT input output orchestration SMT Translate problem domain SMT domain input output orchestrationcustom solver Verification Tool – Before SMT Motivation: SMT-Based Tools Satisfiability Modulo Theories (SMT) solvers are well suited for computer aided verification tasks Uses include: model checking program synthesis automated theorem proving automatic test generation software verification shared computational core

input output orchestration SMT Translate problem domain SMT domain Verification Tool – With SMT Translate input output orchestration Smten problem domain Verification Tool – With Smten Efficient Translation with Smten Implementing efficient translation is tedious and time consuming Smten automates the task of translation 3 Tool developer works entirely in the problem domain SMT domain

Case Study: Hampi String Solver var v : ; cfg SqlSmall := “SELECT “ (Letter)+ “ FROM “ (Letter)+ “ WHERE “ Cond; cfg Cond := Val “=“ Val | Cond “ OR “ Cond; cfg Val := (Letter)+ | “’” (Ascii)* “’” | (Digit)+; cfg Digit := [‘0’-’9’]; cfg Letter := [‘a’-’z’] | [‘A’-’Z’]; cfg Ascii := Letter | Digit | “ “ | “’”; val q := concat(“SELECT msg FROM messages WHERE topicid=‘”, v, “’”); assert v contains “OR ‘1’=‘1’”; assert q in SqlSmall; Solve for a bounded length variable string which satisfies constraints: string contains the given substring string belongs to a given regular language bounded length variable string regular language specification “contains” constraint “membership” constraint Hampi output: {VAR(v)=80’ OR ‘1’=‘1’} Hampi input: 4 [Kiezun, et. all ISSTA ‘09]

Challenges in Translation 5 Application-level design decisions effect the translation: Choice of SMT solver and background theories – Determines the target API of translation Representation of application-level data structures in SMT domain – Represent Hampi symbolic characters using Integers? Bit-vectors? Booleans? Decomposition of problem into SMT queries – Use single SMT query for an entire Hampi problem? – Use a different query for each possible string length? Making these decisions empirically is tedious and time consuming: Translation must be re-implemented for each choice  Implementing efficient translation is a non-trivial amount of work

Optimization in Translation Even if you know the right design decisions to make, the translation must be optimized Hampi example: assert “zb?????d” in /a(b*cd)*/ – This assertion obviously doesn’t hold – Direct translation to SMT would construct a full-sized SMT query for the assertion – Even if the solver can solve this quickly, there is still a non-trivial translation cost Another example: preservation of sharing 6 => Implementing efficient translation is hard Smten will do these low-level optimizations for you

The Smten Language High-level, purely functional language, with syntax and features borrowed heavily from Haskell: User defined algebraic data types, pattern matching User defined functions: higher-order and recursive Polymorphism: parametric and ad-hoc (type classes) General purpose input/output Provides an API (based on monads) for orchestrating symbolic computations No distinction between concrete and symbolic functions 7

The Hampi Membership Constraint in Smten data RegEx = Epsilon | Empty | Atom Char | Range Char Char | Star RegEx | Concat RegEx RegEx | Or RegEx RegEx match :: RegEx -> [SChar] -> Bool match Epsilon s = null s match Empty _ = False match (Atom x) [c] = toSChar x == c match (Range l h) [c] = toSChar l <= c && c <= toSChar h match x) [] = True match x) s = any (match2 x r) (splits [1..length s] s) match (Concat a b) s = any (match2 a b) (splits [0..length s] s) match (Or a b) s = match a s || match b s match _ s = False match2 a b (sa, sb) = match a sa && match b sb splits ns x = map (\n -> splitAt n x) ns 8 No knowledge of SChar implementation needed No mention of SMT solver or theories No mention of what is concrete and what symbolic Can memoize using memo library

SHampi: Hampi Implemented with Smten 9 SHampi’s automatic translation performs just as well as Hampi’s manually implemented translation Smten allowed to easily explore different SMT solvers and character representations in SHampi

SHampi Development Effort 10 Implemented in just 3 weeks Including time to understand Hampi problem Including time spent in maturing Smten tool ComponentLines of Source SHampi Parser325 CFG Fix Sizing100 RegEx Match56 Query89 SChar54

Conclusion: The Promise of Smten Smten enables SMT-based tools to share efficient translation lowers the barrier to entry in the development of SMT-based tools Future work: Many more optimizations in translation possible: – exploit theory of functions – implied value concretization Supporting infinite symbolic computations Libraries of techniques for SMT-based tools Generalize portfolio approach of SMT solvers to include background theories 11

Come see us at the poster session Richard Uhler Nirav Dave 12