ece750t-28: computer-aided reasoning for software engineering lecture 1: introduction...

170
ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE Vijay Ganesh (Original notes from Isil Dillig) Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 1/40

Upload: others

Post on 06-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

ECE750T-28:Computer-aided Reasoning for Software Engineering

Lecture 1:Introduction to Logic in SE

Vijay Ganesh(Original notes from Isil Dillig)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 1/40

Page 2: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What is this Course About?

I This course is about computational logic and its application to softwareengineering.

I Explore various logical theories widely used in computer science.

I Learn about decision procedures, provers, solvers.

I Learn about applications such as concolic testing, model checking,analysis, fault localization, synthesis and programming languages.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 2/40

Page 3: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What is this Course About?

I This course is about computational logic and its application to softwareengineering.

I Explore various logical theories widely used in computer science.

I Learn about decision procedures, provers, solvers.

I Learn about applications such as concolic testing, model checking,analysis, fault localization, synthesis and programming languages.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 2/40

Page 4: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What is this Course About?

I This course is about computational logic and its application to softwareengineering.

I Explore various logical theories widely used in computer science.

I Learn about decision procedures, provers, solvers.

I Learn about applications such as concolic testing, model checking,analysis, fault localization, synthesis and programming languages.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 2/40

Page 5: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What is this Course About?

I This course is about computational logic and its application to softwareengineering.

I Explore various logical theories widely used in computer science.

I Learn about decision procedures, provers, solvers.

I Learn about applications such as concolic testing, model checking,analysis, fault localization, synthesis and programming languages.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 2/40

Page 6: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Computation, irrespective of representation, can be very complex tounderstand/process in all its gory detail.

I Hence, we need abstractions.

I Logics are precise languages that allow us torepresent/manipulate/process/morph abstractions of computations.

I Examples include Boolean logic (aka propostional or sentential calculus),predicate logic, first-order theories,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 3/40

Page 7: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Computation, irrespective of representation, can be very complex tounderstand/process in all its gory detail.

I Hence, we need abstractions.

I Logics are precise languages that allow us torepresent/manipulate/process/morph abstractions of computations.

I Examples include Boolean logic (aka propostional or sentential calculus),predicate logic, first-order theories,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 3/40

Page 8: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Computation, irrespective of representation, can be very complex tounderstand/process in all its gory detail.

I Hence, we need abstractions.

I Logics are precise languages that allow us torepresent/manipulate/process/morph abstractions of computations.

I Examples include Boolean logic (aka propostional or sentential calculus),predicate logic, first-order theories,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 3/40

Page 9: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Computation, irrespective of representation, can be very complex tounderstand/process in all its gory detail.

I Hence, we need abstractions.

I Logics are precise languages that allow us torepresent/manipulate/process/morph abstractions of computations.

I Examples include Boolean logic (aka propostional or sentential calculus),predicate logic, first-order theories,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 3/40

Page 10: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Computation, irrespective of representation, can be very complex tounderstand/process in all its gory detail.

I Hence, we need abstractions.

I Logics are precise languages that allow us torepresent/manipulate/process/morph abstractions of computations.

I Examples include Boolean logic (aka propostional or sentential calculus),predicate logic, first-order theories,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 3/40

Page 11: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Artificial intelligence: constraint satisfaction, automated game playing,planning, . . .

I Programming Languages: logic programming, type systems, programminglanguage theory . . .

I Hardware verification and synthesis: correctness of circuits, ATPG, . . .

I Program analysis, verification and synthesis: Static analysis, softwareverification, test case generation, program understanding, . . .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 4/40

Page 12: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Artificial intelligence: constraint satisfaction, automated game playing,planning, . . .

I Programming Languages: logic programming, type systems, programminglanguage theory . . .

I Hardware verification and synthesis: correctness of circuits, ATPG, . . .

I Program analysis, verification and synthesis: Static analysis, softwareverification, test case generation, program understanding, . . .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 4/40

Page 13: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Artificial intelligence: constraint satisfaction, automated game playing,planning, . . .

I Programming Languages: logic programming, type systems, programminglanguage theory . . .

I Hardware verification and synthesis: correctness of circuits, ATPG, . . .

I Program analysis, verification and synthesis: Static analysis, softwareverification, test case generation, program understanding, . . .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 4/40

Page 14: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Artificial intelligence: constraint satisfaction, automated game playing,planning, . . .

I Programming Languages: logic programming, type systems, programminglanguage theory . . .

I Hardware verification and synthesis: correctness of circuits, ATPG, . . .

I Program analysis, verification and synthesis: Static analysis, softwareverification, test case generation, program understanding, . . .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 4/40

Page 15: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

Logic is a fundamental part of computer science:

I Artificial intelligence: constraint satisfaction, automated game playing,planning, . . .

I Programming Languages: logic programming, type systems, programminglanguage theory . . .

I Hardware verification and synthesis: correctness of circuits, ATPG, . . .

I Program analysis, verification and synthesis: Static analysis, softwareverification, test case generation, program understanding, . . .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 4/40

Page 16: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

I No matter what your research area or interest is, the techniques we coverin this course are likely to be relevant.

I Very good tool kit because many difficult problems can be reduceddeciding satisfiabilty of formulas in logic.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 5/40

Page 17: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Why Should You Care?

I No matter what your research area or interest is, the techniques we coverin this course are likely to be relevant.

I Very good tool kit because many difficult problems can be reduceddeciding satisfiabilty of formulas in logic.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 5/40

Page 18: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 19: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 20: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 21: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 22: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 23: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 24: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Review of propositional logic

I Modern SAT solvers

I Complexity theory basics, reductions, classes,...

I First-order theorem provers

I Theory of uninterpreted functions

I Linear inequalities over reals (Simplex) and integers

I Theories of bit-vectors, arrays and strings

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 6/40

Page 25: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Combining decision procedures (Nelson-Oppen)

I SMT Solvers and the DPLL(T) framwork

I Constraint Simplification

I Quantifier elimination

I Applications: concolic testing, analysis, formal methods

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 7/40

Page 26: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Combining decision procedures (Nelson-Oppen)

I SMT Solvers and the DPLL(T) framwork

I Constraint Simplification

I Quantifier elimination

I Applications: concolic testing, analysis, formal methods

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 7/40

Page 27: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Combining decision procedures (Nelson-Oppen)

I SMT Solvers and the DPLL(T) framwork

I Constraint Simplification

I Quantifier elimination

I Applications: concolic testing, analysis, formal methods

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 7/40

Page 28: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Combining decision procedures (Nelson-Oppen)

I SMT Solvers and the DPLL(T) framwork

I Constraint Simplification

I Quantifier elimination

I Applications: concolic testing, analysis, formal methods

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 7/40

Page 29: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Topics Covered in the Course

I Combining decision procedures (Nelson-Oppen)

I SMT Solvers and the DPLL(T) framwork

I Constraint Simplification

I Quantifier elimination

I Applications: concolic testing, analysis, formal methods

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 7/40

Page 30: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Logistics

I Class meets every Friday from 11:30 AM to 2:20 PM

I All lectures will be held in EIT 3141

I All the material for the class (lecture slides, homework, reading,announcements) will be posted on the course website:

https://ece.uwaterloo.ca/~vganesh/teaching.html

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 8/40

Page 31: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Logistics

I Class meets every Friday from 11:30 AM to 2:20 PM

I All lectures will be held in EIT 3141

I All the material for the class (lecture slides, homework, reading,announcements) will be posted on the course website:

https://ece.uwaterloo.ca/~vganesh/teaching.html

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 8/40

Page 32: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Logistics

I Class meets every Friday from 11:30 AM to 2:20 PM

I All lectures will be held in EIT 3141

I All the material for the class (lecture slides, homework, reading,announcements) will be posted on the course website:

https://ece.uwaterloo.ca/~vganesh/teaching.html

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 8/40

Page 33: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Recommended Books

I The Calculus of Computation by Aaron Bradley and Zohar Manna

I Warning: Will cover many topics not in the Bradley & Manna textbookand will skip some chapters of this textbook

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 9/40

Page 34: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Recommended Books

I The Calculus of Computation by Aaron Bradley and Zohar Manna

I Warning: Will cover many topics not in the Bradley & Manna textbookand will skip some chapters of this textbook

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 9/40

Page 35: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Recommended Book

I Decision Procedures: An Algorithmic Point of View by Daniel Kroeningand Ofer Strichman

I Mostly I will follow papers, and these papers will be cited on the website.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 10/40

Page 36: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Recommended Book

I Decision Procedures: An Algorithmic Point of View by Daniel Kroeningand Ofer Strichman

I Mostly I will follow papers, and these papers will be cited on the website.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 10/40

Page 37: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Requirements

I Two homework assignments (15% of the final grade)

I You get 1-2 weeks to complete the assignment from the day it is handedout

I No late submissions

I All assignments should be done individually

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 11/40

Page 38: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Requirements

I Two homework assignments (15% of the final grade)

I You get 1-2 weeks to complete the assignment from the day it is handedout

I No late submissions

I All assignments should be done individually

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 11/40

Page 39: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Requirements

I Two homework assignments (15% of the final grade)

I You get 1-2 weeks to complete the assignment from the day it is handedout

I No late submissions

I All assignments should be done individually

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 11/40

Page 40: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Requirements

I Two homework assignments (15% of the final grade)

I You get 1-2 weeks to complete the assignment from the day it is handedout

I No late submissions

I All assignments should be done individually

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 11/40

Page 41: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Final Exam

I One final exam (50% of the final grade)

I No mid-term exam

I All exams closed-book, closed-notes, closed-laptop, closed-phone etc.

I Date fixed by registrar. Non-negotiable.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 12/40

Page 42: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Final Exam

I One final exam (50% of the final grade)

I No mid-term exam

I All exams closed-book, closed-notes, closed-laptop, closed-phone etc.

I Date fixed by registrar. Non-negotiable.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 12/40

Page 43: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Final Exam

I One final exam (50% of the final grade)

I No mid-term exam

I All exams closed-book, closed-notes, closed-laptop, closed-phone etc.

I Date fixed by registrar. Non-negotiable.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 12/40

Page 44: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Final Exam

I One final exam (50% of the final grade)

I No mid-term exam

I All exams closed-book, closed-notes, closed-laptop, closed-phone etc.

I Date fixed by registrar. Non-negotiable.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 12/40

Page 45: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 46: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 47: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 48: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 49: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 50: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Research Projects

I Research Project (35% of the final grade)

I Maximum 2 people per research project group

I Ideally, new research that is publishable. Both theoretical or practicalprojects are acceptable

I Examples include: Novel solving technique, decidability/complexity result,feature in solver/prover, application of logics

I Must get approval of the project idea from instructor by October 4th, 2013

I Must submit 2-page project proposal with title, names, abstract, problemstatement, solution description, impact

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 13/40

Page 51: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 52: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 53: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 54: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 55: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 56: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Grading

I Final exam: 50%

I Homeworks and class participation: 15%

I Respect honor code on exams and homework

I You can consult other students on the homework, but write-up must beyour own

I Also, write-up must mention names of consultants/collaborators

I Research project: 35%

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 14/40

Page 57: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Let’s get started!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 15/40

Page 58: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 59: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 60: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 61: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 62: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 63: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 64: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 65: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

What are Logics?

I Precise mathematical languages with well-defined syntax and semantics

I Syntax: Meta-rules for defining well-formed formulas

I Semantics: Interpretation/models

I Forms of valid reasoning: Deductive, inductive, abductive,...

I Proof systems: Intuinistic vs. classical

I Fields of study: proof, model, set, recursion, and type theory

I Questions studied: Proof and truth, Provability, Decidability, Complexity,Foundations,...

I Properties of logics: Soundness, completeness, compactness, expressivepower, decidability,...

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 16/40

Page 66: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 67: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 68: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 69: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)

F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 70: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)

F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 71: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)

F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 72: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)

F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 73: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Review of Propositional Logic: Syntax

Atom truth symbols > (“true”) and ⊥ (“false”)propositional variables p, q , r , p1, q1, r1, · · ·

Literal atom α or its negation ¬α

Formula literal or application of alogical connective to formulae F ,F1,F2

¬F “not” (negation)F1 ∧ F2 “and” (conjunction)F1 ∨ F2 “or” (disjunction)F1 → F2 “implies” (implication)F1 ↔ F2 “if and only if” (iff)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 17/40

Page 74: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Interpretations in Propositional Logic

I An interpretation I for a formula F in propositional logic is a mappingfrom each propositional variables in F to exactly one truth value

I : {p 7→ >, q 7→ ⊥, · · · }

I For a formula F with 2 propositional variables, how many interpretationsare there?

I In general, for formula with n propositional variables, how manyinterpretations?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 18/40

Page 75: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Interpretations in Propositional Logic

I An interpretation I for a formula F in propositional logic is a mappingfrom each propositional variables in F to exactly one truth value

I : {p 7→ >, q 7→ ⊥, · · · }

I For a formula F with 2 propositional variables, how many interpretationsare there?

I In general, for formula with n propositional variables, how manyinterpretations?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 18/40

Page 76: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Interpretations in Propositional Logic

I An interpretation I for a formula F in propositional logic is a mappingfrom each propositional variables in F to exactly one truth value

I : {p 7→ >, q 7→ ⊥, · · · }

I For a formula F with 2 propositional variables, how many interpretationsare there?

I In general, for formula with n propositional variables, how manyinterpretations?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 18/40

Page 77: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Entailment

I Under an interpretation, every propositional formula evaluates to T or F

Formula F + Interpretation I = Truth value

I We write I |= F if F evaluates to > under I (satisfying interpretation)

I Similarly, I 6|= F if F evaluates to ⊥ under I (falsifying interpretation).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 19/40

Page 78: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Entailment

I Under an interpretation, every propositional formula evaluates to T or F

Formula F + Interpretation I = Truth value

I We write I |= F if F evaluates to > under I (satisfying interpretation)

I Similarly, I 6|= F if F evaluates to ⊥ under I (falsifying interpretation).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 19/40

Page 79: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Entailment

I Under an interpretation, every propositional formula evaluates to T or F

Formula F + Interpretation I = Truth value

I We write I |= F if F evaluates to > under I (satisfying interpretation)

I Similarly, I 6|= F if F evaluates to ⊥ under I (falsifying interpretation).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 19/40

Page 80: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= >

I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 81: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥

I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 82: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >

I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 83: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 84: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:

I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 85: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= F

I |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 86: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 87: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 88: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2

iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 89: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 90: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2

iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 91: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2 iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 92: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Inductive Definition of Propositional Semantics

Base Cases:I |= > I 6|= ⊥I |= p iff I [p] = >I 6|= p iff I [p] = ⊥

Inductive Cases:I |= ¬F iff I 6|= FI |= F1 ∧ F2 iff I |= F1 and I |= F2

I |= F1 ∨ F2 iff I |= F1 or I |= F2

I |= F1 → F2 iff, I 6|= F1 or I |= F2

I |= F1 ↔ F2 iff, I |= F1 and I |= F2

or I 6|= F1 and I 6|= F2

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 20/40

Page 93: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I p

since I [p] = >

2. I q

since I [q ] = ⊥

3. I ¬q

by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 94: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |=? p

since I [p] = >2. I q

since I [q ] = ⊥

3. I ¬q

by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 95: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >

2. I q

since I [q ] = ⊥

3. I ¬q

by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 96: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I |=? q

since I [q ] = ⊥3. I ¬q

by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 97: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥

3. I ¬q

by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 98: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |=? ¬q

by 2 and ¬4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 99: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬

4. I p ∧ q

by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 100: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I |=? p ∧ q

by 2 and ∧5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 101: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧

5. I p ∨ ¬q

by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 102: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧5. I |=? p ∨ ¬q

by 1 and ∨6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 103: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧5. I |= p ∨ ¬q by 1 and ∨

6. I F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 104: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧5. I |= p ∨ ¬q by 1 and ∨6. I |=? F

by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 105: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧5. I |= p ∨ ¬q by 1 and ∨6. I |= F by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 106: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Simple Example

F : (p ∧ q)→ (p ∨ ¬q)

I : {p 7→ >, q 7→ ⊥}

1. I |= p since I [p] = >2. I 6|= q since I [q ] = ⊥3. I |= ¬q by 2 and ¬4. I 6|= p ∧ q by 2 and ∧5. I |= p ∨ ¬q by 1 and ∨6. I |= F by 4 and →

Thus, F is true under I .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 21/40

Page 107: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Example

I What does the formula

F : (p ↔ ¬q)→ (q → ¬r)

evaluate to under this interpretation?

I = {p 7→ ⊥, q 7→ >, r 7→ >}

I I 6|= F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 22/40

Page 108: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Example

I What does the formula

F : (p ↔ ¬q)→ (q → ¬r)

evaluate to under this interpretation?

I = {p 7→ ⊥, q 7→ >, r 7→ >}

I I 6|= F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 22/40

Page 109: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Satisfiability and Validity

I F is satisfiable iff there exists an interpretation I such that I |= F .

I F valid iff for all interpretations I , I |= F .

I F is contingent if it is satisfiable but not valid.

I Duality between satisfiability and validity:

F is valid iff ¬F is unsatisfiable

I Thus, if we have a procedure for checking satisfiability, this also allows usto decide validity

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 23/40

Page 110: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Satisfiability and Validity

I F is satisfiable iff there exists an interpretation I such that I |= F .

I F valid iff for all interpretations I , I |= F .

I F is contingent if it is satisfiable but not valid.

I Duality between satisfiability and validity:

F is valid iff ¬F is unsatisfiable

I Thus, if we have a procedure for checking satisfiability, this also allows usto decide validity

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 23/40

Page 111: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Satisfiability and Validity

I F is satisfiable iff there exists an interpretation I such that I |= F .

I F valid iff for all interpretations I , I |= F .

I F is contingent if it is satisfiable but not valid.

I Duality between satisfiability and validity:

F is valid iff ¬F is unsatisfiable

I Thus, if we have a procedure for checking satisfiability, this also allows usto decide validity

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 23/40

Page 112: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Satisfiability and Validity

I F is satisfiable iff there exists an interpretation I such that I |= F .

I F valid iff for all interpretations I , I |= F .

I F is contingent if it is satisfiable but not valid.

I Duality between satisfiability and validity:

F is valid iff ¬F is unsatisfiable

I Thus, if we have a procedure for checking satisfiability, this also allows usto decide validity

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 23/40

Page 113: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Satisfiability and Validity

I F is satisfiable iff there exists an interpretation I such that I |= F .

I F valid iff for all interpretations I , I |= F .

I F is contingent if it is satisfiable but not valid.

I Duality between satisfiability and validity:

F is valid iff ¬F is unsatisfiable

I Thus, if we have a procedure for checking satisfiability, this also allows usto decide validity

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 23/40

Page 114: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 115: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 116: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 117: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 118: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 119: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Deciding Satisfiability and Validity

I Before we talk about practical algorithms for deciding satisfiability, let’sreview some simple techniques

I Two very simple techniques:

I Truth table method: essentially a search-based technique

I Semantic argument method: deductive way of deciding satisfiability

I Completely different, but complementary techniques

I In fact, as we’ll see later, modern SAT solvers combine both search-basedand deductive techniques!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 24/40

Page 120: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 1: Truth Tables

Example F : (p ∧ q) → (p ∨ ¬q)

p q p ∧ q ¬q p ∨ ¬q F

0 0 0 1 1 10 1 0 0 0 11 0 0 1 1 11 1 1 0 1 1

Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 25/40

Page 121: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 1: Truth Tables

Example F : (p ∧ q) → (p ∨ ¬q)

p q p ∧ q ¬q p ∨ ¬q F

0 0 0 1 1 10 1 0 0 0 11 0 0 1 1 11 1 1 0 1 1

Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 25/40

Page 122: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 1: Truth Tables

Example F : (p ∧ q) → (p ∨ ¬q)

p q p ∧ q ¬q p ∨ ¬q F

0 0 0 1 1 10 1 0 0 0 11 0 0 1 1 11 1 1 0 1 1

Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 25/40

Page 123: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Example

F : (p ∨ q) → (p ∧ q)

p q p ∨ q p ∧ q F0 0 0 0 1 ← satisfying I0 1 1 0 0 ← falsifying I1 0 1 0 01 1 1 1 1

Thus F is satisfiable, but invalid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 26/40

Page 124: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Example

F : (p ∨ q) → (p ∧ q)

p q p ∨ q p ∧ q F0 0 0 0 1 ← satisfying I0 1 1 0 0 ← falsifying I1 0 1 0 01 1 1 1 1

Thus F is satisfiable, but invalid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 26/40

Page 125: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary: Truth Tables

I List all interpretations ⇒ If all interpretations satisfy formula, then valid.If no interpretation satisfies it, unsatisfiable.

I Completely brute-force, impractical: requires explicitly listing all 2n

interpretations in the worst-case!

I Method does not work for any logic where domain is not finite (e.g.,first-order logic)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 27/40

Page 126: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary: Truth Tables

I List all interpretations ⇒ If all interpretations satisfy formula, then valid.If no interpretation satisfies it, unsatisfiable.

I Completely brute-force, impractical: requires explicitly listing all 2n

interpretations in the worst-case!

I Method does not work for any logic where domain is not finite (e.g.,first-order logic)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 27/40

Page 127: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary: Truth Tables

I List all interpretations ⇒ If all interpretations satisfy formula, then valid.If no interpretation satisfies it, unsatisfiable.

I Completely brute-force, impractical: requires explicitly listing all 2n

interpretations in the worst-case!

I Method does not work for any logic where domain is not finite (e.g.,first-order logic)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 27/40

Page 128: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 2: Semantic Argument

I Semantic argument method is essentially a proof by contradiction, and isalso applicable for theories with non-finite domain.

I Main idea: Assume F is not valid ⇒ there exists some falsifyinginterpretation I such that I 6|= F

I Apply proof rules.

I If we derive a contradiction in every branch of the proof, then F is valid.

I If there exists some branch where we cannot derive a contradiction (afterexhaustively applying all proof rules), then F is not valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 28/40

Page 129: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 2: Semantic Argument

I Semantic argument method is essentially a proof by contradiction, and isalso applicable for theories with non-finite domain.

I Main idea: Assume F is not valid ⇒ there exists some falsifyinginterpretation I such that I 6|= F

I Apply proof rules.

I If we derive a contradiction in every branch of the proof, then F is valid.

I If there exists some branch where we cannot derive a contradiction (afterexhaustively applying all proof rules), then F is not valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 28/40

Page 130: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 2: Semantic Argument

I Semantic argument method is essentially a proof by contradiction, and isalso applicable for theories with non-finite domain.

I Main idea: Assume F is not valid ⇒ there exists some falsifyinginterpretation I such that I 6|= F

I Apply proof rules.

I If we derive a contradiction in every branch of the proof, then F is valid.

I If there exists some branch where we cannot derive a contradiction (afterexhaustively applying all proof rules), then F is not valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 28/40

Page 131: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 2: Semantic Argument

I Semantic argument method is essentially a proof by contradiction, and isalso applicable for theories with non-finite domain.

I Main idea: Assume F is not valid ⇒ there exists some falsifyinginterpretation I such that I 6|= F

I Apply proof rules.

I If we derive a contradiction in every branch of the proof, then F is valid.

I If there exists some branch where we cannot derive a contradiction (afterexhaustively applying all proof rules), then F is not valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 28/40

Page 132: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Method 2: Semantic Argument

I Semantic argument method is essentially a proof by contradiction, and isalso applicable for theories with non-finite domain.

I Main idea: Assume F is not valid ⇒ there exists some falsifyinginterpretation I such that I 6|= F

I Apply proof rules.

I If we derive a contradiction in every branch of the proof, then F is valid.

I If there exists some branch where we cannot derive a contradiction (afterexhaustively applying all proof rules), then F is not valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 28/40

Page 133: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (I)

I According to semantics of negation, from I |= ¬F , we can deduceI 6|= F :

I |= ¬FI 6|= F

I Similarly, from I 6|= ¬F , we can deduce:

I 6|= ¬FI |= F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 29/40

Page 134: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (I)

I According to semantics of negation, from I |= ¬F , we can deduceI 6|= F :

I |= ¬FI 6|= F

I Similarly, from I 6|= ¬F , we can deduce:

I 6|= ¬FI |= F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 29/40

Page 135: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (I)

I According to semantics of negation, from I |= ¬F , we can deduceI 6|= F :

I |= ¬FI 6|= F

I Similarly, from I 6|= ¬F , we can deduce:

I 6|= ¬FI |= F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 29/40

Page 136: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (II)

I According to semantics of conjunction, from I |= F ∧G, we can deduce:

I |= F ∧GI |= FI |= G

←and

I Similarly, from I 6|= F ∧G, we can deduce:

I 6|= F ∧GI 6|= F | I 6|= G

I The second deduction results in a branch in the proof, so each case has tobe examined separately!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 30/40

Page 137: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (II)

I According to semantics of conjunction, from I |= F ∧G, we can deduce:

I |= F ∧GI |= FI |= G

←and

I Similarly, from I 6|= F ∧G, we can deduce:

I 6|= F ∧GI 6|= F | I 6|= G

I The second deduction results in a branch in the proof, so each case has tobe examined separately!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 30/40

Page 138: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (II)

I According to semantics of conjunction, from I |= F ∧G, we can deduce:

I |= F ∧GI |= FI |= G

←and

I Similarly, from I 6|= F ∧G, we can deduce:

I 6|= F ∧GI 6|= F | I 6|= G

I The second deduction results in a branch in the proof, so each case has tobe examined separately!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 30/40

Page 139: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (II)

I According to semantics of conjunction, from I |= F ∧G, we can deduce:

I |= F ∧GI |= FI |= G

←and

I Similarly, from I 6|= F ∧G, we can deduce:

I 6|= F ∧GI 6|= F | I 6|= G

I The second deduction results in a branch in the proof, so each case has tobe examined separately!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 30/40

Page 140: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (III)

I According to semantics of disjunction, from I |= F ∨G, we can deduce:

I |= F ∨GI |= F | I |= G

I Similarly, from I 6|= F ∨G, we can deduce:

I 6|= F ∨GI 6|= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 31/40

Page 141: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (III)

I According to semantics of disjunction, from I |= F ∨G, we can deduce:

I |= F ∨GI |= F | I |= G

I Similarly, from I 6|= F ∨G, we can deduce:

I 6|= F ∨GI 6|= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 31/40

Page 142: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (III)

I According to semantics of disjunction, from I |= F ∨G, we can deduce:

I |= F ∨GI |= F | I |= G

I Similarly, from I 6|= F ∨G, we can deduce:

I 6|= F ∨GI 6|= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 31/40

Page 143: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (IV)

I According to semantics of implication:

I |= F → G

I 6|= F | I |= G

I And:I 6|= F → G

I |= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 32/40

Page 144: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (IV)

I According to semantics of implication:

I |= F → GI 6|= F | I |= G

I And:I 6|= F → G

I |= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 32/40

Page 145: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (IV)

I According to semantics of implication:

I |= F → GI 6|= F | I |= G

I And:I 6|= F → G

I |= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 32/40

Page 146: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (IV)

I According to semantics of implication:

I |= F → GI 6|= F | I |= G

I And:I 6|= F → GI |= FI 6|= G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 32/40

Page 147: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (V)

I According to semantics of iff:

I |= F ↔ G

I |= F ∧G | I |= ¬F ∧ ¬G

I And:I 6|= F ↔ G

I |= F ∧ ¬G | I |= ¬F ∧G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 33/40

Page 148: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (V)

I According to semantics of iff:

I |= F ↔ GI |= F ∧G

| I |= ¬F ∧ ¬G

I And:I 6|= F ↔ G

I |= F ∧ ¬G | I |= ¬F ∧G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 33/40

Page 149: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (V)

I According to semantics of iff:

I |= F ↔ GI |= F ∧G | I |= ¬F ∧ ¬G

I And:I 6|= F ↔ G

I |= F ∧ ¬G | I |= ¬F ∧G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 33/40

Page 150: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (V)

I According to semantics of iff:

I |= F ↔ GI |= F ∧G | I |= ¬F ∧ ¬G

I And:I 6|= F ↔ G

I |= F ∧ ¬G | I |= ¬F ∧G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 33/40

Page 151: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (V)

I According to semantics of iff:

I |= F ↔ GI |= F ∧G | I |= ¬F ∧ ¬G

I And:I 6|= F ↔ G

I |= F ∧ ¬G | I |= ¬F ∧G

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 33/40

Page 152: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

The Proof Rules (Contradiction)

I Finally, we derive a contradiction, when I both entails F and does notentail F :

I |= FI 6|= FI |= ⊥

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 34/40

Page 153: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 154: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 155: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption

2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 156: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →

4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 157: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧

6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 158: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨

8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 159: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 160: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

An Example

Prove F : (p ∧ q) → (p ∨ ¬q) is valid.

Let’s assume that F is not valid and that I is a falsifying interpretation.

1. I 6|= (p ∧ q) → (p ∨ ¬q) assumption2. I |= p ∧ q 1 and →3. I 6|= p ∨ ¬q 1 and →4. I |= p 2 and ∧5. I |= q 2 and ∧6. I 6|= p 3 and ∨7. I 6|= ¬q 3 and ∨8. I |= ⊥ 4 and 6 are contradictory

⇒ Thus F is valid.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 35/40

Page 161: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Another Example

I Prove that the following formula is valid using semantic argument method:

F : ((p → q) ∧ (q → r))→ (p → r)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 36/40

Page 162: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Equivalence

I Formulas F1 and F2 are equivalent (written F1 ⇔ F2) iff for allinterpretations I , I |= F1 ↔ F2

F1 ⇔ F2 iff F1 ↔ F2 is valid

I Thus, if we have a procedure for checking satisfiability, we can also checkequivalence.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 37/40

Page 163: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Equivalence

I Formulas F1 and F2 are equivalent (written F1 ⇔ F2) iff for allinterpretations I , I |= F1 ↔ F2

F1 ⇔ F2 iff F1 ↔ F2 is valid

I Thus, if we have a procedure for checking satisfiability, we can also checkequivalence.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 37/40

Page 164: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Implication

I Formula F1 implies F2 (written F1 ⇒ F2) iff for all interpretations I ,I |= F1 → F2

F1 ⇒ F2 iff F1 → F2 is valid

I Thus, if we have a procedure for checking satisfiability, we can also checkimplication

I Caveat: F1 ⇔ F2 and F1 ⇒ F2 are not formulas (they are not part of PLsyntax); they are semantic judgments!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 38/40

Page 165: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Implication

I Formula F1 implies F2 (written F1 ⇒ F2) iff for all interpretations I ,I |= F1 → F2

F1 ⇒ F2 iff F1 → F2 is valid

I Thus, if we have a procedure for checking satisfiability, we can also checkimplication

I Caveat: F1 ⇔ F2 and F1 ⇒ F2 are not formulas (they are not part of PLsyntax); they are semantic judgments!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 38/40

Page 166: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Implication

I Formula F1 implies F2 (written F1 ⇒ F2) iff for all interpretations I ,I |= F1 → F2

F1 ⇒ F2 iff F1 → F2 is valid

I Thus, if we have a procedure for checking satisfiability, we can also checkimplication

I Caveat: F1 ⇔ F2 and F1 ⇒ F2 are not formulas (they are not part of PLsyntax); they are semantic judgments!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 38/40

Page 167: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Example

I Prove that F1 ∧ (¬F1 ∨ F2) implies F2 using semantic argument method.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 39/40

Page 168: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary

I Today:

Review of basic concepts underlying propositional logic

I Next lecture:

Normal forms and algorithms for deciding satisfiability

I Reading:

Bradley & Manna texbook until Section 1.6

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 40/40

Page 169: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary

I Today:

Review of basic concepts underlying propositional logic

I Next lecture:

Normal forms and algorithms for deciding satisfiability

I Reading:

Bradley & Manna texbook until Section 1.6

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 40/40

Page 170: ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction ...vganesh/TEACHING/F2013/SATSMT... · 2013-11-01 · What is this Course About? I This course

Summary

I Today:

Review of basic concepts underlying propositional logic

I Next lecture:

Normal forms and algorithms for deciding satisfiability

I Reading:

Bradley & Manna texbook until Section 1.6

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 1: Introduction to Logic in SE 40/40