Logics for Data and Knowledge Representation

Slides:



Advertisements
Similar presentations
LDK R Logics for Data and Knowledge Representation Exercises: First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified.
Advertisements

L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Knowledge Representation Methods
Logics for Data and Knowledge Representation Modeling Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
Review Test 5 You need to know: How to symbolize sentences that include quantifiers of overlapping scope Definitions: Quantificational truth, falsity and.
INTRODUCTION TO LOGIC FALL 2009 Quiz Game. ConceptsTrue/FalseTranslations Informal Proofs Formal Proofs
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
Variables Tutorial 3c variable A variable is any symbol that can be replaced with a number to solve a math problem. An open sentence has at least one.
Logics for Data and Knowledge Representation Exercises: Modeling Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
1.4 Solving Equations ●A variable is a letter which represents an unknown number. Any letter can be used as a variable. ●An algebraic expression contains.
LDK R Logics for Data and Knowledge Representation ClassL (part 3): Reasoning with an ABox 1.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
LDK R Logics for Data and Knowledge Representation Query languages Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Reasoning using First-Order Logic
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Logics for Data and Knowledge Representation Exercises: DL.
Mathematical Logics Course introduction. Forehead  Lecturers: Fausto Giunchiglia, Vincenzo Maltese  Scheduling: Tuesday 8:30-10:30, room A107 Thursday.
LDK R Logics for Data and Knowledge Representation Modal Logic: exercises Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
LDK R Logics for Data and Knowledge Representation Modal Logic: exercises Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Exercises: First Order Logics (FOL)
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
CS203 Discrete Mathematical Structures
Semantics In propositional logic, we associate atoms with propositions about the world. We specify the semantics of our logic, giving it a “meaning”. Such.
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
CS201: Data Structures and Discrete Mathematics I
Logics for Data and Knowledge Representation
Propositional Logic: exercises
Logics for Data and Knowledge Representation
Jeopardy
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
2 Identities and Factorization
Mathematical Logics Course introduction 1.
Logics for Data and Knowledge Representation
Introduction to Predicates and Quantified Statements I
Matrices.
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Chapter 1: Propositional and First-Order Logic
Logics for Data and Knowledge Representation
CS201: Data Structures and Discrete Mathematics I
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Presentation transcript:

Logics for Data and Knowledge Representation Exercises: First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese

Outline Introduction Syntax Semantics Reasoning Services Changed 2

Example of what we can express in FOL INTRODUCTION :: SYNTAX :: SEMANTICS :: REASONING SERVICES constants Cita Monkey predicates relations Eats Hunts Kimba Simba Lion Near 3

Write in FOL the following NL sentences “Fausto is a Professor” Professor(fausto) “There is a monkey” ∃x Monkey(x) “There exists a dog which is black” ∃x (Dog(x)  Black(x)) “All persons have a name” ∀x (Person(x) → ∃y Name(x, y))

Write in FOL the following NL sentences “The sum of two odd numbers is even” ∀x ∀y ( Odd(x)  Odd(y) → Even(Sum(x,y)) ) “A father is a male person having at least one child” ∀x ( Father(x) → Person(x)  Male(x)  ∃y hasChilden(x, y) ) “There is exactly one dog” ∃x Dog(x)  ∀x ∀y ( Dog(x)  Dog(y) → x = y ) “There are at least two dogs” ∃x ∃y ( Dog(x)  Dog(y)  (x = y) ) 5

The use of FOL in mathematics Express in FOL the fact that every natural number x multiplied by 1 returns x (identity): ∀x ( Natural(x)  (Mult(x, 1) = x) ) Express in FOL the fact that the multiplication of two natural numbers is commutative: ∀x ∀y ( Natural(x)  Natural(y)  (Mult(x, y) = Mult(y, x)) ) 6

Express the following problem in FOL “There are 3 blocks A, B, C in a stack. Each block can be either black or white. We know that the block A is on the bottom. A block is on the top if there are no blocks above it. It is possible to be on top if and only if the block is black”. C B A Constants = {a, b, c} Predicates = {Black, White, Top} Relations = {Above} γ1 : ∃x Above(a,x) γ2 : Top(y)  Black(y)  ∃z Above(z,y) 7

Satisfiability of the problem of blocks Constants = {a, b, c} Predicates = {Black, White, Top} Relations = {Above} γ1 : ∃x Above(a,x) γ2 : Top(y)  Black(y)  ∃z Above(z,y) Is Γ = {γ1, γ2} satisfiable? Is there any structure M = <D,I> and an assignment a such that M ⊨ γ1 [a] and M ⊨ γ2 [a]? D = {A, B, C} I(a) = A I(b) = B I(c) = C I(Black) = {A, C} I(White) = {B} I(Top) = {C} I(Above) = {<B,A>, <C,B>} Ia(y) = a(y) = C NOTE: we can assign a different color to A and B. y is free. C B A 8

Entailment Let be  a set of FO- formulas, γ a FO- formula, we say that  ⊨ γ (to be read  entails γ) iff for all the structures M and assignments a, if M ⊨  [a] then M ⊨ γ [a]. 9

Entailment Given: α : ∀x ∀y ∃z (p(x, y) → (p(x, z)  p(z, y))) β : ∀x ∀y (p(x, y)→ ∃z (p(x, z)  p(z, y))) Does α ⊨ β? Yes, because in α we can put ∃z inside: ∀x ∀y (∃z p(x, y) → ∃z (p(x, z)  p(z, y))) z is not in the scope of ∃z p(x, y) and therefore we obtain β 10

Entailment For all formulas of the form p(x, y): 1. Is ∃x∃y p(x, y) ⊨ ∃y∃x p(x, y)? 2. Is ∃x∀y p(x, y) ⊨ ∀y∃x p(x, y)? 3. Is ∀x∃y p(x, y) ⊨ ∃y∀x p(x, y)? If no provide a counterexample. Assume p(x, y) is x  y. (1) Yes. The two formulas both says that there are at least two objects which are related via p. (2) Yes. The first formula says that there is an x such that for all y we have x  y. We can take x = 0. The second formula says that for all y there exist an x such that x  y. x = 0 is fine again. (3) In this case is No. The first formula says that for all x there exist a y such that x  y. We can take y = Succ(x). The second formula says that there exists a y such that for all x we have x  y. We should take y = +. 11

Validity Is it possible to prove that: ⊨ ∀x (Person(x)  Male(x)) [a] where D = {a, b, c} We have only 3 possible assignments a(x) = a, a(x) = b, a(x) = c We can translate it as follows: P: (Person(a)  Male(a))  (Person(b)  Male(b))  (Person(c)  Male(c)) P: (Person(a)  Male(a))  (Person(b)  Male(b))  (Person(c)  Male(c)) P: (Person-a  Male-a)  (Person-b  Male-b)  (Person-c  Male-c) We check that DPLL(P) returns false. 12