1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011.

Slides:



Advertisements
Similar presentations
Possible World Semantics for Modal Logic
Advertisements

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.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
Logic Concepts Lecture Module 11.
CS128 – Discrete Mathematics for Computer Science
1 CA 208 Logic Ex1 In your own words, define the following 1. Logic: 2. Valid reasoning/inference (2 equivalent definitions): 3. Propositions/statements:
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.
Artificial Intelligence Modal Logic
1 CA 208 Logic Ex3 Define logical entailment  in terms of material implication  Define logical consequence |= (here the semantic consequence relation.
1 CA 208 Logic Logic Prof. Josef van Genabith Textbooks:  The Essence of Logic, John Kelly, Prentice Hall, 1997  Prolog Programming, Third Edition, Ivan.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
From Chapter 4 Formal Specification using Z David Lightfoot
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Propositional Logic Review
Intro to Discrete Structures
Theoretical basis of GUHA Definition 1. A (simplified) observational predicate language L n consists of (i) (unary) predicates P 1,…,P n, and an infinite.
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 CMSC 471 Fall 2002 Class #10/12–Wednesday, October 2 / Wednesday, October 9.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
1 Bisimulations as a Technique for State Space Reductions.
Chapter Three Truth Tables 1. Computing Truth-Values We can use truth tables to determine the truth-value of any compound sentence containing one of.
Computational Semantics Day 5: Inference Aljoscha.
LDK R Logics for Data and Knowledge Representation PL of Classes.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Activity 1-19: The Propositional Calculus
CS6133 Software Specification and Verification
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Chapter 1: The Foundations: Logic and Proofs
Logics for Data and Knowledge Representation
Chapter 1: The Foundations: Logic and Proofs
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
Part-2: Propositional Logic By Dr. Syed Noman Hasany.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Tautology. In logic, a tautology (from the Greek word ταυτολογία) is a formula that is true in every possible interpretation.logic Greek formulainterpretation.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Part-2: Propositional Logic By Dr. Syed Noman Hasany.
CT214 – Logical Foundations of Computing Darren Doherty Rm. 311 Dept. of Information Technology NUI Galway
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–10: Soundness of Propositional Calculus 12 th August, 2010.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
CS 344 Artificial Intelligence By Prof: Pushpak Bhattacharya Class on 12/Feb/2007.
CA 208 Continuous Assessment 2006/7
Propositional Calculus: Boolean Functions and Expressions
CS344 : Introduction to Artificial Intelligence
CS621: Artificial Intelligence
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Propositional Calculus: Boolean Algebra and Simplification
Information Technology Department
Propositional Equivalence (§1.2)
Cirquent calculus Episode 15 About cirquent calculus in general
Logics for Data and Knowledge Representation
Truth Tables Hurley
CS 270 Math Foundations of CS
Logical Agents Chapter 7.
Logics for Data and Knowledge Representation
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logical and Rule-Based Reasoning Part I
Presentation transcript:

1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ

2 So far we have been a little bit sloppy... Because we focused on intuitions... And that’s important Today we make things a bit more formal: What we have been dealing with so far is “Propositional Logic” We’ll define the syntax of Propositional Logic (i.e. the grammar of formulas in Propositional Logic) We’ll define the semantics (meaning) of formulas in Propositional Logic

3 CA 208 Logic Syntax (Grammar) of Propositional Logic Defines what is a formula in Propositional Logic and what is not...

4 CA 208 Logic Let Π be a (coutably infinite...) set of propositional variables Π = {A, B, C,...} (this is the lexicon, the basic building blocks..) If Φ  Π, then Φ is a formula (atomic formula) If Φ is a formula, then  Φ is a formula If Φ and Ψ are formulas, then (Φ  Ψ) is a formula If Φ and Ψ are formulas, then (Φ  Ψ) is a formula If Φ and Ψ are formulas, then (Φ  Ψ) is a formula If Φ and Ψ are formulas, then (Φ  Ψ) is a formula Nothing else is a formula. Comment: notice that we introduced brackets ( )...

5 CA 208 Logic Which of the following are formulas of propositional logic, which are not and why....? A B  B        B (C  A) C  A A  B  C A  (B  C) (A  (B  C))  B A  B

6 CA 208 Logic Notion of a parse-tree/derviation tree (A  (B  C)) ((A  B)  C)   / \ / \ A   C / \ / \ B C A B

7 CA 208 Logic A string of symbols over Π  { , , , , ,(,)} is a formula of propositional logic iff it is constructed by the formation rules (syntax) of propositional logic iff it has a valid derivation tree

8 CA 208 Logic Now the semantics (the meaning M..) (Alfred) Tarski-style Let V be a valuation, i.e. an assignment of truth values to each propositional variable in Π: (formally) V: Π  {0,1} (V is a total function from Π to {0,1}) If Φ  Π, then M(Φ) = V(Φ) (atomic formula) M(  Φ) = 1 iff M(Φ) = 0, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 1 and M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 1 or M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 0 or M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = M(Ψ), else 0 Comment: notice that I was a bit slopy here: missed the brackets ( )...

9 CA 208 Logic So how does this Tarski-style semantics work and how does it compare to the truth tables we have seen earlier on in the course? A valuation function V effectively defines/describes one row in a truth table Let V(A) = 1, V(B) = 0. What is M( (A  B)  B) )? 1. M( (A  B)  B) ) = 1 iff M( (A  B) ) = 1 and M( B ) = 1 2. M( (A  B) ) = 1 iff M( A ) = 1 or M( B ) = 1 3. M( A ) = V( A ) = 1, hence M( (A  B) ) = 1 4. M( B ) = V( B ) = 0, hence it is not the case that M( B ) = 1, hence it is not the case that M( (A  B)  B) ) = 1, hence M( (A  B)  B) ) = 0 Note that M is always relative to some particular V! If Φ  Π, then M(Φ) = V(Φ) (atomic formula) M(  Φ) = 1 iff M(Φ) = 0, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 1 and M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 1 or M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = 0 or M(Ψ) = 1, else 0 M(Φ  Ψ) = 1 iff M(Φ ) = M(Ψ), else 0

10 CA 208 Logic AB ABAB(A  B)  B A valuation function V effectively defines/describes one row in a truth table Let e.g. V(A) = 1, V(B) = 0. Under this V, what is M( (A  B)  B) )? M( (A  B)  B) ) = 0

11 CA 208 Logic So how does it all hang together? Truth tables, Tarski-style semantics, situations in which propositions are true...? We are talking semantics (meaning) As opposed to formal proof Truth tables, Tarski-style semantics, situations in which propositions are true... all define the meaning of the logical connectives { , , , ,  }, of the relational logical symbols { ,  } and the semantic consequence relation |= Truth tables, Tarski-style semantics, situations in which propositions are true... are alternative ways of doing the same thing Truth tables, Tarski-style semantics formalise (i.e. give a compact systematic account of) situations in which propositions are true. Truth tables, Tarski-style semantics allow us to give formal definitions of such notions as the logical connectives, tautologies, contradictions, contingencies, logical equivalence, logical consequence and the semantic consequence relation... all in terms of “meaning” And they allow us to do computation: e.g. check whether {P_1,..., P_n} |= C...

12 CA 208 Logic Some examples: A formula P is a tautology iff and only if it is true in all situations iff it comes out true (1) in all cases (rows) in the truth table iff for all valuations V, M(P) = 1 A formula P is a contradiction iff and only if it is false in all situations iff it comes out false (0) in all cases (rows) in the truth table iff for all valuations V, M(P) = 0 A formula P is a contingency iff... Two formulas P and Q are logically equivalent (P  Q ) iff they are true in all situations iff (P  Q) is a tautology iff (P  Q) comes out true (1) in all cases (rows) in the truth table iff for all valuations V, M(P  Q) = 1... the Boolean Equivalences.. and you can do computation... simplification/rewriting.... Q is a logical consequence of P (P  Q) iff in all situations where P is true, then Q is true as well, iff (P  Q) is a tautology iff (P  Q) comes out true (1) in all cases (rows) in the truth table iff for all valuations V, M(P  Q) = 1 C is a semantic consequence of premises P_1 to P_n ({P_1,..., P_n} |= C) iff in all situations where all of P_1 to P_n are true, then C is true as well iff (P_1 ...  P_n)  C iff (P_1 ...  P_n)  C is a tautology iff (P_1 ...  P_n)  C comes out true (1) in all cases (rows) in the truth table iff for all valuations V, M((P_1 ...  P_n)  C ) = 1 Allows us to do computation/inference: check whether {P_1,..., P_n} |= C...

13 CA 208 Logic This is all grand, but... there are some disadvantages to the semantic view of logic in terms of truth tables, Tarski-style semantics and the semantic consequence relation |= defined in terms of these Truth tables and Tarski-style valuations are exponential in size: 2ⁿ so for n distinct propositional variable (types) you have 2ⁿ rows in te truth table or valuations V. That’s not very efficient – in fact very expensive for large n... There is also a view that Logic is not really concerned with the meaning of individual propositions (e.g. in the premises) but it is more about the abstract structure of valid inferencing (irrespective of meaning): {P, Q} |= (P  Q) {P, P→Q} |= Q This leads to the syntactic (proof-theoretic) view of Logic with the syntactic consequence relation |- which is defined just in terms of symbol manipulation, without recourse to “meaning” (semantics). Logic as a calculus: Propositional Calculus, (First Order) Predicate Calculus... Of course, in the end |= and |- are just flip sides of each other (at least for the basic classical or “well behaved”logics), as we’ll see later on... This means that what you can do in the one |= you can do in the other |-, and vice versa (soundness and completeness)...