SlideShare a Scribd company logo
Chapter 8
First Order Logic(FOL)
3.7 Representation Revisited
Pros and cons of propositional logic
 Propositional logic is declarative: the syntax correspond to facts.
 Propositional logic allows partial/disjunctive/negated information.
 Propositional logic is compositional: meaning of B1,1 ∧ P1,2 is derived from meaning of B1,1 and of
P1,2.
 Meaning in propositional logic is context-independent (unlike natural language, where meaning
depends on context).
X Propositional logic has very limited expressive power (unlike natural language).
 E.g., cannot say “pits cause breezes in adjacent squares” except by writing one sentence for each
square.
First-order logic
 Propositional logic assumes the world contains facts.
 First-order logic (FOL), models the world in terms of
 Objects, which are things with individual identities.
 Properties of objects that distinguish them from other objects
 Relations that hold among sets of objects
 Functions, which are a subset of relations where there is only one “value” for any given “input”,
 Examples:
 Objects: Students, lectures, companies, cars ...
 Relations: Brother-of, bigger-than, outside, part-of, has-color, occurs-after, owns, visits, precedes, ...
 Properties: blue, oval, even, large, ...
 Functions: father-of, best-friend, second-half, one-more-than ...
Propositional Logic vs FOL
 The primary difference between propositional and first-order logic lies in the ontological
commitment made by each language—that is, what it assumes about the nature of reality.
 A logic can also be characterized by its epistemological commitments—the possible states of
knowledge that it allows with respect to each fact.
3.8 Syntax and semantics of FOL
 Models for propositional logic links the proposition symbols to predefined truth values and every model
must provide the information required to determine if any given sentence is true or false.
 In case of FOL model, The domain(must be non empty) of a model contains the set of objects or domain
elements.
 The basic syntactic elements of first-order logic are objects, relations, and functions.
 The symbols are categorized into three kinds:
1. constant symbols, which stand for objects;
2. predicate symbols, which stand for relations; and
3. function symbols, which stand for functions.
 In addition to objects, relations, and functions, each model includes an interpretation that specifies exactly which
objects, relations and functions are referred to by the constant, predicate, and function symbol.
 In summary, a model in first-order logic consists of
a set of objects and an interpretation that maps constant symbols to objects,
predicate symbols to relations on those objects, and
function symbols to functions on those objects.
 For example, we might use the constant symbols Richard and John; the predicate symbols Brother , OnHead, Person,
King, and Crown; and the function symbol LeftLeg.
Term, Atomic sentence ,Complex Sentence
 A term is a logical expression that refers to an object.
 For example, in English ,we can use the expression “King John’s left leg” rather than giving a
name to his leg.
 This is what function symbols are for: instead of using a constant symbol, we use
LeftLeg(John).
 An atomic sentence (or atom for short) is formed from a predicate symbol optionally followed
by a parenthesized list of terms, such as Brother(Richard, John).
 Complex sentences are formed by the atomic sentences which are connected by the logical
connectives.
 Example: Brother (Richard, John) ∧ Brother (John, Richard).
Quantifiers
 Quantifiers are used to express the quantity of something. First-order logic contains two standard quantifiers,
called universal quantifiers, and existential quantifiers.
 Universal quantifiers(∀):
 The universal quantifier express that , the statements within its scope are true for everything, or every
instance of a specific thing.
 “All kings are persons” is written in first-order logic as ∀ x King(x) ⇒ Person(x) .
 Existential quantification (∃):
 The existential quantifier is a symbol of symbolic logic which expresses that the statements within its scope
are true for at least one instance of something.
 King John has a crown on his head, we write ∃ x Crown(x) ∧ OnHead(x, John) .
 A quantified sentence adds quantifiers  and .
 A well-formed formula(wff) is a sentence containing no “free” variables. That is, all variables are “bound” by universal or
existential quantifiers. For example: (x)P(x,y) has x bound as a universally quantified variable, but y is free.
Properties of quantifiers
 x y is the same as y x
 x y is the same as y x
 x y is not the same as y x
 x y Loves(x,y)
“There is a person who loves everyone in the world”
 y x Loves(x,y)
“Everyone in the world is loved by at least one person.
Equality
 term1 = term2 is true under a given interpretation if and only if term1 and term2 refer to the same object.
 Equality symbol can be used to signify that , the two terms refer to the same object.
 For example: ∃ x, y Brother (x, Richard) ∧ Brother (y, Richard)
Syntax of first-order logic
 Operator precedence are specified, from highest to lowest.
3.9 Using FOL
Assertions and queries in first-order logic
 Sentences are added to a knowledge base using TELL, such sentences are called assertions(confident
and forceful statement of fact or belief).
 For example, we can assert that John is a king, Richard is a person, and all kings are persons:
 TELL(KB, King(John)) .
 TELL(KB, Person(Richard)) .
 TELL(KB, ∀ x King(x) ⇒ Person(x)) .
 We can ask questions to the knowledge base using ASK.
 Questions asked with ASK are called queries or goals.
 For example, ASK(KB, King(John)) QUERY returns true.
The Kinship Domain
 For example if we consider the domain of family relationships, or kinship.
 This domain includes facts such as
“Elizabeth is the mother of Charles” and
“Charles is the father of William” and
 rules such as “One’s grandmother is the mother of one’s parent.”
 Clearly, the objects in kinship domain are people.
 Here there are two unary predicates, Male and Female.
 Kinship relations—parenthood, brotherhood, marriage, and so on—are represented by binary predicates: Parent,
Sibling, Brother , Sister , Child, Daughter, Son, Spouse, Wife, Husband, Grandparent, Grandchild , Cousin, Aunt, and
Uncle.
 Functions can be used for Mother and Father , because every person has exactly one of each of these.
For example,
 one’s mother is one’s female parent:
∀ m, c Mother (c) = m ⇔ Female(m) ∧ Parent(m, c) .
 One’s husband is one’s male spouse:
∀ w, h Husband(h, w) ⇔ Male(h) ∧ Spouse(h, w) .
 Male and female are disjoint categories:
∀ x Male(x) ⇔ ¬Female(x) .
 Parent and child are inverse relations:
∀ p, c Parent(p, c) ⇔ Child(c, p) .
 A grandparent is a parent of one’s parent:
∀ g, c Grandparent(g, c) ⇔ ∃ p Parent(g, p) ∧ Parent(p, c) .
 A sibling is another child of one’s parents:
∀ x, y Sibling(x, y) ⇔ x = y ∧ ∃ p Parent(p, x) ∧ Parent(p, y) .
Sets
 Set can be defined as the collection of well-defined objects.
 We can represent individual sets, including the empty set ,which can be represented by { }.
 Sets can be build , by adding an element to a set or taking the union or intersection of two sets.
 There is one unary predicate, Set, which is true of sets.
 The binary predicates are
x∈ s (x is a member of set s) and
s1 ⊆ s2 (set s1 is a subset of set s2).
 The binary functions are
s1 ∩ s2 (the intersection of two sets),
s1 ∪ s2 (the union of two sets), and
{x|s} (the set resulting from adjoining element x to set s).
Set of Axioms
 The only sets are the empty set and those made by adjoining something to a set:
∀ s Set(s) ⇔ (s = { }) ∨ (∃ x, s2 Set(s2) ∧ s = {x|s2}) .
 The empty set has no elements adjoined into it(it can not be decomposed):
¬∃ x, s {x|s} = { } .
 Adjoining an element already in the set has no effect:
∀ x, s x∈ s ⇔ s = {x|s} .
 The only members of a set are the elements that were adjoined into it.(saying that x is a
member of s if and only if s is equal to some set s2 adjoined with some element y, where
either y is the same as x or x is a member of s2):
∀ x, s x∈ s ⇔ ∃ y, s2 (s = {y|s2} ∧ (x = y ∨ x∈ s2)) .
 A set is a subset of another set if and only if all of the first set’s members are members of
the second set:
∀ s1, s2 s1 ⊆ s2 ⇔ (∀ x x∈ s1 ⇒ x∈ s2) .
 Two sets are equal if and only if each is a subset of the other:
∀ s1, s2 (s1 = s2) ⇔ (s1 ⊆ s2 ∧ s2 ⊆ s1)
 An object is in the intersection of two sets if and only if it is a member of both sets:
∀ x, s1, s2 x∈ (s1 ∩ s2) ⇔ (x∈ s1 ∧ x∈s2) .
 An object is in the union of two sets if and only if it is a member of either set:
∀ x, s1, s2 x∈ (s1 ∪ s2) ⇔ (x∈ s1 ∨ x∈s2)
The wumpus world
 The agent percepts can be represented as five element list, [Stench, Breeze, Glitter, Bump, Scream].
 The corresponding first-order sentence stored in the knowledge base must include both the percept and the time
at which it occurred; otherwise, the agent will get confused about when it perceived what(integers time
stamps).
 For example the agent perceived ([Stench, Breeze, Glitter , None, None], 5) .
 Here, Percept is a binary predicate, and Stench and so on are constants placed in a list.
 The actions in the wumpus world can be : Turn(Right), Turn(Left), Forward, Shoot, Grab.
 To determine which is best, the agent program executes the query
ASKVARS(∃ a BestAction(a, 5)) ,
which returns a binding list such as {a/Grab}.
 The agent program can then return Grab as the action to take.
3.10 Knowledge Engineering in FOL
 Knowledge engineering can be defined as the Construction of knowledge-base.
 Steps to construct the knowledge base
1. Identify the task
2. Assemble the relevant knowledge (knowledge acquisition: extract what they(expert) know)
3. Decide on a vocabulary of predicates, functions, and constants
4. Encode general knowledge about the domain
5. Encode a description of the specific problem instance
6. Pose queries to the inference procedure and get answers
7. Debug the knowledge base
The Electronic circuits domain
One-bit full adder
1. Identify the task
Does the circuit actually add properly? (circuit verification)
2. Assemble the relevant knowledge
Composed of wires and gates; Types of gates (AND, OR, XOR, NOT)
Irrelevant: size, shape, color, cost of gates
3. Decide on a vocabulary
 Alternatives:
Type(X1) = XOR
Type(X1, XOR)
XOR(X1)
4. Encode general knowledge of the domain
5. Encode the specific problem instance
Type(X1) = XOR Type(X2) = XOR
Type(A1) = AND Type(A2) = AND
Type(O1) = OR
Connected(Out(1,X1),In(1,X2)) Connected(In(1,C1),In(1,X1))
Connected(Out(1,X1),In(2,A2)) Connected(In(1,C1),In(1,A1))
Connected(Out(1,A2),In(1,O1)) Connected(In(2,C1),In(2,X1))
Connected(Out(1,A1),In(2,O1)) Connected(In(2,C1),In(2,A1))
Connected(Out(1,X2),Out(1,C1)) Connected(In(3,C1),In(2,X2))
Connected(Out(1,O1),Out(2,C1)) Connected(In(3,C1),In(1,A2))
6. Pose queries to the inference procedure
 What are the possible sets of values of all the terminals for the adder circuit?
i1,i2,i3,o1,o2 Signal(In(1,C_1)) = i1  Signal(In(2,C1)) = i2  Signal(In(3,C1)) = i3 
Signal(Out(1,C1)) = o1  Signal(Out(2,C1)) = o2
7. Debug the knowledge base
May have omitted assertions like 1 ≠ 0

More Related Content

Similar to First order logic in artificial Intelligence.pptx

Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
PalGov
 
Semantics
SemanticsSemantics
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
AnkitaVerma776806
 
Logic 2
Logic 2Logic 2
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
DrKalaavathiBuvanesh
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdf
HrideshSapkota2
 
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Ashish Duggal
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
smarwaneid
 
lacl (1)
lacl (1)lacl (1)
Dialectica and Kolmogorov Problems
Dialectica and Kolmogorov ProblemsDialectica and Kolmogorov Problems
Dialectica and Kolmogorov Problems
Valeria de Paiva
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
SHUBHAM KUMAR GUPTA
 
A course on mathematical logic
A course on mathematical logicA course on mathematical logic
A course on mathematical logic
Springer
 
Binary relations
Binary relationsBinary relations
Binary relations
Tarun Gehlot
 
Introduction to Calculus 1
Introduction to Calculus 1Introduction to Calculus 1
Introduction to Calculus 1
David Rogers
 
Lesson1
Lesson1Lesson1
Lesson1
David Rogers
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
Roorkee College of Engineering, Roorkee
 
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and orderingBCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
Rai University
 
First order logic
First order logicFirst order logic
First order logic
Chinmay Patel
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
ZainabShahzad9
 
5
55

Similar to First order logic in artificial Intelligence.pptx (20)

Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introductionJarrar.lecture notes.aai.2011s.ch8.fol.introduction
Jarrar.lecture notes.aai.2011s.ch8.fol.introduction
 
Semantics
SemanticsSemantics
Semantics
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
Logic 2
Logic 2Logic 2
Logic 2
 
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
 
Unit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdfUnit-4-Knowledge-representation.pdf
Unit-4-Knowledge-representation.pdf
 
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
lacl (1)
lacl (1)lacl (1)
lacl (1)
 
Dialectica and Kolmogorov Problems
Dialectica and Kolmogorov ProblemsDialectica and Kolmogorov Problems
Dialectica and Kolmogorov Problems
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
A course on mathematical logic
A course on mathematical logicA course on mathematical logic
A course on mathematical logic
 
Binary relations
Binary relationsBinary relations
Binary relations
 
Introduction to Calculus 1
Introduction to Calculus 1Introduction to Calculus 1
Introduction to Calculus 1
 
Lesson1
Lesson1Lesson1
Lesson1
 
Propositional Logic and Pridicate logic
Propositional Logic and Pridicate logicPropositional Logic and Pridicate logic
Propositional Logic and Pridicate logic
 
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and orderingBCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
BCA_Semester-II-Discrete Mathematics_unit-ii_Relation and ordering
 
First order logic
First order logicFirst order logic
First order logic
 
Lec 3.pdf
Lec 3.pdfLec 3.pdf
Lec 3.pdf
 
5
55
5
 

Recently uploaded

132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
shivani5543
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
MiscAnnoy1
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 

Recently uploaded (20)

132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 

First order logic in artificial Intelligence.pptx

  • 2. 3.7 Representation Revisited Pros and cons of propositional logic  Propositional logic is declarative: the syntax correspond to facts.  Propositional logic allows partial/disjunctive/negated information.  Propositional logic is compositional: meaning of B1,1 ∧ P1,2 is derived from meaning of B1,1 and of P1,2.  Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context). X Propositional logic has very limited expressive power (unlike natural language).  E.g., cannot say “pits cause breezes in adjacent squares” except by writing one sentence for each square.
  • 3. First-order logic  Propositional logic assumes the world contains facts.  First-order logic (FOL), models the world in terms of  Objects, which are things with individual identities.  Properties of objects that distinguish them from other objects  Relations that hold among sets of objects  Functions, which are a subset of relations where there is only one “value” for any given “input”,  Examples:  Objects: Students, lectures, companies, cars ...  Relations: Brother-of, bigger-than, outside, part-of, has-color, occurs-after, owns, visits, precedes, ...  Properties: blue, oval, even, large, ...  Functions: father-of, best-friend, second-half, one-more-than ...
  • 4. Propositional Logic vs FOL  The primary difference between propositional and first-order logic lies in the ontological commitment made by each language—that is, what it assumes about the nature of reality.  A logic can also be characterized by its epistemological commitments—the possible states of knowledge that it allows with respect to each fact.
  • 5. 3.8 Syntax and semantics of FOL  Models for propositional logic links the proposition symbols to predefined truth values and every model must provide the information required to determine if any given sentence is true or false.  In case of FOL model, The domain(must be non empty) of a model contains the set of objects or domain elements.  The basic syntactic elements of first-order logic are objects, relations, and functions.
  • 6.  The symbols are categorized into three kinds: 1. constant symbols, which stand for objects; 2. predicate symbols, which stand for relations; and 3. function symbols, which stand for functions.  In addition to objects, relations, and functions, each model includes an interpretation that specifies exactly which objects, relations and functions are referred to by the constant, predicate, and function symbol.  In summary, a model in first-order logic consists of a set of objects and an interpretation that maps constant symbols to objects, predicate symbols to relations on those objects, and function symbols to functions on those objects.  For example, we might use the constant symbols Richard and John; the predicate symbols Brother , OnHead, Person, King, and Crown; and the function symbol LeftLeg.
  • 7. Term, Atomic sentence ,Complex Sentence  A term is a logical expression that refers to an object.  For example, in English ,we can use the expression “King John’s left leg” rather than giving a name to his leg.  This is what function symbols are for: instead of using a constant symbol, we use LeftLeg(John).  An atomic sentence (or atom for short) is formed from a predicate symbol optionally followed by a parenthesized list of terms, such as Brother(Richard, John).  Complex sentences are formed by the atomic sentences which are connected by the logical connectives.  Example: Brother (Richard, John) ∧ Brother (John, Richard).
  • 8. Quantifiers  Quantifiers are used to express the quantity of something. First-order logic contains two standard quantifiers, called universal quantifiers, and existential quantifiers.  Universal quantifiers(∀):  The universal quantifier express that , the statements within its scope are true for everything, or every instance of a specific thing.  “All kings are persons” is written in first-order logic as ∀ x King(x) ⇒ Person(x) .  Existential quantification (∃):  The existential quantifier is a symbol of symbolic logic which expresses that the statements within its scope are true for at least one instance of something.  King John has a crown on his head, we write ∃ x Crown(x) ∧ OnHead(x, John) .  A quantified sentence adds quantifiers  and .
  • 9.  A well-formed formula(wff) is a sentence containing no “free” variables. That is, all variables are “bound” by universal or existential quantifiers. For example: (x)P(x,y) has x bound as a universally quantified variable, but y is free. Properties of quantifiers  x y is the same as y x  x y is the same as y x  x y is not the same as y x  x y Loves(x,y) “There is a person who loves everyone in the world”  y x Loves(x,y) “Everyone in the world is loved by at least one person. Equality  term1 = term2 is true under a given interpretation if and only if term1 and term2 refer to the same object.  Equality symbol can be used to signify that , the two terms refer to the same object.  For example: ∃ x, y Brother (x, Richard) ∧ Brother (y, Richard)
  • 11.  Operator precedence are specified, from highest to lowest.
  • 12. 3.9 Using FOL Assertions and queries in first-order logic  Sentences are added to a knowledge base using TELL, such sentences are called assertions(confident and forceful statement of fact or belief).  For example, we can assert that John is a king, Richard is a person, and all kings are persons:  TELL(KB, King(John)) .  TELL(KB, Person(Richard)) .  TELL(KB, ∀ x King(x) ⇒ Person(x)) .  We can ask questions to the knowledge base using ASK.  Questions asked with ASK are called queries or goals.  For example, ASK(KB, King(John)) QUERY returns true.
  • 13. The Kinship Domain  For example if we consider the domain of family relationships, or kinship.  This domain includes facts such as “Elizabeth is the mother of Charles” and “Charles is the father of William” and  rules such as “One’s grandmother is the mother of one’s parent.”  Clearly, the objects in kinship domain are people.  Here there are two unary predicates, Male and Female.  Kinship relations—parenthood, brotherhood, marriage, and so on—are represented by binary predicates: Parent, Sibling, Brother , Sister , Child, Daughter, Son, Spouse, Wife, Husband, Grandparent, Grandchild , Cousin, Aunt, and Uncle.  Functions can be used for Mother and Father , because every person has exactly one of each of these.
  • 14. For example,  one’s mother is one’s female parent: ∀ m, c Mother (c) = m ⇔ Female(m) ∧ Parent(m, c) .  One’s husband is one’s male spouse: ∀ w, h Husband(h, w) ⇔ Male(h) ∧ Spouse(h, w) .  Male and female are disjoint categories: ∀ x Male(x) ⇔ ¬Female(x) .  Parent and child are inverse relations: ∀ p, c Parent(p, c) ⇔ Child(c, p) .  A grandparent is a parent of one’s parent: ∀ g, c Grandparent(g, c) ⇔ ∃ p Parent(g, p) ∧ Parent(p, c) .  A sibling is another child of one’s parents: ∀ x, y Sibling(x, y) ⇔ x = y ∧ ∃ p Parent(p, x) ∧ Parent(p, y) .
  • 15. Sets  Set can be defined as the collection of well-defined objects.  We can represent individual sets, including the empty set ,which can be represented by { }.  Sets can be build , by adding an element to a set or taking the union or intersection of two sets.  There is one unary predicate, Set, which is true of sets.  The binary predicates are x∈ s (x is a member of set s) and s1 ⊆ s2 (set s1 is a subset of set s2).  The binary functions are s1 ∩ s2 (the intersection of two sets), s1 ∪ s2 (the union of two sets), and {x|s} (the set resulting from adjoining element x to set s).
  • 16. Set of Axioms  The only sets are the empty set and those made by adjoining something to a set: ∀ s Set(s) ⇔ (s = { }) ∨ (∃ x, s2 Set(s2) ∧ s = {x|s2}) .  The empty set has no elements adjoined into it(it can not be decomposed): ¬∃ x, s {x|s} = { } .  Adjoining an element already in the set has no effect: ∀ x, s x∈ s ⇔ s = {x|s} .  The only members of a set are the elements that were adjoined into it.(saying that x is a member of s if and only if s is equal to some set s2 adjoined with some element y, where either y is the same as x or x is a member of s2): ∀ x, s x∈ s ⇔ ∃ y, s2 (s = {y|s2} ∧ (x = y ∨ x∈ s2)) .
  • 17.  A set is a subset of another set if and only if all of the first set’s members are members of the second set: ∀ s1, s2 s1 ⊆ s2 ⇔ (∀ x x∈ s1 ⇒ x∈ s2) .  Two sets are equal if and only if each is a subset of the other: ∀ s1, s2 (s1 = s2) ⇔ (s1 ⊆ s2 ∧ s2 ⊆ s1)  An object is in the intersection of two sets if and only if it is a member of both sets: ∀ x, s1, s2 x∈ (s1 ∩ s2) ⇔ (x∈ s1 ∧ x∈s2) .  An object is in the union of two sets if and only if it is a member of either set: ∀ x, s1, s2 x∈ (s1 ∪ s2) ⇔ (x∈ s1 ∨ x∈s2)
  • 18. The wumpus world  The agent percepts can be represented as five element list, [Stench, Breeze, Glitter, Bump, Scream].  The corresponding first-order sentence stored in the knowledge base must include both the percept and the time at which it occurred; otherwise, the agent will get confused about when it perceived what(integers time stamps).  For example the agent perceived ([Stench, Breeze, Glitter , None, None], 5) .  Here, Percept is a binary predicate, and Stench and so on are constants placed in a list.  The actions in the wumpus world can be : Turn(Right), Turn(Left), Forward, Shoot, Grab.  To determine which is best, the agent program executes the query ASKVARS(∃ a BestAction(a, 5)) , which returns a binding list such as {a/Grab}.  The agent program can then return Grab as the action to take.
  • 19. 3.10 Knowledge Engineering in FOL  Knowledge engineering can be defined as the Construction of knowledge-base.  Steps to construct the knowledge base 1. Identify the task 2. Assemble the relevant knowledge (knowledge acquisition: extract what they(expert) know) 3. Decide on a vocabulary of predicates, functions, and constants 4. Encode general knowledge about the domain 5. Encode a description of the specific problem instance 6. Pose queries to the inference procedure and get answers 7. Debug the knowledge base
  • 20. The Electronic circuits domain One-bit full adder
  • 21. 1. Identify the task Does the circuit actually add properly? (circuit verification) 2. Assemble the relevant knowledge Composed of wires and gates; Types of gates (AND, OR, XOR, NOT) Irrelevant: size, shape, color, cost of gates 3. Decide on a vocabulary  Alternatives: Type(X1) = XOR Type(X1, XOR) XOR(X1)
  • 22. 4. Encode general knowledge of the domain
  • 23. 5. Encode the specific problem instance Type(X1) = XOR Type(X2) = XOR Type(A1) = AND Type(A2) = AND Type(O1) = OR Connected(Out(1,X1),In(1,X2)) Connected(In(1,C1),In(1,X1)) Connected(Out(1,X1),In(2,A2)) Connected(In(1,C1),In(1,A1)) Connected(Out(1,A2),In(1,O1)) Connected(In(2,C1),In(2,X1)) Connected(Out(1,A1),In(2,O1)) Connected(In(2,C1),In(2,A1)) Connected(Out(1,X2),Out(1,C1)) Connected(In(3,C1),In(2,X2)) Connected(Out(1,O1),Out(2,C1)) Connected(In(3,C1),In(1,A2))
  • 24. 6. Pose queries to the inference procedure  What are the possible sets of values of all the terminals for the adder circuit? i1,i2,i3,o1,o2 Signal(In(1,C_1)) = i1  Signal(In(2,C1)) = i2  Signal(In(3,C1)) = i3  Signal(Out(1,C1)) = o1  Signal(Out(2,C1)) = o2 7. Debug the knowledge base May have omitted assertions like 1 ≠ 0