Lecture 2 Propositional Logic

Slides:



Advertisements
Similar presentations
Automated Theorem Proving
Advertisements

Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Logic Concepts Lecture Module 11.
HISTORY OF LOGIC BY JOHN NAGUIB. What is Logic? The science or study of how to evaluate arguments and reasoning. “Logic is new and necessary reasoning”
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution 3.7. Natural Deduction.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Chapter 3 Propositional Logic
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 4.
Lecture 24: Gödel’s Proof CS150: Computer Science
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
S P Vimal, Department of CSIS, BITS, Pilani
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Propositional calculus
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
CS6133 Software Specification and Verification
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Chapter 7. Propositional and Predicate Logic
Discrete Mathematics for Computer Science
Knowledge Representation and Reasoning
The Propositional Calculus
ARTIFICIAL INTELLIGENCE
Logics for Data and Knowledge Representation
Great Theoretical Ideas in Computer Science
Logical Inference: Through Proof to Truth
Logics for Data and Knowledge Representation
Propositional Calculus: Boolean Algebra and Simplification
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Principles of proof calculi Natural deduction
Artificial Intelligence: Agents and Propositional Logic.
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Logics for Data and Knowledge Representation
Chapter 7. Propositional and Predicate Logic
Presentation transcript:

Lecture 2 Propositional Logic Xiaokang Qiu

A brief history of logic Beginnings Aristotle (~300 B CE) Earliest formal study of logic Rhetoric, syllogism, philosophy, geometry Furthered by Islamic logicians Logic in India Nyaya and Vaisheshika (2 CE) Ontology; obtaining valid knowledge Logic in China Mozi school (~400 B CE)

A brief history of logic Syllogism Major premise: Every man is mortal Minor premise: Socrates is a man Conclusion: Socrates is mortal “man”, “mortal”, “Socrates” – not important Every M is D S is an M Conclude: S is D ∀𝑥. 𝑀 𝑥 →𝐷 𝑥 𝑀(𝑆) So, 𝐷(𝑆).

A brief history of logic The algebraic school George Boole and others (end of 19th century) Algebraic structure of formulas; Boolean algebra The logicist school (Russel, Wittgenstein, Frege) Frege: book of “Begriffsschrift” developed an elaborate formal language Quantifiers, “predicate calculus”, number-theory -> logic Russel’s paradox Book of “Principia Mathematica” (Russel-Whitehead, 1910-1913)

A brief history of logic The mathematical school (early 20th century) Dedekind, Peano, Hilbert, Heyton, Zermelo, Tarski Axiomatize branches of math (geometry, arithmetic, set-theory) Zermelo: Axiomatization of set-theory The Hilbert program: formalization of all of mathematics in axiomatic form, with a proof of consistency using “finitary” methods. Godel’s theorems: PhD: Every F O sentence can be deduced in common deductive systems. Godel’s completeness theorem Any axiomatization that includes arithmetic must either be unsound or incomplete (i.e. there is a sentence neither provable nor disprovable) Godel’s incompleteness theorem.

A brief history of logic The mathematical school (20th century) Tarski: Logician extraoradinaire ( ~ 2500 pages!) Completeness, truth, definability, decidability Alonzo Church, and students Kleene and Henkin Church’s thesis of computability First-order logic is undecidable

Post WW-II model theory proof theory computability theory set theory Study of mathematical structures (groups, etc.) using logic proof theory Study of axiom systems, inference systems, proofs computability theory Relationship of logic to computability/complexity set theory foundations of mathematics, axiomatic set theory Cohen: independence of continuum hypo and independence of axiom of choice from ZF axioms. constructivism applications of logic in computer science applied logic to AI, databases, verification, aided by tools like automated and semi-automated theorem provers

Propositional Logic

Propositional Logic: Syntax Propositions Sentences that can be determined as true or false p = “Tomorrow is raining.” q = “U.S. has 50 states.” 𝑃: a countably infinite set of propositions 𝑝 1 , 𝑝 2 ,… Well Formed Formulae (𝑊𝐹𝐹) is the smallest set that satisfies: ⊤,⊥∈𝑊𝐹𝐹, 𝑝∈𝑊𝐹𝐹 for any 𝑝∈𝑃 If 𝛼∈𝑊𝐹𝐹, then ¬𝛼 ∈𝑊𝐹𝐹 If 𝛼 1 , 𝛼 2 ∈𝑊𝐹𝐹, then 𝛼 1 ∼ 𝛼 2 ∈𝑊𝐹𝐹 ∼ is a connective, e.g., ∧, ∨, →

Propositional Logic: Syntax Precedence: ¬ takes precedence over ∧ ∧ takes precedence over ∨ E.g., ¬𝑝∧𝑞∨𝑟 Alternative Syntax 𝛼→𝛽≡¬𝛼∨𝛽 𝛼∧𝛽≡¬(¬𝛼∨¬𝛽)

Propositional Logic: Semantics A model/valuation/interpretation is a function 𝑣:𝑃→{𝑇,𝐹} 𝑣 can be extended to 𝑣 , mapping every formula to {𝑇,𝐹}: 𝑣 𝑝 =𝑣(𝑝) 𝑣 ¬𝛼 = 𝑇 𝑖𝑓 𝑣 𝛼 =𝐹 𝐹 𝑖𝑓 𝑣 𝛼 =𝑇 𝑣 𝛼 1 ∧ 𝛼 2 = 𝑇 𝑖𝑓 𝑣 𝛼 1 =𝑇 𝑎𝑛𝑑 𝑣 𝛼 2 =𝑇 𝐹 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 𝑣 𝛼 1 ∨ 𝛼 2 = 𝑇 𝑖𝑓 𝑣 𝛼 1 =𝑇 𝑜𝑟 𝑣 𝛼 2 =𝑇 𝐹 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Propositional Logic: Semantics 𝑣 𝛼 =𝑇 is also denoted as 𝑣⊨𝛼 A wff 𝛼 is a tautology if 𝑣 𝛼 =𝑇 for every model 𝑣, denoted as ⊨𝛼 E.g., 𝑝→𝑝 A wff 𝛼 is satisfiable if 𝑣 𝛼 =𝑇 for some model 𝑣 E.g., 𝑝∧¬𝑞 Theorem: 𝛼 is a tautology iff. ¬𝛼 is unsatisfiable.

Propositional Logic: Inference How to check if 𝛼 is a tautology (or ¬𝛼 is satisfiable) ? Many procedures have been developed: Hilbert System Tableaux Resolution DPLL Natural Deduction Sequent Calculus

Normal Forms Negation Normal Form (NNF) Conjunctive Normal Form (CNF) Every negation is used only on propositions E.g., ¬𝑝∨¬𝑞 Atomic 𝑝 or ¬𝑝 is called a literal Conjunctive Normal Form (CNF) 𝑖=1 𝑚 ( 𝑗=1 𝑛 𝑙 𝑖,𝑗 ) E.g., 𝑝 1 ∨ p 2 ∨¬ 𝑝 3 ∧ ¬ 𝑝 1 ∨ p 2 ∨ 𝑝 3 Disjunctive Normal Form (DNF) 𝑖=1 𝑚 𝑗=1 𝑛 𝑙 𝑖,𝑗

Normal Forms Theorem: there is no polynomial blow-up translation from wff to CNF/DNF. Theorem: SAT can be reduced to CNF-SAT in polynomial time. Idea: introduce a fresh variable for each subformula Cook’s Theorem: CNF-SAT is NP-complete.

Resolution Is 𝛼 a tautology?  Is ¬𝛼 unsatisfiable?  Is the equivalent 𝐷 1 ∧ 𝐷 2 ∧…∧ 𝐷 𝑘 unsatisfiable? Resolution: 𝐷∨𝑝 𝐷 ′ ∨¬𝑝 𝐷∨ 𝐷 ′ 𝐷∨ 𝐷 ′ is added as a new disjunction Repeat until no more resolution can be done Resolution is closed if the empty clause is contained Unsatisfiable iff. Closed Example: 𝑝∨𝑞 ∧ ¬𝑝∨𝑟 ∧ ¬𝑞∨𝑟 ∧(¬𝑟)

Resolution Theorem: resolution is sound. If the resolution is closed, 𝛼 is unsat. Easy to prove.

Resolution Theorem: resolution is complete. If 𝛼 is unsat, show the resolution will be closed. Resolution will continue if there are both 𝑝 and ¬𝑝 in Γ, and preserves the satisfiability. Γ= Γ 1 ∧ Γ 2 ∧ Γ 3 Γ 1 are conjuncts containing 𝑝; Γ 2 are conjuncts containing ¬𝑝; Γ 3 are conjuncts containing neither. Γ 1 = 𝑖=1 𝑚 𝐷 𝑖 ∨𝑝 Γ 2 = 𝑗=1 𝑛 𝐸 𝑗 ∨¬𝑝 Γ 1 × Γ 2 = 𝑖,𝑗=1,1 𝑚,𝑛 𝐷 𝑖 ∨ 𝐸 𝑗 Let Γ ′ = Γ 1 × Γ 2 ∧ Γ 3 . if Γ is satisfiable, so is Γ ′ Let 𝑣⊨Γ. If 𝑣 𝑝 =𝑇, all 𝐸 𝑖 are satisfiable. So 𝑣⊨ Γ 1 × Γ 2 Similarly if 𝑣 𝑝 =𝐹

DPLL Procedure Backtracking based search Assign a value to a variable to simplify the CNF Stop if all variables are assigned Backtrack if unsatisfiable Variables are chosen heuristically Most efficient SAT solving procedure since 1960s Implementations: zChaff, Minisat, etc.

Compactness Theorem Theorem: An infinite set of formulas Γ is satisfiable iff. every finite subset of Γ is satisfiable. Proof: skipped.

Application: Four-Color Theorem https://en.wikipedia.org/wiki/Four_color_theorem