CSE507. Course Introduction. Computer-Aided Reasoning for Software. Emina Torlak

Similar documents
CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

Overview, cont. Overview, cont. Logistics. Optional Reference #1. Optional Reference #2. Workload and Grading

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

CSE507. Satisfiability Modulo Theories. Computer-Aided Reasoning for Software. Emina Torlak

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

CS156: The Calculus of Computation

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

CS156: The Calculus of Computation Zohar Manna Autumn 2008

02 Propositional Logic

Comp487/587 - Boolean Formulas

Chapter 4: Classical Propositional Semantics

Propositional Logic: Models and Proofs

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Learning Goals of CS245 Logic and Computation

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

Course Staff. Textbook

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Lecture 2 Propositional Logic & SAT

Warm-Up Problem. Is the following true or false? 1/35

03 Propositional Logic II

Math.3336: Discrete Mathematics. Propositional Equivalences

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

A brief introduction to Logic. (slides from

Language of Propositional Logic

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Formal Logic and Deduction Systems

CSE 311: Foundations of Computing I. Spring 2015 Lecture 1: Propositional Logic

Semantics and Pragmatics of NLP

CSE 311: Foundations of Computing I. Lecture 1: Propositional Logic

Chapter 11: Automated Proof Systems (1)

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

1 Propositional Logic

Classical Propositional Logic

Foundations of Artificial Intelligence

Chapter 11: Automated Proof Systems

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Propositional Resolution Introduction

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Propositional logic. Programming and Modal Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Introduction to Intelligent Systems

Introduction to Intelligent Systems

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

CS Module 1. Ben Harsha Apr 12, 2017

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

Propositional Reasoning

Advanced Topics in LP and FP

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Predicate Logic: Sematics Part 1

Lecture 4: Proposition, Connectives and Truth Tables

Propositional Logic Language

Propositional Logic: Logical Agents (Part I)

Computation and Inference

Adam Blank Spring 2017 CSE 311. Foundations of Computing I

In this chapter, we specify a deductive apparatus for PL.

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

SAT Solvers: Theory and Practice

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

UNIT-I: Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

Propositional logic. First order logic. Alexander Clark. Autumn 2014

Doc112: Hardware. Department of Computing, Imperial College London. Doc112: Hardware Lecture 1 Slide 1

PROBLEM SET 3: PROOF TECHNIQUES

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Part 1: Propositional Logic

Inference in Propositional Logic

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 3: Practical SAT Solving

CSE 20: Discrete Mathematics

ICS141: Discrete Mathematics for Computer Science I

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Propositional Logic: Part II - Syntax & Proofs 0-0

MAT2345 Discrete Math

CSE 240 Logic and Discrete Mathematics

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional logic. Programming and Modal Logic

Logic: Intro & Propositional Definite Clause Logic

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Deductive Systems. Lecture - 3

Logic: Propositional Logic (Part I)

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Lecture Notes on SAT Solvers & DPLL

First-Order Logic (FOL)

Propositional Logic: Logical Agents (Part I)

Propositional Languages

a. ~p : if p is T, then ~p is F, and vice versa

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Transcription:

Computer-Aided Reasoning for Software CSE507 courses.cs.washington.edu/courses/cse507/14au/ Course Introduction Emina Torlak emina@cs.washington.edu

Today What is this course about? Course logistics Review of basic concepts 2

about Tools for building better software, more easily

more reliable, faster, more energy efficient Tools for building better software, more easily

Tools for building better software, more easily automatic verification, debugging & synthesis

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next = far; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } Is this list reversal procedure correct? 4

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next = far; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } verification Is this list reversal procedure correct? 4

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next = far; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } Which lines of code are responsible for the buggy behavior? 5

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next = far; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } debugging Which lines of code are responsible for the buggy behavior? 5

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next =??; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } Is there a way to complete this code so that it is correct? 6

Tools for building better software, more easily class List { Node head;! void reverse() { Node near = head; Node mid = near.next; Node far = mid.next;! near.next = null; while (far!= null) { mid.next = near; near = mid; mid = far; far = far.next; }! mid.next = near; head = mid; } }! class Node { Node next; String data; } synthesis Is there a way to complete this code so that it is correct? 6

goal By the end of this course, you ll be able to build computer-aided tools for any domain!

biology education goal By the end of this course, you ll be able to build computer-aided tools for any domain! hardware systems security networking databases low-power computing high-performance computing

logistics Topics, structure, people

Course overview program question tools logic automated reasoning engine 9

Course overview program question verifier, synthesizer, fault localizer logic SAT, SMT, model finders & checkers Drawing from Decision Procedures by Kroening & Strichman 9

Course overview program question study (part I) verifier, synthesizer, fault localizer logic SAT, SMT, model finders & checkers Drawing from Decision Procedures by Kroening & Strichman 9

Course overview program question study (part I) verifier, synthesizer, fault localizer logic build! (part II) SAT, SMT, model finders & checkers Drawing from Decision Procedures by Kroening & Strichman 9

Grading structure 3 individual homework assignments (50%) conceptual problems & proofs (Tex) study (part I) implementations in various programming languages may discuss problems with others but solutions must be your own Course project (50%) build a computer-aided reasoning tool for a domain of your choice teams of 2-3 people strongly encouraged see the course web page for timeline, deliverables and other details build! (part II) 10

Reading and references Required readings posted on the course web page Complete each reading before the lecture for which it is assigned Recommended text books Bradley & Manna, The Calculus of Computation Kroening & Strichman, Decision Procedures Related courses Isil Dillig: Automated Logical Reasoning (2013) Viktor Kuncak: Synthesis, Analysis, and Verification (2013) Sanjit Seshia: Computer-Aided Verification (2012) 11

Advice for doing well in 507 Come to class (prepared) Lecture notes are enough to teach from, but not enough to learn from Participate Ask and answer questions Meet deadlines Turn homework in on time Start homework and project sooner than you think you need to Follow instructions for submitting code (we have to be able to run it) 12

People instructor TA Emina Torlak PLSE CSE 596 Wednesdays 1-2 Mert Saglam Theory CSE 618 Thursdays 1-2 13

People instructor TA students! Your name Research area Survey Emina Torlak PLSE CSE 596 Wednesdays 1-2 Mert Saglam Theory CSE 618 Thursdays 1-2 14

review Propositional logic: syntax, semantics & proof methods

Syntax of propositional logic Atom truth symbols: ( true ), ( false ) propositional variables: p, q, r, Literal an atom α or its negation α Formula a literal or the application of a logical connective to formulas F not (negation) F1 F2 and (conjunction) F1 F2 or (disjunction) F1 F2 implies (implication) if and only if (iff) F1 F2 ( p ) (q ) 16

Syntax of propositional logic ( p ) (q ) Atom truth symbols: ( true ), ( false ) propositional variables: p, q, r, Literal an atom α or its negation α Formula a literal or the application of a logical connective to formulas F not (negation) F1 F2 and (conjunction) F1 F2 or (disjunction) F1 F2 implies (implication) if and only if (iff) F1 F2 16

Syntax of propositional logic ( p ) (q ) Atom truth symbols: ( true ), ( false ) propositional variables: p, q, r, Literal an atom α or its negation α Formula a literal or the application of a logical connective to formulas F not (negation) F1 F2 and (conjunction) F1 F2 or (disjunction) F1 F2 implies (implication) if and only if (iff) F1 F2 16

Syntax of propositional logic ( p ) (q ) Atom truth symbols: ( true ), ( false ) propositional variables: p, q, r, Literal an atom α or its negation α Formula a literal or the application of a logical connective to formulas F not (negation) F1 F2 and (conjunction) F1 F2 or (disjunction) F1 F2 implies (implication) if and only if (iff) F1 F2 16

Interpretations of propositional formulas An interpretation I for a propositional formula F maps every variable in F to a truth value: I : { p, q, } 17

Interpretations of propositional formulas An interpretation I for a propositional formula F maps every variable in F to a truth value: I : { p, q, } I is a satisfying interpretation of F, written as I F, if F evaluates to under I. I is a falsifying interpretation of F, written as I F, if F evaluates to under I. 17

Semantics of propositional logic Base cases: I I I p iff I[p] = I p iff I[p] = 18

Semantics of propositional logic Base cases: I Inductive cases: I I p iff I[p] = I p iff I[p] = 18

Semantics of propositional logic Base cases: I Inductive cases: I F iff I F I I p iff I[p] = I p iff I[p] = 18

Semantics of propositional logic Base cases: I I Inductive cases: I F iff I F I F1 F2 iff I F1 and I F2 I p iff I[p] = I p iff I[p] = 18

Semantics of propositional logic Base cases: I I I p iff I[p] = I p iff I[p] = Inductive cases: I F iff I F I F1 F2 iff I F1 and I F2 I F1 F2 iff I F1 or I F2 I F1 F2 iff I F1 or I F2 I F1 F2 iff I F1 and I F2, or I F1 and I F2 18

Semantics of propositional logic: example F: (p q) (p q) I: {p, q }? 19

Semantics of propositional logic: example F: (p q) (p q) I: {p, q } I F 19

Satisfiability & validity of propositional formulas F is satisfiable iff I F for some I. F is valid iff I F for all I. 20

Satisfiability & validity of propositional formulas F is satisfiable iff I F for some I. F is valid iff I F for all I. Duality of satisfiability and validity: F is valid iff F is unsatisfiable. 20

Satisfiability & validity of propositional formulas F is satisfiable iff I F for some I. F is valid iff I F for all I. Duality of satisfiability and validity: If we have a procedure for checking satisfiability, then we can also check validity of propositional formulas, and vice versa. F is valid iff F is unsatisfiable. 20

Techniques for deciding satisfiability & validity Search Deduction SAT solver 21

Techniques for deciding satisfiability & validity! Search Enumerate all interpretations (i.e., build a truth table), and check that they satisfy the formula. Deduction SAT solver 21

Techniques for deciding satisfiability & validity! Search! Deduction Enumerate all interpretations (i.e., build a truth table), and check that they satisfy the formula. Assume the formula is invalid, apply proof rules, and check for contradiction in every branch of the proof tree. SAT solver 21

Proof by search (truth tables) F: (p q) (p q) p q p q q p q F 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 1 22

Proof by search (truth tables) F: (p q) (p q) p q p q q p q F 0 0 0 1 1 1 Valid. 0 1 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 1 22

Proof by deduction (semantic arguments) Example proof rules: I F I F I F1 F2 I F1 I F2 I F I F1 F2 I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F1 F2 I F1 I F2 I F I F1 F2 I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F1 F2 I F1 I F2 1. I p q (assumption) I F I F1 F2 I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F1 F2 I F1 I F2 1. I p q (assumption) a. I p (1, ) I F I F1 F2 I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F1 F2 I F1 I F2 1. I p q (assumption) a. I p (1, ) b. I q (1, ) I F I F1 F2 I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F I F1 F2 I F1 I F2 I F1 F2 1. I p q (assumption) a. I p (1, ) b. I q (1, ) i. I q (1b, ) I F I F1 I F2 23

Proof by deduction (semantic arguments) Example proof rules: F: p q I F I F I F I F1 F2 I F1 I F2 I F1 F2 1. I p q (assumption) a. I p (1, ) b. I q (1, ) i. I q (1b, ) I F I F1 I F2 Invalid; I is a falsifying interpretation. 23

Semantic judgements Formulas F1 and F2 are equivalent, written F1 F2, iff F1 F2 is valid. Formula F1 implies F2, written F1 F2, iff F1 F2 is valid. 24

Semantic judgements Formulas F1 and F2 are equivalent, written F1 F2, iff F1 F2 is valid. Formula F1 implies F2, written F1 F2, iff F1 F2 is valid. F1 F2 and F1 F2 are not propositional formulas (not part of syntax). They are properties of formulas, just like validity or satisfiability. 24

Semantic judgements Formulas F1 and F2 are equivalent, written F1 F2, iff F1 F2 is valid. Formula F1 implies F2, written F1 F2, iff F1 F2 is valid. If we have a procedure for checking satisfiability, then we can also check for equivalence and implication of propositional formulas. 24

Summary Today Course overview & logistics Review of propositional logic Next Lecture (by Zach Tatlock) Normal forms A basic SAT solver Take the course survey Read Chapter 1 of Bradley & Manna 25