# CS510 Software Engineering

Size: px
Start display at page:

Transcription

1 CS510 Software Engineering Propositional Logic Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang Spring 2015 Additional slides credit: Michael Reniers, Julia Lawall, and Neil Jones.

2 Motivation Many static analysis techniques rely on proofing that some set of conditions hold. We need to come up with a way to express these conditions and reason about them. SAT solving allows to test the satisfiablity of propositional formulas in the domain of Boolean values. SAT solving is used for, e.g., formal equivalence checking, model checking, formal verification, automatic test pattern generation, scheduling problems, and symbolic execution. We need to understand propositional logic and SAT solving to follow the techniques listed above. Mathias Payer (Purdue University) CS510 Software Engineering / 60

3 History of Logic Philosophical Logic (500BC to 19th century) Symbolic Logic (mid to late 19th century) Mathematical Logic (late 19th century to mid 20th century) Logic in Computer Science (now) Mathias Payer (Purdue University) CS510 Software Engineering / 60

4 Syntax of propositional logic Table of Contents 1 Syntax of propositional logic 2 Semantics of propositional logic 3 Semantic entailment Natural deduction of proof system Soundness and completeness 4 Validity and Satisfiability Conjunctive normal forms 5 SAT Solver Mathias Payer (Purdue University) CS510 Software Engineering / 60

5 Syntax Syntax of propositional logic F :== (P) ( F ) (F F ) (F F ) (F F ) P :== p q r... Propositional atoms (p, q, r,...) are used to describe declarative sentences like 1037 is a prime number, Every even number > 2 is the sum of two prime numbers, or All Martians like pepperoni on their pizza (i.e., they can be evaluated to true or false). Connective Symbol Alternative Symbols negation (not) disjunction (or) conjunction (and) & mplication (implies),, Mathias Payer (Purdue University) CS510 Software Engineering / 60

6 Syntax of propositional logic Syntax for propositional logic Binding priorities:,,,, (These help reduce the amount of brackets needed. Also, outermost brackets are often omitted.) Mathias Payer (Purdue University) CS510 Software Engineering / 60

7 Semantics of propositional logic Table of Contents 1 Syntax of propositional logic 2 Semantics of propositional logic 3 Semantic entailment Natural deduction of proof system Soundness and completeness 4 Validity and Satisfiability Conjunctive normal forms 5 SAT Solver Mathias Payer (Purdue University) CS510 Software Engineering / 60

8 Semantics of propositional logic Semantics for Propositional Logic The meaning of a formula depends on: The meaning of the propositional atoms (occurring in the formula) The meaning of the connectives (occurring in the formula) Mathias Payer (Purdue University) CS510 Software Engineering / 60

9 Semantics of propositional logic Semantics: Propositional Atoms The meaning of the propositional atoms (occurring in the formula): A declarative sentence is either true or false Captured as an assignment of truth values (B = {T, F }) to the propositional atoms a valuation v : P B Mathias Payer (Purdue University) CS510 Software Engineering / 60

10 Semantics of propositional logic Semantics: Connectives The meaning of an n-ary connective is captured by a function f : B n B Usually, such functions are specified by a truth table. A B A A B A B A B T T F T T T T F F F T F F T T F T T F F T F F T Mathias Payer (Purdue University) CS510 Software Engineering / 60

11 Semantics of propositional logic Example: Formula Evaluation Evaluate the following formula: (p q) (q r) (p r) p q r p q q r p r A B C T T T T T T T T T T F T F F F T T F T F T F T T T F F F T F F T F T T T T T T T F T F T F F T T F F T T T T T T F F F T T T T T Mathias Payer (Purdue University) CS510 Software Engineering / 60

12 Semantic entailment Table of Contents 1 Syntax of propositional logic 2 Semantics of propositional logic 3 Semantic entailment Natural deduction of proof system Soundness and completeness 4 Validity and Satisfiability Conjunctive normal forms 5 SAT Solver Mathias Payer (Purdue University) CS510 Software Engineering / 60

13 Semantic entailment Areas of Interest Semantic entailment. Many logical arguments are of the form: from the assumptions φ 1, φ 2,... φ n we know ψ. This is formalised by the semantic entailment relation =. E.g., M = A describes that a situation M satisfies a formula A. Formally, φ 1, φ 2,... φ n = ψ iff for all valuations v such that φ i (v) = T for all 1 i n we have ψ (v) = T Validity: a formula φ is valid if = φ holds. Satisfiability: a formula φ is sat if there exists a valuation v so that φ (v) = T. Mathias Payer (Purdue University) CS510 Software Engineering / 60

14 Semantic entailment Semantic Entailment How do we establish semantic entailment φ 1, φ 2,... φ n = ψ? Option 1: Construct a truth table. If formulas contain m propositional atoms, the truth table contains 2 m lines! Option 2: Give a proof. Suppose that (p q) (q r). Suppose that p. Then, as p q follows from (p q) (q r), we have q. Finally, as q r follows from (p q) (q r), we have r. Thus the formula holds (i.e., there is no contradiction). Mathias Payer (Purdue University) CS510 Software Engineering / 60

15 Semantic entailment Semantic Entailment Proof rules for inferring a conclusion ψ from a list of premises φ 1, φ 2,... φ n (x y means that y is provable from x): φ 1, φ 2,... φ n ψ(sequent) What is a proof of a sequent φ 1, φ 2,... φ n ψ? Proof rules may be instantiated: consistent replacement of variables with formulas. Constructing the proof is filling the gap between the premises and the conclusion by applying a suitable sequence of proof rules. Mathias Payer (Purdue University) CS510 Software Engineering / 60

16 Semantic entailment Natural Deduction: Conjunction Natural deduction of proof system Proof rules for conjunction: proofs of ψ φ are a concatenation of proofs for ψ and proofs of φ. introduction: ψ φ ψ φ i elimination: ψ φ ψ e 1 ψ φ φ e 2 Mathias Payer (Purdue University) CS510 Software Engineering / 60

17 Semantic entailment Conjunction: Exercise Natural deduction of proof system Prove (p q) r, s t q s. Given that we have (p q) r and s t we can prove q s. Linear representation: 1 (p q) r premise 2 s t premise 3 p q e q e s e q s i 4,5 Mathias Payer (Purdue University) CS510 Software Engineering / 60

18 Semantic entailment Conjunction: Exercise (2) Natural deduction of proof system Prove (p q) r, s t q s. Given that we have (p q) r and s t we can prove q s. Tree representation: (p q) r p q q e 1 e 2 q s s t s e 1 i Mathias Payer (Purdue University) CS510 Software Engineering / 60

19 Semantic entailment Natural Deduction: Disjunction Natural deduction of proof system Proof rules for disjunction: introduction: ψ ψ φ i 1 φ ψ φ i 2 elminiation: φ ψ φ. χ χ ψ. χ e Mathias Payer (Purdue University) CS510 Software Engineering / 60

20 Semantic entailment Disjunction: Exercise Natural deduction of proof system Prove (p q) (p r) p (q r): 1 (p q) (p r) premise 2 p q assumption (1) 3 p e q e q r i p (q r) i 3, 5 7 p r assumption (2) 8 p e r e q r i p (q r) i 8,10 12 p (q r) e 1, 2-6, 7-11 Mathias Payer (Purdue University) CS510 Software Engineering / 60

21 Semantic entailment Natural Deduction: Implication Natural deduction of proof system Proof rules for implication: introduction elminiation φ φ. ψ φ ψ i φ ψ ψ e Mathias Payer (Purdue University) CS510 Software Engineering / 60

22 Semantic entailment Implication: Exercise Natural deduction of proof system Prove p q, q r p r: 1 p q premise 2 q r premise 3 p assumption 4 q e 1, 3 5 r e 2, 4 6 p r i 3-5 Mathias Payer (Purdue University) CS510 Software Engineering / 60

23 Semantic entailment Natural Deduction: Negation Natural deduction of proof system Proof rules for negation: introduction elimination: φ. φ i φ φ q Mathias Payer (Purdue University) CS510 Software Engineering / 60

24 Negation: Exercise Semantic entailment Natural deduction of proof system Prove p q, p q p: 1 p q premise 2 p q premise 3 p assumption 4 q e 1,3 5 q e 2,3 6 e 4, 5 7 p i 3-6 Mathias Payer (Purdue University) CS510 Software Engineering / 60

25 Semantic entailment Negation: Exercise (2) Natural deduction of proof system Prove p q p q: 1 p q premise 2 p assumption ( e 1 ) 3 p assumption (contradiction) 4 e 3, 2 5 q e 4 6 p q i q assumption ( e 2 ) 8 p assumption 9 q copy 7 10 p q i 8, 9 11 p q e 1, 2-6, 7-10 Mathias Payer (Purdue University) CS510 Software Engineering / 60

26 Semantic entailment Natural Deduction: Falsum Natural deduction of proof system Proof rules for falsum: introduction: there are no proof rules for the introduction of elimination: φ e Mathias Payer (Purdue University) CS510 Software Engineering / 60

27 Semantic entailment Natural deduction of proof system Natural Deduction: Double Negation Proof rules for double negation: introduction: elimination: φ φ i φ φ e Mathias Payer (Purdue University) CS510 Software Engineering / 60

28 Semantic entailment Natural deduction of proof system Natural Deduction: Derived Rules Modus Tollens: φ ψ ψ MT φ Reduction Ad Absurdum: φ. φ RAA Tertium Non Datur: φ φ TND TND can also be called Law of the Excluded Middle. Mathias Payer (Purdue University) CS510 Software Engineering / 60

29 Semantic entailment Soundness and completeness Natural Deduction is Sound and Complete Natural deduction is sound: if φ 1, φ n ψ, then φ 1, φ n = ψ Natural deduction is complete: if φ 1, φ n = ψ, then φ 1, φ n ψ Mathias Payer (Purdue University) CS510 Software Engineering / 60

30 Validity and Satisfiability Table of Contents 1 Syntax of propositional logic 2 Semantics of propositional logic 3 Semantic entailment Natural deduction of proof system Soundness and completeness 4 Validity and Satisfiability Conjunctive normal forms 5 SAT Solver Mathias Payer (Purdue University) CS510 Software Engineering / 60

31 Validity and Satisfiability Validity and Satisfiability of Propositional Formulas A formula φ is valid if for any valuations v, φ (v) = A formula φ is satisfiable if there exists a valuation v such that φ (v) = Mathias Payer (Purdue University) CS510 Software Engineering / 60

32 Validity and Satisfiability Validity and Satisfiability: Example p q satisfiable p (q p) valid(and satisfiable) p p unsatisfiable Mathias Payer (Purdue University) CS510 Software Engineering / 60

33 Validity and Satisfiability Deciding Validity What are the means to decide whether or not a given formula φ is valid? Use techniques for semantic entailment (e.g., natural deduction) Use a calculus for semantical equivalence to prove that φ. Transform φ into some normal form that is semantically equivalent and then apply dedicated (syntactic) techniques. (φ and ψ are semantically equivalent (not φ ψ) iff φ = ψ and ψ = φ. Mathias Payer (Purdue University) CS510 Software Engineering / 60

34 Validity and Satisfiability Deciding Validity (2) Lemma 1.41 A decision procedure for validity can be used for semantic entailment. φ 1, φ n = ψ iff = φ 1 (φ 2 (φ n ψ)) Mathias Payer (Purdue University) CS510 Software Engineering / 60

35 Validity and Satisfiability Deciding Validity (3) If I m wealthy, then I m happy. I am happy.therefore, I m wealthy. If John drinks beer, he is at least 21 years old. John does not drink beer.therefore, John is not yet 21 years old. If I study, then I will not fail basket weaving 101. If I do not play cards too often, then I will study. I failed basket weaving 101.Therefore, I played cards too often. Mathias Payer (Purdue University) CS510 Software Engineering / 60

36 Validity and Satisfiability Conjunctive Normal Form Conjunctive normal forms A literal is either an atom p or the negation of an atom p. A formula φ is in conjunctive normal form (CNF) if it is a conjunction of a number of disjunctions and literals only. L ::= P P C ::= L C C CNF ::= C CNF CNF literal clause CNF Mathias Payer (Purdue University) CS510 Software Engineering / 60

37 CNF Examples Validity and Satisfiability Conjunctive normal forms p, p CNF p not CNF p p CNF (p r) ( r s) q CNF (p q) q not CNF Mathias Payer (Purdue University) CS510 Software Engineering / 60

38 Validity in CNF Validity and Satisfiability Conjunctive normal forms Remember a formula is valid iff any of its equivalent formulas is valid. Reduce the problem of determining whether any φ is valid to the problem of computing an equivalent ψ φ such that ψ is in CNF and then checking ψ. Deciding validity in CNF (C 1 C 2 C n ) is incremental: each clause C i must be valid individually. Each clause C i consists of a disjunction of literals L 1 L 2 L m. A disjunction of literals is valid iff there are 1 i, j m such that L i is L j. Mathias Payer (Purdue University) CS510 Software Engineering / 60

39 Validity and Satisfiability Validity in CNF (2) Conjunctive normal forms We now have a simple way to check the validity of = φ as long as φ is in CNF: inspect all conjuncts ψ k of φ and search for atoms in ψ k so that ψ k also contains their negation. If a match is found for all conjuncts we have = φ. Otherwise (i.e., some conjunct contains no pair L i and L j ), φ is not valid. Mathias Payer (Purdue University) CS510 Software Engineering / 60

40 Validity and Satisfiability Transformation into CNF Conjunctive normal forms 1 IF: Remove all occurrences of : translate ψ η to ψ η (in: formula, out: formula without ). 2 NNF: Obtain a negation normal form (NNF) where only atoms are negated (in: formula without, out: formula in NNF): N ::= P P (N N) (N N) P ::= p q r 3 CNF: Apply distribution laws (in: formula in NNF, out: formula in CNF): replace (φ 1 φ 2 ) ψ by (φ 1 ψ) (φ 2 ψ) replace φ (ψ 1 ψ 2 ) by (φ ψ 1 ) (φ ψ 2 ) Therefore, CNF (NNF (IF (φ))) is in CNF and semantically equivalent with φ. Mathias Payer (Purdue University) CS510 Software Engineering / 60

41 Validity and Satisfiability Conjunctive normal forms Transformation into CNF: IF algorithm Remove implications from the formula by applying the following replacement until you reach a fix-point: ψ η to ψ η Inductive definition of IMPL FREE: IF (p) = p IF ( φ) = IF (φ) IF (φ 1 φ 2 ) = IF (φ 1 ) IF (φ 2 ) IF (φ 1 φ 2 ) = IF (φ 1 ) IF (φ 2 ) IF (φ 1 φ 2 ) = IF (φ 1 ) IF (φ 2 ) Properties of IF : it is (i) well-defined (terminates for any input), (ii) IF (ψ) ψ (output of both formulas are semantically equivalent),and (iii) IF (ψ) is an implication-free formula for any formula ψ. Mathias Payer (Purdue University) CS510 Software Engineering / 60

42 Validity and Satisfiability Conjunctive normal forms Transformation into CNF: NNF algorithm Simplify formula into negation normal form by repeatedly applying pattern rewriting rules: φ replace by φ (φ ψ) replace by φ ψ (φ ψ) replace by φ ψ Inductive definition of NFF: NNF (p) = p NNF ( p) = p NNF ( φ) = NNF (φ) NNF ( (φ ψ)) = NNF ( φ) NNF ( ψ) NNF ( (φ ψ)) = NNF ( φ) NNF ( ψ) NNF (φ ψ) = NNF (φ) NNF (ψ) NNF (φ ψ) = NNF (φ) NNF (ψ) Mathias Payer (Purdue University) CS510 Software Engineering / 60

43 Validity and Satisfiability Conjunctive normal forms Transformation into CNF: NNF algorithm (2) Properties of NNF : it is (i) well-defined (terminates for any input), (ii) NNF (ψ) ψ (output of both formulas are semantically equivalent),and (iii) NNF (ψ) is a negation-free formula for any formula ψ. Mathias Payer (Purdue University) CS510 Software Engineering / 60

44 Validity and Satisfiability Conjunctive normal forms Transformation into CNF: CNF algorithm Simplify formula into conjunctive normal form (CNF) by repeatedly applying pattern rewriting rules: (φ 1 φ 2 ) ψ replace by (φ 1 ψ) (φ 2 ψ) φ (ψ 1 ψ 2 ) replace by (φ ψ 1 ) (φ ψ 2 ) Mathias Payer (Purdue University) CS510 Software Engineering / 60

45 Validity and Satisfiability Conjunctive normal forms Transformation into CNF: CNF algorithm (2) Inductive definition of CNF: CNF (p) = p CNF ( p) = p CNF (φ 1 φ 2 ) = CNF (φ 1 ) CNF (φ 2 ) CNF (φ 1 φ 2 ) = D(CNF (φ 1 ), CNF (φ 2 )) D(φ 11, φ 2 ) D(φ 12, φ 2 ) φ 1 = φ 11 φ 12 D(φ 1, φ 2 ) = D(φ 1, φ 21 ) D(φ 1, φ 22 ) φ 2 = φ 21 φ 22 φ 1 φ 2 otherwise Properties of CNF and D: CNF and D are (i) well-defined (terminate for any input), (ii) D(φ, ψ) φ ψ and CNF (φ) φ (output of both formulas are semantically equivalent),and (iii) CNF (φ) is in CNF for any formula φ in NNF and D(φ, ψ) is in CNF for any formulas φ and ψ in CNF. Mathias Payer (Purdue University) CS510 Software Engineering / 60

46 CNF: Example Validity and Satisfiability Conjunctive normal forms Find a CNF for p q r: p q r premise (p q) r apply IMPL FREE ( p q) r apply NNF ( p q) r apply NNF ( p r) (q r) apply CNF Mathias Payer (Purdue University) CS510 Software Engineering / 60

47 Table of Contents SAT Solver 1 Syntax of propositional logic 2 Semantics of propositional logic 3 Semantic entailment Natural deduction of proof system Soundness and completeness 4 Validity and Satisfiability Conjunctive normal forms 5 SAT Solver Mathias Payer (Purdue University) CS510 Software Engineering / 60

48 SAT Solver SAT Solver Find satisfying valuations to a propositional formula. Develop a systematic approach to test all possible valuations to find a satisfiable valuation. SAT solving is NP-complete, so the worst-case complexity will always be exponential.but good heuristics exist. Mathias Payer (Purdue University) CS510 Software Engineering / 60

49 SAT Solver Forcing Laws: Negation φ φ T F F T o T F o F T Mathias Payer (Purdue University) CS510 Software Engineering / 60

50 SAT Solver Forcing Laws: Conjunction φ ψ φ ψ T T T T F F F T F F F F φ, ψ φ, ψ T = T, T T, T = T?, F = F F,? = F, φ ψ, ψ φ F, T = F F, T = F Mathias Payer (Purdue University) CS510 Software Engineering / 60

51 SAT Solver Forcing Laws: Completeness Is this enough?we now have and. We can convert any propositional formula (without loss of generality) to a formula that only contains and. Simplify formula into, T (p) T ( φ) T (φ ψ) T (φ ψ) T (φ ψ) = p = T (φ) = T (φ) T (ψ) = ( T (φ) T (ψ)) = (T (φ) T (ψ)) This translation results in a linear growth in the formula size. Mathias Payer (Purdue University) CS510 Software Engineering / 60

52 SAT Solving SAT Solver 1 Convert formula to and 2 Translate the formula to a DAG, sharing common subterms. 3 Set the root to T and apply the forcing rules. The formula is satisfiable iff all nodes are consistently annotated. Mathias Payer (Purdue University) CS510 Software Engineering / 60

53 SAT Solver Example: Satisfiability Formula: p (q p) p ( q p): 1T 2T 3F 4T 5T 5T 6F 2T p q 6F Is the formula satisfiable? Yes: p = T, q = F is a witness. Mathias Payer (Purdue University) CS510 Software Engineering / 60

54 Example: Validity SAT Solver Show the validity of (p (p q)) p. This formula is valid if ((p (p q)) p) is not satisfiable.translated formula: ( p (p q)) p. 1T 2T 2T 3F 4F 5T 3F p q Contradiction! Mathias Payer (Purdue University) CS510 Software Engineering / 60

55 SAT Solver Example: Satisfiability Formula: (p (p q)) p ((p (p q)) p) 1T 2F p q We have an unsatisfiable formula. Now what? Mathias Payer (Purdue University) CS510 Software Engineering / 60

56 SAT Solver Limitation of the SAT solver algorithm Fails for all formulas of the form (φ 1 φ 2 ). Yet, some are valid and thus satisfiable: p p (p p) Some are not valid and thus not satisfiable: ( ) (p p p p) ( (p p) (p p)) Mathias Payer (Purdue University) CS510 Software Engineering / 60

57 SAT Solver Extended Algorithm SAT Checking 1 Pick an unmarked node and add temporary T and F marks. 2 Use the forcing rules to propagate both marks. 3 If both marks lead to a contradiction, report a contradiction. 4 If both marks lead to some node having the same value, permanently assign the node that value. 5 Erase the remaining temporary marks and continue. Complexity: O(n 3 ): (i) testing each unmarked node O(n), (ii) testing a given unmarked node O(n), (iii) repeating the process when a new node is marked O(n). Mathias Payer (Purdue University) CS510 Software Engineering / 60

58 SAT Solver Extended Algorithm: Example Formula: (q r) ( (q r) ( q r)): 3F 2T 8T q 6T 7T r 6T 4T 1T 2T 4F 5F 3F 5T 5F 6T 8T q 6T 7T r 6T 7T 7T r 6T 8T q 6T r is true in both cases. Fix r to T. Mathias Payer (Purdue University) CS510 Software Engineering / 60

59 SAT Solver Extended Algorithm: Example (2) 1T 2T 2T 3F 3F 5F q r 4T 7T 8F 6F 7T 5F q r 4T 6T r 4T 5F q Satisfiable! Mathias Payer (Purdue University) CS510 Software Engineering / 60

60 Questions? SAT Solver? Mathias Payer (Purdue University) CS510 Software Engineering / 60

### Logic in general. Inference rules and theorem proving

Logical Agents Knowledge-based agents Logic in general Propositional logic Inference rules and theorem proving First order logic Knowledge-based agents Inference engine Knowledge base Domain-independent

### Correspondence analysis for strong three-valued logic

Correspondence analysis for strong three-valued logic A. Tamminga abstract. I apply Kooi and Tamminga s (2012) idea of correspondence analysis for many-valued logics to strong three-valued logic (K 3 ).

### Handout #1: Mathematical Reasoning

Math 101 Rumbos Spring 2010 1 Handout #1: Mathematical Reasoning 1 Propositional Logic A proposition is a mathematical statement that it is either true or false; that is, a statement whose certainty or

### Satisfiability Checking

Satisfiability Checking SAT-Solving Prof. Dr. Erika Ábrahám Theory of Hybrid Systems Informatik 2 WS 10/11 Prof. Dr. Erika Ábrahám - Satisfiability Checking 1 / 40 A basic SAT algorithm Assume the CNF

### CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

### Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

CHAPTER 4. STATEMENT LOGIC 59 The rightmost column of this truth table contains instances of T and instances of F. Notice that there are no degrees of contingency. If both values are possible, the formula

### Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

### Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

Predicate logic SET07106 Mathematics for Software Engineering School of Computing Edinburgh Napier University Module Leader: Uta Priss 2010 Copyright Edinburgh Napier University Predicate logic Slide 1/24

### 2. The Language of First-order Logic

2. The Language of First-order Logic KR & R Brachman & Levesque 2005 17 Declarative language Before building system before there can be learning, reasoning, planning, explanation... need to be able to

### Mathematical Induction

Mathematical Induction In logic, we often want to prove that every member of an infinite set has some feature. E.g., we would like to show: N 1 : is a number 1 : has the feature Φ ( x)(n 1 x! 1 x) How

### Optimizing Description Logic Subsumption

Topics in Knowledge Representation and Reasoning Optimizing Description Logic Subsumption Maryam Fazel-Zarandi Company Department of Computer Science University of Toronto Outline Introduction Optimization

### Ensuring Consistency in Long Running Transactions

Ensuring Consistency in Long Running Transactions UCLA Computer Science Dept. Technical Report TR-070011 Jeffrey Fischer Rupak Majumdar Department of Computer Science, University of California, Los Angeles

### Foundational Proof Certificates

An application of proof theory to computer science INRIA-Saclay & LIX, École Polytechnique CUSO Winter School, Proof and Computation 30 January 2013 Can we standardize, communicate, and trust formal proofs?

### Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

irst Order Logic Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both. Are the following sentences propositions? oronto

### Computational Methods for Database Repair by Signed Formulae

Computational Methods for Database Repair by Signed Formulae Ofer Arieli (oarieli@mta.ac.il) Department of Computer Science, The Academic College of Tel-Aviv, 4 Antokolski street, Tel-Aviv 61161, Israel.

### Rigorous Software Development CSCI-GA 3033-009

Rigorous Software Development CSCI-GA 3033-009 Instructor: Thomas Wies Spring 2013 Lecture 11 Semantics of Programming Languages Denotational Semantics Meaning of a program is defined as the mathematical

### Automated Theorem Proving - summary of lecture 1

Automated Theorem Proving - summary of lecture 1 1 Introduction Automated Theorem Proving (ATP) deals with the development of computer programs that show that some statement is a logical consequence of

### (LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

(LMCS, p. 317) V.1 First Order Logic This is the most powerful, most expressive logic that we will examine. Our version of first-order logic will use the following symbols: variables connectives (,,,,

### Beyond Propositional Logic Lukasiewicz s System

Beyond Propositional Logic Lukasiewicz s System Consider the following set of truth tables: 1 0 0 1 # # 1 0 # 1 1 0 # 0 0 0 0 # # 0 # 1 0 # 1 1 1 1 0 1 0 # # 1 # # 1 0 # 1 1 0 # 0 1 1 1 # 1 # 1 Brandon

### DEDUCTIVE & INDUCTIVE REASONING

DEDUCTIVE & INDUCTIVE REASONING Expectations 1. Take notes on inductive and deductive reasoning. 2. This is an information based presentation -- I simply want you to be able to apply this information to

### Predicate Logic Review

Predicate Logic Review UC Berkeley, Philosophy 142, Spring 2016 John MacFarlane 1 Grammar A term is an individual constant or a variable. An individual constant is a lowercase letter from the beginning

### Lecture 7: NP-Complete Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

### MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

MATHEMATICAL INDUCTION MIGUEL A LERMA (Last updated: February 8, 003) Mathematical Induction This is a powerful method to prove properties of positive integers Principle of Mathematical Induction Let P

### Resolution. Informatics 1 School of Informatics, University of Edinburgh

Resolution In this lecture you will see how to convert the natural proof system of previous lectures into one with fewer operators and only one proof rule. You will see how this proof system can be used

### Fixed-Point Logics and Computation

1 Fixed-Point Logics and Computation Symposium on the Unusual Effectiveness of Logic in Computer Science University of Cambridge 2 Mathematical Logic Mathematical logic seeks to formalise the process of

### A Theorem Prover for Boolean BI

A Theorem Prover for Boolean BI Jonghyun Park Jeongbong Seo Sungwoo Park Department of Computer Science and Engineering Pohang University of Science and Technology (POSTECH) Republic of Korea {parjong,baramseo,gla}@postech.ac.kr

### npsolver A SAT Based Solver for Optimization Problems

npsolver A SAT Based Solver for Optimization Problems Norbert Manthey and Peter Steinke Knowledge Representation and Reasoning Group Technische Universität Dresden, 01062 Dresden, Germany peter@janeway.inf.tu-dresden.de

### How To Trace

CS510 Software Engineering Dynamic Program Analysis Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-cs510-se

### Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Summary Summary Last Lecture sequent calculus Automated Reasoning Georg Moser Institute of Computer Science @ UIBK Winter 013 (Normalisation and Strong Normalisation) let Π be a proof in minimal logic

### def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Section 1.5 Methods of Proof 1.5.1 1.5 METHODS OF PROOF Some forms of argument ( valid ) never lead from correct statements to an incorrect. Some other forms of argument ( fallacies ) can lead from true

### Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

Logical Agents Explorations in Artificial Intelligence rof. Carla. Gomes gomes@cs.cornell.edu Agents that are able to: Form representations of the world Use a process to derive new representations of the

### Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

### We would like to state the following system of natural deduction rules preserving falsity:

A Natural Deduction System Preserving Falsity 1 Wagner de Campos Sanz Dept. of Philosophy/UFG/Brazil sanz@fchf.ufg.br Abstract This paper presents a natural deduction system preserving falsity. This new

### Computational Logic and Cognitive Science: An Overview

Computational Logic and Cognitive Science: An Overview Session 1: Logical Foundations Technical University of Dresden 25th of August, 2008 University of Osnabrück Who we are Helmar Gust Interests: Analogical

### The Classes P and NP

The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

### Software Modeling and Verification

Software Modeling and Verification Alessandro Aldini DiSBeF - Sezione STI University of Urbino Carlo Bo Italy 3-4 February 2015 Algorithmic verification Correctness problem Is the software/hardware system

### Boolean Algebra Part 1

Boolean Algebra Part 1 Page 1 Boolean Algebra Objectives Understand Basic Boolean Algebra Relate Boolean Algebra to Logic Networks Prove Laws using Truth Tables Understand and Use First Basic Theorems

### Generating models of a matched formula with a polynomial delay

Generating models of a matched formula with a polynomial delay Petr Savicky Institute of Computer Science, Academy of Sciences of Czech Republic, Pod Vodárenskou Věží 2, 182 07 Praha 8, Czech Republic

### Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

OLC mputational gic Schedule Time and Place Thursday, 8:15 9:45, HS E Logic (master program) Georg Moser Institute of Computer Science @ UIBK week 1 October 2 week 8 November 20 week 2 October 9 week 9

### Certamen 1 de Representación del Conocimiento

Certamen 1 de Representación del Conocimiento Segundo Semestre 2012 Question: 1 2 3 4 5 6 7 8 9 Total Points: 2 2 1 1 / 2 1 / 2 3 1 1 / 2 1 1 / 2 12 Here we show one way to solve each question, but there

### Examination paper for MA0301 Elementær diskret matematikk

Department of Mathematical Sciences Examination paper for MA0301 Elementær diskret matematikk Academic contact during examination: Iris Marjan Smit a, Sverre Olaf Smalø b Phone: a 9285 0781, b 7359 1750

### Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications

Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications Sayantan Das Prasenjit Basu Ansuman Banerjee Pallab Dasgupta P.P. Chakrabarti Department of Computer Science & Engineering

### [Refer Slide Time: 05:10]

Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

### Introduction to Logic: Argumentation and Interpretation. Vysoká škola mezinárodních a veřejných vztahů PhDr. Peter Jan Kosmály, Ph.D. 9. 3.

Introduction to Logic: Argumentation and Interpretation Vysoká škola mezinárodních a veřejných vztahů PhDr. Peter Jan Kosmály, Ph.D. 9. 3. 2016 tests. Introduction to Logic: Argumentation and Interpretation

### InvGen: An Efficient Invariant Generator

InvGen: An Efficient Invariant Generator Ashutosh Gupta and Andrey Rybalchenko Max Planck Institute for Software Systems (MPI-SWS) Abstract. In this paper we present InvGen, an automatic linear arithmetic

### OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012

276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a \$ 1,000,000 prize for the

### Algorithmic Software Verification

Algorithmic Software Verification (LTL Model Checking) Azadeh Farzan What is Verification Anyway? Proving (in a formal way) that program satisfies a specification written in a logical language. Formal

### Which Semantics for Neighbourhood Semantics?

Which Semantics for Neighbourhood Semantics? Carlos Areces INRIA Nancy, Grand Est, France Diego Figueira INRIA, LSV, ENS Cachan, France Abstract In this article we discuss two alternative proposals for

### Relations: their uses in programming and computational specifications

PEPS Relations, 15 December 2008 1/27 Relations: their uses in programming and computational specifications Dale Miller INRIA - Saclay & LIX, Ecole Polytechnique 1. Logic and computation Outline 2. Comparing

### NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

### Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets. Logic is the study of reasoning. A language of propositions is fundamental to this study as well as true

### 2 Temporal Logic Model Checking

Bounded Model Checking Using Satisfiability Solving Edmund Clarke 1, Armin Biere 2, Richard Raimi 3, and Yunshan Zhu 4 1 Computer Science Department, CMU, 5000 Forbes Avenue Pittsburgh, PA 15213, USA,

### Lecture 13 of 41. More Propositional and Predicate Logic

Lecture 13 of 41 More Propositional and Predicate Logic Monday, 20 September 2004 William H. Hsu, KSU http://www.kddresearch.org http://www.cis.ksu.edu/~bhsu Reading: Sections 8.1-8.3, Russell and Norvig

### A Semantical Perspective on Verification of Knowledge

A Semantical Perspective on Verification of Knowledge Paul Leemans, Jan Treur, Mark Willems Vrije Universiteit Amsterdam, Department of Artificial Intelligence De Boelelaan 1081a, 1081 HV Amsterdam The

### ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

PROCEEDINGS OF THE YEREVAN STATE UNIVERSITY Physical and Mathematical Sciences 2012 1 p. 43 48 ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS I nf or m at i cs L. A. HAYKAZYAN * Chair of Programming and Information

### Development of a computer system to support knowledge acquisition of basic logical forms using fairy tale "Alice in Wonderland"

Development of a computer system to support knowledge acquisition of basic logical forms using fairy tale "Alice in Wonderland" Antonija Mihaljević Španjić *, Alen Jakupović *, Matea Tomić * * Polytechnic

### Introduction to formal semantics -

Introduction to formal semantics - Introduction to formal semantics 1 / 25 structure Motivation - Philosophy paradox antinomy division in object und Meta language Semiotics syntax semantics Pragmatics

### Discuss the size of the instance for the minimum spanning tree problem.

3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

### Mathematical Induction. Lecture 10-11

Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### COMPUTER SCIENCE TRIPOS

CST.98.5.1 COMPUTER SCIENCE TRIPOS Part IB Wednesday 3 June 1998 1.30 to 4.30 Paper 5 Answer five questions. No more than two questions from any one section are to be answered. Submit the answers in five

### WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

### WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

First Name: Family Name: Student Number: Class/Tutorial: WOLLONGONG COLLEGE AUSTRALIA A College of the University of Wollongong Diploma in Information Technology Final Examination Spring Session 2008 WUCT121

Lecture Notes in Discrete Mathematics Marcel B. Finan Arkansas Tech University c All Rights Reserved 2 Preface This book is designed for a one semester course in discrete mathematics for sophomore or junior

### Chapter 1. NP Completeness I. 1.1. Introduction. By Sariel Har-Peled, December 30, 2014 1 Version: 1.05

Chapter 1 NP Completeness I By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 "Then you must begin a reading program immediately so that you man understand the crises of our age," Ignatius said solemnly.

### Chapter II. Controlling Cars on a Bridge

Chapter II. Controlling Cars on a Bridge 1 Introduction The intent of this chapter is to introduce a complete example of a small system development. During this development, you will be made aware of the

### Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

### Lecture 8: Resolution theorem-proving

Comp24412 Symbolic AI Lecture 8: Resolution theorem-proving Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2014 15 In the previous Lecture, we met SATCHMO, a first-order theorem-prover implemented

### A Few Basics of Probability

A Few Basics of Probability Philosophy 57 Spring, 2004 1 Introduction This handout distinguishes between inductive and deductive logic, and then introduces probability, a concept essential to the study

### CSE 459/598: Logic for Computer Scientists (Spring 2012)

CSE 459/598: Logic for Computer Scientists (Spring 2012) Time and Place: T Th 10:30-11:45 a.m., M1-09 Instructor: Joohyung Lee (joolee@asu.edu) Instructor s Office Hours: T Th 4:30-5:30 p.m. and by appointment

### University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

University of Ostrava Institute for Research and Applications of Fuzzy Modeling Reasoning in Description Logic with Semantic Tableau Binary Trees Alena Lukasová Research report No. 63 2005 Submitted/to

### Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

### Chapter. NP-Completeness. Contents

Chapter 13 NP-Completeness Contents 13.1 P and NP......................... 593 13.1.1 Defining the Complexity Classes P and NP...594 13.1.2 Some Interesting Problems in NP.......... 597 13.2 NP-Completeness....................

### Bounded Treewidth in Knowledge Representation and Reasoning 1

Bounded Treewidth in Knowledge Representation and Reasoning 1 Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien Luminy, October 2010 1 Joint work with G.

### Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Predicate Logic Example: All men are mortal. Socrates is a man. Socrates is mortal. Note: We need logic laws that work for statements involving quantities like some and all. In English, the predicate is

### On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems 29 August 2011 What are workflows to us? Plans or schedules that map users or resources to tasks Such mappings may

### 6.852: Distributed Algorithms Fall, 2009. Class 2

.8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

### Jedd: A BDD-based Relational Extension of Java

Jedd: A BDD-based Relational Extension of Java Ondřej Lhoták Laurie Hendren Sable Research Group, School of Computer Science McGill University, Montreal, Canada {olhotak,hendren}@sable.mcgill.ca ABSTRACT

### Trust but Verify: Authorization for Web Services. The University of Vermont

Trust but Verify: Authorization for Web Services Christian Skalka X. Sean Wang The University of Vermont Trust but Verify (TbV) Reliable, practical authorization for web service invocation. Securing complex

### ML for the Working Programmer

ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming

### MPBO A Distributed Pseudo-Boolean Optimization Solver

MPBO A Distributed Pseudo-Boolean Optimization Solver Nuno Miguel Coelho Santos Thesis to obtain the Master of Science Degree in Information Systems and Computer Engineering Examination Committee Chairperson:

### How To Understand The Theory Of Hyperreals

Ultraproducts and Applications I Brent Cody Virginia Commonwealth University September 2, 2013 Outline Background of the Hyperreals Filters and Ultrafilters Construction of the Hyperreals The Transfer

### General Information and Communication Technology. Second module of this course: Boolean logic. Some elements of computational complexity

General Information and Communication Technology Course Number 322 Jacobs University Bremen Herbert Jaeger Second module of this course: Boolean logic and Some elements of computational complexity Boolean

### DISCRETE MATH: LECTURE 3

DISCRETE MATH: LECTURE 3 DR. DANIEL FREEMAN 1. Chapter 2.2 Conditional Statements If p and q are statement variables, the conditional of q by p is If p then q or p implies q and is denoted p q. It is false

### CSC 373: Algorithm Design and Analysis Lecture 16

CSC 373: Algorithm Design and Analysis Lecture 16 Allan Borodin February 25, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 17 Announcements and Outline Announcements

### Monitoring Metric First-order Temporal Properties

Monitoring Metric First-order Temporal Properties DAVID BASIN, FELIX KLAEDTKE, SAMUEL MÜLLER, and EUGEN ZĂLINESCU, ETH Zurich Runtime monitoring is a general approach to verifying system properties at

### Predicate logic. Logic in computer science. Logic in Computer Science (lecture) PART II. first order logic

PART II. Predicate logic first order logic Logic in computer science Seminar: INGK401-K5; INHK401; INJK401-K4 University of Debrecen, Faculty of Informatics kadek.tamas@inf.unideb.hu 1 / 19 Alphabets Logical

### CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Propositional Logic: logical operators Negation ( ) Conjunction ( ) Disjunction ( ). Exclusive or ( ) Conditional statement ( ) Bi-conditional statement ( ): Let p and q be propositions. The biconditional

### Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY 11794 4400

Lecture 19: Introduction to NP-Completeness Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Reporting to the Boss Suppose

### CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

CHAPTER 3 Methods of Proofs 1. Logical Arguments and Formal Proofs 1.1. Basic Terminology. An axiom is a statement that is given to be true. A rule of inference is a logical rule that is used to deduce

### Static Program Transformations for Efficient Software Model Checking

Static Program Transformations for Efficient Software Model Checking Shobha Vasudevan Jacob Abraham The University of Texas at Austin Dependable Systems Large and complex systems Software faults are major

### Updating Action Domain Descriptions

Updating Action Domain Descriptions Thomas Eiter, Esra Erdem, Michael Fink, and Ján Senko Institute of Information Systems, Vienna University of Technology, Vienna, Austria Email: (eiter esra michael jan)@kr.tuwien.ac.at

### Logic in Computer Science: Logic Gates

Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers

### Introducing Formal Methods. Software Engineering and Formal Methods

Introducing Formal Methods Formal Methods for Software Specification and Analysis: An Overview 1 Software Engineering and Formal Methods Every Software engineering methodology is based on a recommended

### Introduction. The Quine-McCluskey Method Handout 5 January 21, 2016. CSEE E6861y Prof. Steven Nowick

CSEE E6861y Prof. Steven Nowick The Quine-McCluskey Method Handout 5 January 21, 2016 Introduction The Quine-McCluskey method is an exact algorithm which finds a minimum-cost sum-of-products implementation

### Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Rules of Inference Today s Menu Rules of Inference Quantifiers: Universal and Existential Nesting of Quantifiers Applications Old Example Re-Revisited Our Old Example: Suppose we have: All human beings

### Model Checking: An Introduction

Announcements Model Checking: An Introduction Meeting 2 Office hours M 1:30pm-2:30pm W 5:30pm-6:30pm (after class) and by appointment ECOT 621 Moodle problems? Fundamentals of Programming Languages CSCI

### Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1 Prof S Bringsjord 0317161200NY Contents I Problems 1 II Solutions 3 Solution to Q1 3 Solutions to Q3 4 Solutions to Q4.(a) (i) 4 Solution to Q4.(a)........................................