1 Propositional calculus versions. 2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Predicate Logic Colin Campbell. A Formal Language Predicate Logic provides a way to formalize natural language so that ambiguity is removed. Mathematical.
Completeness and Expressiveness
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Biointelligence Lab School of Computer Sci. & Eng.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
First Order Logic Resolution
Logic Use mathematical deduction to derive new knowledge.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
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.
Discrete Mathematics Lecture 2 Alexander Bukharovich New York University.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07
Binary Decision Diagrams for First Order Predicate Logic By: Jan Friso Groote Afsaneh Shirazi.
Predicates and Quantifiers
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.
1st-order Predicate Logic (FOL)
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Formal Semantics of Programming Languages 虞慧群 Topic 3: Principles of Induction.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
First Order Predicate Logic
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Propositional calculus
Bertram Ludäscher Department of Computer Science & Engineering University of California, San Diego CSE-291: Ontologies in Data Integration.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
CS6133 Software Specification and Verification
Automated reasoning with propositional and predicate logics Spring 2007, Juris Vīksna.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
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.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Predicate Calculus CS 270 Math Foundations of Computer Science Jeremy Johnson Presentation uses material from Huth and Ryan, Logic in Computer Science:
3. The Logic of Quantified Statements Summary
ece 627 intelligent web: ontology and beyond
Semantics In propositional logic, we associate atoms with propositions about the world. We specify the semantics of our logic, giving it a “meaning”. Such.
CS201: Data Structures and Discrete Mathematics I
CS 1502 Formal Methods in Computer Science
Logics for Data and Knowledge Representation
Logic Use mathematical deduction to derive new knowledge.
1st-order Predicate Logic (FOL)
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Logics for Data and Knowledge Representation
Search techniques.
Predicates and Quantifiers
Chapter 1: Propositional and First-Order Logic
Logics for Data and Knowledge Representation
CS201: Data Structures and Discrete Mathematics I
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
1st-order Predicate Logic (FOL)
Presentation transcript:

1 Propositional calculus versions

2 3-value (Lukasziewicz) logic Truth values T,F,N(unknown)

3 Fuzzy logic  Truth value is number from.  Logical couplings are analogical to set operations. p(¬A) = 1 - p(A) Standard fuzzy logic:  p(A ∧ B) = min(p(A), p(B))  p(A ∨ B) = max(p(A), p(B)) Stochastic fuzzy logic:  p(A ∧ B) = p(A) ⋅ p(B))  p(A ∨ B) = p(A) + p(B)) - p(A) ⋅ p(B) Lukasiewicz fuzzy logic:  p(A ∧ B) = min(1, p(A) + p(B))  p(A ∨ B) = max(0, p(A) + p(B) – 1)  Other fuzzy logical couplings are defined by the common Boolean algebra tautologies.

4 Example  „The young driver drives a speedy car. Then accident risic is big“  M: 19 y ≈ 0,9 25 y ≈ 0,5 40 y ≈ 0,1  A: Mercedes ≈ 0,9 Oktavia ≈ 0,5 Punto≈ 0,1

5 Intucionistic logics  Only such things that could be efectively constructed are true.  The inference rule  (  (A)) → A is not valid.

6 Predicate logic 1. order

7 Simple opinions for which PC is not enought All monkeys like bananas Judy is a monkey  Judy likes banana In P.C. that are atomic formulas p, q, r and from p, q does not imply r All students are clever Charles is not clever  Charles is not student What is the opinion scheme?

8 Opinion scheme Scheme is like in p.c.: p → q, p |= q or p→ q,  q |=  p In predicate calculus we can analyse this atomic formulas:  Each item, if it if a Moneky, then it likes Bananas  Judy is item with the property be Monkey   Judy is item with the property like bananas   x [M(x)→ B(x)], M(J) |= B(J), x is item variable, M, B predicate symbol, J funkction symbol

9 Formal language of predicate logic 1 Alphabet  Logical symbols Item variables: x, y, z,... Couplings symbols: , , , →,↔ Quatifier symbols: ,   Special symbols Predicate: P n, Q n,... n – ary Funkction: f n, g n, h n,...-- „ --  Extra symbols: (, ),...

10  terms: i. Each item symbol x, y,... Is a term ii. if t 1,…,t n (n  0) are terms and f n-ary function symbol, then f(t 1,…,t n ) is a term; if n = 0 it is a item constante (denote a, b, c, …) iii. Only expresions formed by i. or ii. Are terms Formal language of predicate logic 1 Gramatic

11  atomic formulas: If P is a n-ary predicate symbol and t 1,…,t n are terms, then P(t 1,…,t n ) is a atomic formula  formula: each atomic formula is a formula if A is formula, then  A is formula if A and B are formulas, then (A  B), (A  B), (A →B), (A ↔ B) are formulas if x is variable and A is formula, then  x A and  x A are formulas Formal language of predicate logic 1 Gramatic

12 Formal language 1. order  Only item variables can be used with a quatifier  It is not possible to quantify on properties or functions  Example: Leibniz equality definition. If two items have same propertioes then it is one and the same item  P [ P(x) = P(y)] → (x = y) language of 2nd order, quatification on properties

13 Example: formal arithmetic language  Special function symbols: 0-ary symbol: 0 unary symbol: s (successor) binary symbols: + and   Special predikate symbols: Equality of nubers: =  Examples of terms: 0, s(x), s(s(x)), (x + y)  s(s(0)), atd.  Examples of formulas s(0) = (0  x) + s(0)

14 Free and bound varialbles   x  y P(x, y, t)   x Q(y, x) bound, free free, bound Formula with clear variables: only free occurrences or only bounded occurrences when each quantifier has its special variables.   x  y P(x, y, t)   z Q(u, z)

15 Open, closed formulas  The formula with only bounded variables is called closed formula or sentence  The formula with at least one free occurrence of variable is called open formula.

16 PL1 semantic P(x) →  y Q(x, y) – is this formula true? Nonsence question, we dont know what symbols P, Q means. They are only symbols and we can substitute any predicate for them. P(x) → P(x) – is this formula true? YES

17 PL1 semantic  x P(x, f(x))  x P(x, f(x)) What are the variables. We must specify universe, any non empty set U 1) Symbol P; it is binary, has 2 arguments, its a symbol of some binary relation R  U  U 2) Symbol f ; it is unary, has 1 argument, it is symbol of some function F  U  U, note F: U  U

18 PL1 semantic A:  x P(x, f(x)) B:  x P(x, f(x)) 1) Let U = N (set of natural numbers) 2) Let P be relation < (set of all pair such that first member is crisply less then the second: {  0,1 ,  0,2 , …,  1,2 , …}) 3) Let f be a function of a square x 2, the set of all pairs such that socond member is a square of the first one: {  0,0 ,  1,1 ,  2,4 , …,  5,25 , …} Now we can evaluate the truth value of the formulas A and B.

19 PL1 semantic A:  x P(x, f(x)) B:  x P(x, f(x)) Evaluantion „from inside“: We evaluate the term f(x). Each term describes an element of the universe. Which? It depands on the evaluation of the variable x. Let e(x) = 0 then f(x) = x 2 = 0. e(x) = 1, then f(x) = x 2 = 1, e(x) = 2, then f(x) = x 2 = 4, etc. Now by evaluation of P(x, f(x)) we obtain a truth value: e(x) = 0, 0 is not < 0 false e(x) = 1, 1 is not < 1 false, e(x) = 2, 2 is < 4 true

20 PL1 semantic A:  x P(x, f(x)) B:  x P(x, f(x)) Formula P(x, f(x)) is true for several evaluations e of the variable x in this interpretation and it if false for several other evaluations The meaning  x (  x): the formula must be true for all (for several) evaluation of x Formula A: False in our interpretation I: |  I A Formula B: True in our interpretation I: |= I B

21 Interpretation  Formaly the interpretation is a pair (U, I), where U is an non empty set called universe, I is a mapping such that: Each constnte is mapped on a member of the universe. Each n-nary function symbol is mapped on a function of n variables of the universe with the resulting values from the universe Each n-nary predicate symbol is mapped on the n-nary relation on the universe.

22 Satisfiability of formulas, model  The formula A is satisfiable in the interpretation I, iff there exist at least one evaluation of the free variables such that the resultiong proposition is true.  Formula A is true in the interpretation I, iff for all possible evaluation e of the free variables the resulting proposition is true.  The formule A is satisfiable, iff there exist an interpretation I, in which the formula A is satisfiable. Such interpretation is called model of the formula A. Formule A je tautologií je-li pravdivá v každé interpretaci.  The formule A is contradiction, iff it has no model, there dont exist any interpretation in which the formula A is satisfiable.

23 Semantic deduction  The closed formula (sentence) ϕ is a semantic (tautological) consequence of the set of closed formulas S, iff each model of S is also model of ϕ.  Usually this is hard to test.

Predikátová logika24 Predicate logic syntax

25 Completness of the predicate logic  For the predicate logic of 1st order the sentence of completness holds.  The natural deduction is non-contradictary (everything what can be proved is true).  The natural deduction is also complete (everything what is true can be proved)  The proof of the completness sentence is not easy.  It cannot be fomed an non-contradictary and complete deductive systém for predicate logics of 2nd and higher orders.

Propositional vers. Predicate calculus  Each language of redicate logic has infinite amount of interpretations (only the universe has infinite amount of variantes). Taht is a difference against propositional calculus in which the number of interpretation was finite (the language of propositional calculus with n variables has 2 n interpretations thus it is possible trough were complex in the time to evaluate truthness of all interpretations.  The syntactic approach is the only possibility in evaluating formulas of predicate logic.

Resolution principe in predicate logic  We want to check whether the clause ϕ is a consequence (logical and thus also sematic) of the clase set S. We form a set S’ = S ∪ {¬ ϕ } and chech whether it is satisfiable or no. If S’ is satisfiable then ϕ is not a consequence of S. If S’ is unsatisfiable ϕ is a consequence of S.  The formulas of the set S and the formula ¬ ϕ we transform in a set of clauses.

Transformation into a set of clauses  Renaming of the variables so each quantifier have its qwn variables. ∀ x P(x) ∨ ∀ x Q(x, a) transform into ∀ x ∀ y P(x) ∨ Q(x, a).  Couplings ⇒, ⇔ express only by ¬, ∨, ∧ α ⇒ β ≡ ¬α ∨ β; α ⇔ β ≡ (¬α ∨ β) ∧ ( α ∨ ¬β); ….  Move negation ¬ inside before the atomic formulas by tautological transormations ¬ ∃ x α ≡ ∀ x ¬α; ¬ ∀ x α ≡ ∃ x ¬α ; ¬(α ∨ β) ≡¬α ∧ ¬β; ¬(α ∧ β) ≡¬α ∨ ¬β; ¬¬α ≡ α.  Move disjunctions ∨ co inside by using transformations α ∨ (β ∧ γ) ≡ (α ∨ β) ∧ (α ∨ γ); α ∨ ( ∀ x β) ≡ ∀ x (α ∨ β); α ∨ ( ∃ x β) ≡ ∃ x (α ∨ β).  Move universal quantifiers outside by transformation ( ∀ x α) ∧ ( ∀ x β) ≡ ∀ x (α ∧ β).

Skolemisation  After Norwegian mathematic Thorlaf Skolem ( )  We replace formula ∃ x P(x) by formula P(a), where a s a constante.  ∀ x1, …, ∀ xn ∃ y ϕ (y, x1, …,xn) we transform into ∀ x1, …, ∀ xn ϕ (f(x1, …,xn), x1, …,xn), where f is a new function symbol of arity n. For n = 0 we use a constante symbol.

Resolution principe in predicate logic  In a set of clauses we search for a complementary literal pairs  If neccessary we can make a substitution: Resolventa of the clauses {P(x, y, z), ¬Q(x, y)} and {¬P(a, b, z), ¬R(a)} by a substitution x/a, y/b is {¬Q(a, b), ¬R(a)}.

 If we derive an empty clause the original set S ∪ {¬ ϕ } was unsatifiable and ϕ is a syntactic (and semantic) consequence of S.  If the deriving of resolventas stops and the empty clause was not derived the set of formulas S ∪ {¬ ϕ } is satisfiable and ϕ is not a syntactic (nor semantic) consequence of S.  If the deriving does not stop we do not know. Resolution principe in predicate logic

Example  All barbers on the island shaves everyone who does not that himself.  No barber on the island shaves anyone who does that himself.  Consequence: There are no barbers on the island.

Example  Universe: All people on the island.  B(x) – unary predicate: „the man is a barber“.  S(x, y) – binary predicate “the man x shaves the man y”.  Assumptions: ∀ x (B(x) ⇒ ∀ y (¬S(y, y) ⇒ S(x, y)) ∀ x (B(x) ⇒ ∀ y (S(y, y) ⇒ ¬S(x, y))  Consequence: ¬ ∃ x B(x).

Example  We need to check whether the following set of formulas is unsatisfiable { ∀ x (B(x) ⇒ ∀ y (¬S(y, y) ⇒ S(x, y)), ∀ x (B(x) ⇒ ∀ y (S(y, y) ⇒ ¬S(x, y)), ∃ x B(x)}.

Example  Transforming of the 1st assumption into clauses: ∀ x (B(x) ⇒ ∀ y (¬S(y, y) ⇒ S(x, y)) ≡ ∀ x (¬B(x) ∨ ∀ y ((S(y, y) ∨ S(x, y))) ≡ ∀ x ∀ y(¬B(x) ∨ S(y, y) ∨ S(x, y)) ;  Transforming of the 2nd assumption into clauses: ∀ x (B(x) ⇒ ∀ y (S(y, y) ⇒ ¬S(x, y)) ≡ ∀ z (¬B(z) ⇒ ∀ u (¬S(u, u) ∨ ¬S(z, u)) ≡ ∀ z ∀ u (¬B(z) ∨ ¬S(u, u) ∨ ¬S(z, u)).  Skolemisation of the consequence B(a)  We need to check unsatisfiability of the cleuses set S ∪ {¬ ϕ } = {{¬B(x), S(y, y), S(x, y)}, {¬B(z), ¬S(u, u), ¬S(z, u}, (B(a)}}

Example Our deduction was good