SlideShare a Scribd company logo
Artificial Intelligence




                                                   Artificial Intelligence

                                                   5. First-Order Logic



                                                        Lars Schmidt-Thieme



                              Information Systems and Machine Learning Lab (ISMLL)
                                   Institute of Economics and Information Systems
                                            & Institute of Computer Science
                                                 University of Hildesheim
                                           http://www.ismll.uni-hildesheim.de

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              1/19

Artificial Intelligence




                            1. Introduction

                            2. Syntax

                            3. Semantics

                            4. Example

                            5. Conclusion




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              1/19
Artificial Intelligence / 1. Introduction
                                                  What is first-order logic?



             Think about expressing these phrases in propositional logic:
                  A := “Socrates is human.”
                  B := “All humans are mortal.”
                  C := “Thus, Socrates is mortal.”
             How can we see that A, B, C are related?

             First-order logic is richer than propositional logic:
                  H(a)
                  ∀xH(x) → M (x)
                  M (a)
             where a stands for “Socrates”, H for “is human”, and M for “is
             mortal”.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              1/19

Artificial Intelligence / 1. Introduction
                                                  What is first-order logic?

                  H(a)
                  ∀xH(x) → M (x)
                  M (a)

             So what do we have here?

               – x is a variable. Variables denote arbitrary elements (objects) of
                 an underlying set.
               – a is a constant. Constants denote specific elements of an
                 underlying set.
               – H and M are unary relations.
               – ∀ is the all quantifier. It is read “for all”.
               – We can also use the connectives we already know from
                 propositional logic.
             In first-order logic, there are also relations with other arities, as
             well as n-ary functions. In addition to the all quantifier, there is
             the existential quantifier, read “there exists”.
Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              2/19
Artificial Intelligence




                            1. Introduction

                            2. Syntax

                            3. Semantics

                            4. Example

                            5. Conclusion




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              3/19

Artificial Intelligence / 2. Syntax
                                                         Syntax: Symbols




               – Let {f, g, h, . . . , f1, f2, . . . } be the set of function symbols.
                 Every function symbol has a given arity. Sometimes we write
                 f n to denote that f has arity n.
               – Let {a, b, c, . . . , a1, a2, . . . } be the set of constant symbols.
                 Constant symbols can be seen as 0-ary function symbols.
               – {P, R, S, . . . , P1, P2, . . . } be the set of relation symbols. Every
                 relation symbol (predicate) has a given arity. Sometimes we
                 write P n to denote that P has arity n.
               – {x, y, z, x1, x2, . . . } be the set of variable symbols.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              3/19
Artificial Intelligence / 2. Syntax
                                                           Syntax: Terms


             A term is a logical expression that refers to an object.

             (T1) Every variable or constant symbol is a term.
             (T2) If f is an n-ary function symbol and t1, . . . , tn are terms, then
                f (t1, . . . , tn) is also a term.


             Examples:                                                   More meaningful names for the
                                                                         symbols:
               – a is a term, b as well.
               – f (a) is a term if f is unary.                            – aristotle, socrates, kallias
               – f 3(a, x) is not a term.                                  – succ(root)
                                                                           – Likes(zeno, hockey),
               – P (x) and P (x) ∨ Q(x) are not
                                                                             Likes(stef f en, soccer) ∧
                 terms.
                                                                             Likes(stef f en, hockey)
               – f 1(f (f (a))) is a term.
                                                                           – succ(succ(succ(0)))


Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              4/19

Artificial Intelligence / 2. Syntax
                                                        Syntax: Formulas

             An atomic formula has the form t1 = t2 or R(t1, . . . tn) is an n-ary
             relation symbol and t1, . . . , tn are terms.

             (F0) Every atomic formula is a formula.
             (F1) If φ is a formula then so is (¬φ).
             (F2) If φ and ψ are formulas then so is (φ ∧ ψ).
             (F3) If φ is a formula, then so is (∃xφ) for any variable x.
             We define ∨, →, and ↔ the same way as in propositional logic.
             For any formula φ, (∀xφ) and (¬∃x¬φ) are interchangeable.
             Unnecessary brackets can be left out as in propositional logic.
             Precedence: ¬, ∃, ∀, ∧, ∨, →, ↔

             Examples:

               – P (x) and P (x) ∨ Q(x) are formulas if P and Q are unary.
               – succ(succ(succ(0))) = 3 is a formula.
               – ∀yP (x, y) is a formula and x(P (z)∃) is not.
Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              5/19
Artificial Intelligence / 2. Syntax
                                                     Syntax: Subformulas

             Let φ be a formula of first-order logic. We inductively define what it
             means for θ to be a subformula of φ as follows:

               – If φ is atomic, then θ is a subformula of φ if and only if θ = φ.
               – If φ has the form ¬ψ, then θ is a subformula of φ if and only if
                 θ = φ or θ is a subformula of ψ.
               – If φ has the form ψ1 ∧ ψ2, then θ is a subformula of φ if and only
                 if θ = φ or θ is a subformula of ψ1, or θ is a subformula of ψ2.
               – If φ has the form ∃xψ, then θ is a subformula of φ if and only if
                 θ = φ or θ is a subformula of ψ.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              6/19

Artificial Intelligence / 2. Syntax
                                                    Syntax: Free variables

             The free variables of a formula are those variables occurring in it
             that are not quantified.
             Example: In ∀yR(x, y), x is free, but y is bound by ∀y.
             For any first-order formula φ, let f ree(φ) denote the set of free
             variables of φ. We define f ree(φ) inductively as follows:

               – If φ is atomic, then f ree(φ) is the set of all variables occurring in
                 φ,
               – if φ = ¬ψ, then f ree(φ) = f ree(ψ),
               – if φ = ψ ∧ θ, then f ree(φ) = f ree(ψ) ∪ f ree(θ), and
               – if φ = ∃xψ, then f ree(φ) = f ree(ψ) − {x}.
             How would you define the set of bound variables of φ, bnd(φ)?

             A sentence of first-order logic is a formula having no free
             variables.



Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              7/19
Artificial Intelligence




                            1. Introduction

                            2. Syntax

                            3. Semantics

                            4. Example

                            5. Conclusion




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              8/19

Artificial Intelligence / 3. Semantics
                       Semantics: Vocabularies, structures and interpretations

             A vocabulary is a set of function, relation, and constant symbols.
             Let V be a vocabulary. A V-structure M = (U, I) consists of a
             nonempty underlying set U (the universe) along with an
             interpretation I of V. An interpretation I of V assigns:

               – an element of U to each constant symbol in V,
               – a function from U n to U to each n-ary function in V, and
               – a subset of U n to each n-ary relation in V.

             Examples:

               – V = {f 1, R2, c}, Z = (Z, IZ)
                 The universe is the set of integers Z.
                 IZ could interpret f (x) as x2, R(x, y) as x < y, and c as 3.
               – V = {f 1, R2, c}, N = (N, IN)
                 The universe is the set of natural numbers N.
                 IN could interpret f (x) as x + 1, R(x, y) as x < y, and c as 0.

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              8/19
Artificial Intelligence / 3. Semantics
                                    Semantics: V-formulas and V-sentences




             Let V be a vocabulary. A V-formula is formula in which every
             function, relation, and constant symbol is in V. A V-sentence is a
             V-formula that is a sentence.

             If M is a V-structure, then each V-sentence φ is either true or false
             in M. If φ is true in M, then we say M models φ and write M |= φ.

             Example: Var = {+, ·, 0, 1} is the vocabulary of arithmetic. Then
             R = (R, IR) is an Var -structure if IR is a interpretation of Var .
             R |= ∀x∃y(1 + x · x = y)
             What about ∀y∃x(1 + x · x = y)?




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                               9/19

Artificial Intelligence / 3. Semantics
                                             Semantics: The value of terms


             We define the value VM (t) ∈ U of a term t inductively as

               – VM (t) = IM (t), if t is a constant symbol, and
               – VM (t) = IM (f )(VM (t1), . . . , VM (tn)), if t = f n(t1, . . . , tn).

             Example: V = {f 1, R2, c}, N = (N, IN), interpretation IN as before
             What is the value of the term t = f (f (c))?

                                          VN(f (f (c))) = IN(f )(VN(f (c)))
                                                                = IN(f )(IN(f )(VN(c)))
                                                                = IN(f )(IN(f )(IN(c)))
                                                                = IN(f )(IN(f )(0))
                                                                = IN(f )(1)
                                                                =2


Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              10/19
Artificial Intelligence / 3. Semantics
                     Semantics: Vocabulary/structure expansions and reducts



             An expansion of a vocabulary V is a vocabulary containing V as a
             subset.
             A structure M is an expansion of the V-structure M if M has the
             same universe and interprets the symbols of V in the same way
             as M .
             If M is an expansion of M , then we say that M is a reduct of M .

             Examples:
             The {+, −, ·, <, 0, 1}-structure M = (R, I ) is an expansion of the
             Var -structure M = (R, I) if both I and I interpret the symbols
             +, ·, 0, and 1 in the usual way.
             A {+, −, ·, <, 0, 1}-structure M = (Q, I ) cannot be an expansion
             of M .
             Any structure is an expansion of itself.



Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              11/19

Artificial Intelligence / 3. Semantics
                                          Semantics: The value of formulas




             We define M |= φ by induction:

               –M       |= t1 = t2 if and only if V (t1) = V (t2),
               –M       |= Rn(t1, . . . , tn) iff. (VM (t1), . . . , VM (tn)) ∈ IM (Rn),
               –M       |= ¬φ iff. M does not model φ,
               –M       |= φ1 ∧ φ2 iff. both M |= φ1 and M |= φ2, and
               –M       |= ∃xφ(x) iff. MC |= φ(c) for some constant c ∈ V(M ) .

             V(M ) = V ∪ {cm|m ∈ UM }
             MC = (UM , IC ) is the expansion of M = (UM , I) to a
             V(M )-structure where IC interprets each cm as the element m.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              12/19
Artificial Intelligence




                            1. Introduction

                            2. Syntax

                            3. Semantics

                            4. Example

                            5. Conclusion




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              13/19

Artificial Intelligence / 4. Example
                                                 Back to the Silly Example
              Toy example by Gregory Yob (1975), adapted by our textbook.

                – 4 × 4 grid, tiles numbered (1,1) to (4,4),
                – the agent starts in (1,1),
                – the beast Wumpus sits at a random tile, unknown to the agent,
                – a pile of gold sits at another random tile, unknown to the agent,
                – some pits are located at random tiles, unknown to the agent.

                – if the agent enters the tile of the Wumpus, he will be eaten,
                – if the agent enters a pit, he will be trapped,

                                                                             Bree z e   PIT
                                                 4      Stench



                                                                  Bree z e

                                                 3                Stench     PIT        Bree z e

                                                                  Gold


                                                                             Bree z e
                                                 2      Stench




                                                                 Bree z e               Bree z e
                                                 1                           PIT
                                                        START

                                                          1         2           3         4

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              13/19
Artificial Intelligence / 4. Example
                                             Encoding in propositional logic

              64 variables:
              Px,y tile x, y contains a pit (x, y = 1, . . . , 4).
              Wx,y tile x, y contains the Wumpus (x, y = 1, . . . , 4).
              Bx,y tile x, y contains a breeze (x, y = 1, . . . , 4).
              Sx,y tile x, y contains stench (x, y = 1, . . . , 4).

              start is save: (2 formulas)
                                                              ¬P1,1,         ¬W1,1
              how breeze arises: (16 formulas)
                           Bx,y ↔ Px−1,y ∨ Px+1,y ∨ Px,y−1 ∨ Px,y+1,                               x, y = 1, . . . , 4
              how stench arises: (16 formulas)
                         Sx,y ↔ Wx−1,y ∨ Wx+1,y ∨ Wx,y−1 ∨ Wx,y+1,                                   x, y = 1, . . . , 4
              there is exactly one Wumpus: (121 formulas)
                            W1,1 ∨ W1,2 ∨ . . . ∨ W4,4
                            ¬Wx,y ∨ ¬Wx ,y , x, y, x , y = 1, . . . , 4, x = x or y = y
Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                                         14/19

Artificial Intelligence / 4. Example
                                                Encoding in first logic (1/2)




              Vocabulary:

                – constants 1, 2, 3, 4
                – binary relations symbols P, W, B, S

              Meaning of the predicates:
              P (x, y) tile x, y contains a pit.
              W (x, y) tile x, y contains the Wumpus.
              B(x, y) tile x, y contains a breeze.
              S(x, y) tile x, y contains stench.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                                         15/19
Artificial Intelligence / 4. Example
                                                Encoding in first logic (2/2)




              start is save:
                                                          ¬P (1, 1) ∧ ¬W (1, 1)
              how breeze arises:
                   ∀x∀yB(x, y) ↔ P (x − 1, y) ∨ P (x + 1, y) ∨ P (x, y − 1) ∨ P (x, y + 1)
              there is exactly one Wumpus:
                                   W (x, y) → ∀x ∀y W (x , y ) → (x = x ∧ y = y )


              Further possibilities: Encode actions as functions, encode time
              steps.




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              16/19

Artificial Intelligence




                            1. Introduction

                            2. Syntax

                            3. Semantics

                            4. Example

                            5. Conclusion




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              17/19
Artificial Intelligence / 5. Conclusion
                                                                Summary


             We introduced first-order logic, a representation language far
             more powerful than propositional logic.

               – Knowledge representation should be declarative,
                 compositional, expressive, context-independent, and
                 unambiguous.
               – Constant symbols name objects, relation symbols
                 (predicates) name properties and relations, and function
                 symbols name functions. Complex terms apply function
                 symbols to terms to name an object.
               – Given a V-structure, the truth of a formula is determined.
               – An atomic formula consists of a relation symbol applied to one
                 or more terms; it is true iff. the relation named by the predicate
                 holds between the objects named by the terms. Complex
                 formulas use connectives just like propositional logic.
                 Quantifiers allow the expression of general rules.


Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              17/19

Artificial Intelligence / 5. Conclusion
                                                                 Outlook




             Next lesson: Inference in first-order predicate logic.

             Which other kind of logics exist?

               – Temporal logic: Gφ → Xφ
               – Description logic: C ⊆ D
               – Modal logic: p →         p
               – Higher-order predicate logic: ∀P ∀x∀yP (x, y) ∧ P (y, x) → S(P )
               – Typed/intuitionistic/default/relevance logics
               – ...
             (not covered in this course)




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              18/19
Artificial Intelligence / 5. Conclusion
                                                                Literature




               – Shawn Hedman: A First Course in Logic
               – Heinz-Dieter Ebbinghaus, Jörg Flum, Wolfgang Thomas:
                 Einführung in die mathematische Logik
               – Uwe Schöning: Logik für Informatiker
               – Stuart Russell, Peter Norvig: Artificial Intelligence. A Modern
                 Approach




Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany,
Course on Artificial Intelligence, summer term 2008                                                              19/19

More Related Content

What's hot

Non Standard Logics & Modal Logics
Non Standard Logics & Modal LogicsNon Standard Logics & Modal Logics
Non Standard Logics & Modal Logics
Serge Garlatti
 
A Constructive Mathematics approach for NL formal grammars
A Constructive Mathematics approach for NL formal grammarsA Constructive Mathematics approach for NL formal grammars
A Constructive Mathematics approach for NL formal grammars
Federico Gobbo
 
A course on mathematical logic
A course on mathematical logicA course on mathematical logic
A course on mathematical logic
Springer
 
Parsing techniques
Parsing techniquesParsing techniques
Parsing techniques
Latchezar Tzvetkoff
 
An Approach to Automated Learning of Conceptual Graphs from Text
An Approach to Automated Learning of Conceptual Graphs from TextAn Approach to Automated Learning of Conceptual Graphs from Text
An Approach to Automated Learning of Conceptual Graphs from Text
Fulvio Rotella
 
Supermathematics and Artificial General Intelligence
Supermathematics and Artificial General IntelligenceSupermathematics and Artificial General Intelligence
Supermathematics and Artificial General Intelligence
Jordan Bennett
 
Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
Marco Benini
 
Negation in the Ecumenical System
Negation in the Ecumenical SystemNegation in the Ecumenical System
Negation in the Ecumenical System
Valeria de Paiva
 
Dialectica amongst friends
Dialectica amongst friendsDialectica amongst friends
Dialectica amongst friends
Valeria de Paiva
 
Presentation Euralex
Presentation EuralexPresentation Euralex
Presentation Euralex
Patrícia Cunha França
 
smtlectures.1
smtlectures.1smtlectures.1
smtlectures.1
Roberto Bruttomesso
 
Lecture 2: From Semantics To Semantic-Oriented Applications
Lecture 2: From Semantics To Semantic-Oriented ApplicationsLecture 2: From Semantics To Semantic-Oriented Applications
Lecture 2: From Semantics To Semantic-Oriented Applications
Marina Santini
 
The logic(s) of informal proofs (vub)
The logic(s) of informal proofs (vub)The logic(s) of informal proofs (vub)
The logic(s) of informal proofs (vub)
Brendan Larvor
 
50120140502014
5012014050201450120140502014
50120140502014
IAEME Publication
 
05 pml
05 pml05 pml
05 pml
Hanibei
 

What's hot (15)

Non Standard Logics & Modal Logics
Non Standard Logics & Modal LogicsNon Standard Logics & Modal Logics
Non Standard Logics & Modal Logics
 
A Constructive Mathematics approach for NL formal grammars
A Constructive Mathematics approach for NL formal grammarsA Constructive Mathematics approach for NL formal grammars
A Constructive Mathematics approach for NL formal grammars
 
A course on mathematical logic
A course on mathematical logicA course on mathematical logic
A course on mathematical logic
 
Parsing techniques
Parsing techniquesParsing techniques
Parsing techniques
 
An Approach to Automated Learning of Conceptual Graphs from Text
An Approach to Automated Learning of Conceptual Graphs from TextAn Approach to Automated Learning of Conceptual Graphs from Text
An Approach to Automated Learning of Conceptual Graphs from Text
 
Supermathematics and Artificial General Intelligence
Supermathematics and Artificial General IntelligenceSupermathematics and Artificial General Intelligence
Supermathematics and Artificial General Intelligence
 
Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
 
Negation in the Ecumenical System
Negation in the Ecumenical SystemNegation in the Ecumenical System
Negation in the Ecumenical System
 
Dialectica amongst friends
Dialectica amongst friendsDialectica amongst friends
Dialectica amongst friends
 
Presentation Euralex
Presentation EuralexPresentation Euralex
Presentation Euralex
 
smtlectures.1
smtlectures.1smtlectures.1
smtlectures.1
 
Lecture 2: From Semantics To Semantic-Oriented Applications
Lecture 2: From Semantics To Semantic-Oriented ApplicationsLecture 2: From Semantics To Semantic-Oriented Applications
Lecture 2: From Semantics To Semantic-Oriented Applications
 
The logic(s) of informal proofs (vub)
The logic(s) of informal proofs (vub)The logic(s) of informal proofs (vub)
The logic(s) of informal proofs (vub)
 
50120140502014
5012014050201450120140502014
50120140502014
 
05 pml
05 pml05 pml
05 pml
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
andagarcia212
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
shreyassri1208
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 

Ai 2up-05-fol

  • 1. Artificial Intelligence Artificial Intelligence 5. First-Order Logic Lars Schmidt-Thieme Information Systems and Machine Learning Lab (ISMLL) Institute of Economics and Information Systems & Institute of Computer Science University of Hildesheim http://www.ismll.uni-hildesheim.de Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 1/19 Artificial Intelligence 1. Introduction 2. Syntax 3. Semantics 4. Example 5. Conclusion Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 1/19
  • 2. Artificial Intelligence / 1. Introduction What is first-order logic? Think about expressing these phrases in propositional logic: A := “Socrates is human.” B := “All humans are mortal.” C := “Thus, Socrates is mortal.” How can we see that A, B, C are related? First-order logic is richer than propositional logic: H(a) ∀xH(x) → M (x) M (a) where a stands for “Socrates”, H for “is human”, and M for “is mortal”. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 1/19 Artificial Intelligence / 1. Introduction What is first-order logic? H(a) ∀xH(x) → M (x) M (a) So what do we have here? – x is a variable. Variables denote arbitrary elements (objects) of an underlying set. – a is a constant. Constants denote specific elements of an underlying set. – H and M are unary relations. – ∀ is the all quantifier. It is read “for all”. – We can also use the connectives we already know from propositional logic. In first-order logic, there are also relations with other arities, as well as n-ary functions. In addition to the all quantifier, there is the existential quantifier, read “there exists”. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 2/19
  • 3. Artificial Intelligence 1. Introduction 2. Syntax 3. Semantics 4. Example 5. Conclusion Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 3/19 Artificial Intelligence / 2. Syntax Syntax: Symbols – Let {f, g, h, . . . , f1, f2, . . . } be the set of function symbols. Every function symbol has a given arity. Sometimes we write f n to denote that f has arity n. – Let {a, b, c, . . . , a1, a2, . . . } be the set of constant symbols. Constant symbols can be seen as 0-ary function symbols. – {P, R, S, . . . , P1, P2, . . . } be the set of relation symbols. Every relation symbol (predicate) has a given arity. Sometimes we write P n to denote that P has arity n. – {x, y, z, x1, x2, . . . } be the set of variable symbols. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 3/19
  • 4. Artificial Intelligence / 2. Syntax Syntax: Terms A term is a logical expression that refers to an object. (T1) Every variable or constant symbol is a term. (T2) If f is an n-ary function symbol and t1, . . . , tn are terms, then f (t1, . . . , tn) is also a term. Examples: More meaningful names for the symbols: – a is a term, b as well. – f (a) is a term if f is unary. – aristotle, socrates, kallias – f 3(a, x) is not a term. – succ(root) – Likes(zeno, hockey), – P (x) and P (x) ∨ Q(x) are not Likes(stef f en, soccer) ∧ terms. Likes(stef f en, hockey) – f 1(f (f (a))) is a term. – succ(succ(succ(0))) Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 4/19 Artificial Intelligence / 2. Syntax Syntax: Formulas An atomic formula has the form t1 = t2 or R(t1, . . . tn) is an n-ary relation symbol and t1, . . . , tn are terms. (F0) Every atomic formula is a formula. (F1) If φ is a formula then so is (¬φ). (F2) If φ and ψ are formulas then so is (φ ∧ ψ). (F3) If φ is a formula, then so is (∃xφ) for any variable x. We define ∨, →, and ↔ the same way as in propositional logic. For any formula φ, (∀xφ) and (¬∃x¬φ) are interchangeable. Unnecessary brackets can be left out as in propositional logic. Precedence: ¬, ∃, ∀, ∧, ∨, →, ↔ Examples: – P (x) and P (x) ∨ Q(x) are formulas if P and Q are unary. – succ(succ(succ(0))) = 3 is a formula. – ∀yP (x, y) is a formula and x(P (z)∃) is not. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 5/19
  • 5. Artificial Intelligence / 2. Syntax Syntax: Subformulas Let φ be a formula of first-order logic. We inductively define what it means for θ to be a subformula of φ as follows: – If φ is atomic, then θ is a subformula of φ if and only if θ = φ. – If φ has the form ¬ψ, then θ is a subformula of φ if and only if θ = φ or θ is a subformula of ψ. – If φ has the form ψ1 ∧ ψ2, then θ is a subformula of φ if and only if θ = φ or θ is a subformula of ψ1, or θ is a subformula of ψ2. – If φ has the form ∃xψ, then θ is a subformula of φ if and only if θ = φ or θ is a subformula of ψ. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 6/19 Artificial Intelligence / 2. Syntax Syntax: Free variables The free variables of a formula are those variables occurring in it that are not quantified. Example: In ∀yR(x, y), x is free, but y is bound by ∀y. For any first-order formula φ, let f ree(φ) denote the set of free variables of φ. We define f ree(φ) inductively as follows: – If φ is atomic, then f ree(φ) is the set of all variables occurring in φ, – if φ = ¬ψ, then f ree(φ) = f ree(ψ), – if φ = ψ ∧ θ, then f ree(φ) = f ree(ψ) ∪ f ree(θ), and – if φ = ∃xψ, then f ree(φ) = f ree(ψ) − {x}. How would you define the set of bound variables of φ, bnd(φ)? A sentence of first-order logic is a formula having no free variables. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 7/19
  • 6. Artificial Intelligence 1. Introduction 2. Syntax 3. Semantics 4. Example 5. Conclusion Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 8/19 Artificial Intelligence / 3. Semantics Semantics: Vocabularies, structures and interpretations A vocabulary is a set of function, relation, and constant symbols. Let V be a vocabulary. A V-structure M = (U, I) consists of a nonempty underlying set U (the universe) along with an interpretation I of V. An interpretation I of V assigns: – an element of U to each constant symbol in V, – a function from U n to U to each n-ary function in V, and – a subset of U n to each n-ary relation in V. Examples: – V = {f 1, R2, c}, Z = (Z, IZ) The universe is the set of integers Z. IZ could interpret f (x) as x2, R(x, y) as x < y, and c as 3. – V = {f 1, R2, c}, N = (N, IN) The universe is the set of natural numbers N. IN could interpret f (x) as x + 1, R(x, y) as x < y, and c as 0. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 8/19
  • 7. Artificial Intelligence / 3. Semantics Semantics: V-formulas and V-sentences Let V be a vocabulary. A V-formula is formula in which every function, relation, and constant symbol is in V. A V-sentence is a V-formula that is a sentence. If M is a V-structure, then each V-sentence φ is either true or false in M. If φ is true in M, then we say M models φ and write M |= φ. Example: Var = {+, ·, 0, 1} is the vocabulary of arithmetic. Then R = (R, IR) is an Var -structure if IR is a interpretation of Var . R |= ∀x∃y(1 + x · x = y) What about ∀y∃x(1 + x · x = y)? Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 9/19 Artificial Intelligence / 3. Semantics Semantics: The value of terms We define the value VM (t) ∈ U of a term t inductively as – VM (t) = IM (t), if t is a constant symbol, and – VM (t) = IM (f )(VM (t1), . . . , VM (tn)), if t = f n(t1, . . . , tn). Example: V = {f 1, R2, c}, N = (N, IN), interpretation IN as before What is the value of the term t = f (f (c))? VN(f (f (c))) = IN(f )(VN(f (c))) = IN(f )(IN(f )(VN(c))) = IN(f )(IN(f )(IN(c))) = IN(f )(IN(f )(0)) = IN(f )(1) =2 Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 10/19
  • 8. Artificial Intelligence / 3. Semantics Semantics: Vocabulary/structure expansions and reducts An expansion of a vocabulary V is a vocabulary containing V as a subset. A structure M is an expansion of the V-structure M if M has the same universe and interprets the symbols of V in the same way as M . If M is an expansion of M , then we say that M is a reduct of M . Examples: The {+, −, ·, <, 0, 1}-structure M = (R, I ) is an expansion of the Var -structure M = (R, I) if both I and I interpret the symbols +, ·, 0, and 1 in the usual way. A {+, −, ·, <, 0, 1}-structure M = (Q, I ) cannot be an expansion of M . Any structure is an expansion of itself. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 11/19 Artificial Intelligence / 3. Semantics Semantics: The value of formulas We define M |= φ by induction: –M |= t1 = t2 if and only if V (t1) = V (t2), –M |= Rn(t1, . . . , tn) iff. (VM (t1), . . . , VM (tn)) ∈ IM (Rn), –M |= ¬φ iff. M does not model φ, –M |= φ1 ∧ φ2 iff. both M |= φ1 and M |= φ2, and –M |= ∃xφ(x) iff. MC |= φ(c) for some constant c ∈ V(M ) . V(M ) = V ∪ {cm|m ∈ UM } MC = (UM , IC ) is the expansion of M = (UM , I) to a V(M )-structure where IC interprets each cm as the element m. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 12/19
  • 9. Artificial Intelligence 1. Introduction 2. Syntax 3. Semantics 4. Example 5. Conclusion Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 13/19 Artificial Intelligence / 4. Example Back to the Silly Example Toy example by Gregory Yob (1975), adapted by our textbook. – 4 × 4 grid, tiles numbered (1,1) to (4,4), – the agent starts in (1,1), – the beast Wumpus sits at a random tile, unknown to the agent, – a pile of gold sits at another random tile, unknown to the agent, – some pits are located at random tiles, unknown to the agent. – if the agent enters the tile of the Wumpus, he will be eaten, – if the agent enters a pit, he will be trapped, Bree z e PIT 4 Stench Bree z e 3 Stench PIT Bree z e Gold Bree z e 2 Stench Bree z e Bree z e 1 PIT START 1 2 3 4 Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 13/19
  • 10. Artificial Intelligence / 4. Example Encoding in propositional logic 64 variables: Px,y tile x, y contains a pit (x, y = 1, . . . , 4). Wx,y tile x, y contains the Wumpus (x, y = 1, . . . , 4). Bx,y tile x, y contains a breeze (x, y = 1, . . . , 4). Sx,y tile x, y contains stench (x, y = 1, . . . , 4). start is save: (2 formulas) ¬P1,1, ¬W1,1 how breeze arises: (16 formulas) Bx,y ↔ Px−1,y ∨ Px+1,y ∨ Px,y−1 ∨ Px,y+1, x, y = 1, . . . , 4 how stench arises: (16 formulas) Sx,y ↔ Wx−1,y ∨ Wx+1,y ∨ Wx,y−1 ∨ Wx,y+1, x, y = 1, . . . , 4 there is exactly one Wumpus: (121 formulas) W1,1 ∨ W1,2 ∨ . . . ∨ W4,4 ¬Wx,y ∨ ¬Wx ,y , x, y, x , y = 1, . . . , 4, x = x or y = y Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 14/19 Artificial Intelligence / 4. Example Encoding in first logic (1/2) Vocabulary: – constants 1, 2, 3, 4 – binary relations symbols P, W, B, S Meaning of the predicates: P (x, y) tile x, y contains a pit. W (x, y) tile x, y contains the Wumpus. B(x, y) tile x, y contains a breeze. S(x, y) tile x, y contains stench. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 15/19
  • 11. Artificial Intelligence / 4. Example Encoding in first logic (2/2) start is save: ¬P (1, 1) ∧ ¬W (1, 1) how breeze arises: ∀x∀yB(x, y) ↔ P (x − 1, y) ∨ P (x + 1, y) ∨ P (x, y − 1) ∨ P (x, y + 1) there is exactly one Wumpus: W (x, y) → ∀x ∀y W (x , y ) → (x = x ∧ y = y ) Further possibilities: Encode actions as functions, encode time steps. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 16/19 Artificial Intelligence 1. Introduction 2. Syntax 3. Semantics 4. Example 5. Conclusion Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 17/19
  • 12. Artificial Intelligence / 5. Conclusion Summary We introduced first-order logic, a representation language far more powerful than propositional logic. – Knowledge representation should be declarative, compositional, expressive, context-independent, and unambiguous. – Constant symbols name objects, relation symbols (predicates) name properties and relations, and function symbols name functions. Complex terms apply function symbols to terms to name an object. – Given a V-structure, the truth of a formula is determined. – An atomic formula consists of a relation symbol applied to one or more terms; it is true iff. the relation named by the predicate holds between the objects named by the terms. Complex formulas use connectives just like propositional logic. Quantifiers allow the expression of general rules. Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 17/19 Artificial Intelligence / 5. Conclusion Outlook Next lesson: Inference in first-order predicate logic. Which other kind of logics exist? – Temporal logic: Gφ → Xφ – Description logic: C ⊆ D – Modal logic: p → p – Higher-order predicate logic: ∀P ∀x∀yP (x, y) ∧ P (y, x) → S(P ) – Typed/intuitionistic/default/relevance logics – ... (not covered in this course) Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 18/19
  • 13. Artificial Intelligence / 5. Conclusion Literature – Shawn Hedman: A First Course in Logic – Heinz-Dieter Ebbinghaus, Jörg Flum, Wolfgang Thomas: Einführung in die mathematische Logik – Uwe Schöning: Logik für Informatiker – Stuart Russell, Peter Norvig: Artificial Intelligence. A Modern Approach Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, summer term 2008 19/19