Download Differences in First-Order Logic: Propositional vs. Programming vs. Natural Languages and more Slides Artificial Intelligence in PDF only on Docsity!
First-Order Logic
Outline
- Why FOL? Why not Programming
Languages, databases, and PL– Difference of PL and FOL
- Syntax and semantics of FOL
- Constant, predicates, relations, functions
- Using FOL• Wumpus world in FOL• Knowledge engineering in FOL
Pros and Cons of PL
-^
Propositional logic is declarative
PL has the power to deal with partial information. It allowspartial/disjunctive/negated information–
(unlike most data structures and databases)
Propositional logic is compositional:
-^
meaning of
B
1,
P
1,
is derived from meaning of
B
1,
and of
P
1,
Meaning in propositional logic is context-independent
-^
(unlike natural language, where meaning depends on context)
-^
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
-^
Natural languages are non-compositional
-^
Natural languages suffer from ambiguity
-^
But NL are declarative
Natural Languages
- A NL like English, Spanish contain:
- Nouns and noun phrases– Verb and verb phrases – relations– functions
Difference of PL and FOL
-^
Ontological commitments– PL assumes facts that can be true or false– FOL assumes objects with relations that do hold or do not hold– Temporal logic: Truth/False or relations of objects with respect to
time
- High order logic: Relations and functions referred to by FOL as
objects in themselves – more expressive
-^
Epistemological commitments. The possible states ofknowledge that it allows with respect to each fact– In both, PL and FOL, a sentence is believed to be true, false, or
no opinion. Possibility theory define a degree of belief
Syntax and Semantics of FOL
-^
Models of PL
-^
Models of FOL are very interesting: objects in models –objects are called domain elements
-^
Figure: Richard the Lionheart, king of England, hisyounger brother, the evil king john, the left leg of Richardand John, and a crown
-^
Objects have relations: a set of tuples of objects that arerelated– Binary relation: a pair of objects, e.g <the crown, king John >– Unary: Properties of objects, e.g. person, crown
-^
Function: A given object must be related to exactly oneobject.
Syntax and Semantics of FOL
KingJohn, 2, NUS,...
Brother, >,...
Sqrt, LeftLegOf,...
x, y, a, b,...
,^
,^
,^
,^
,^
- Each predicate and function has arity
Syntax and Semantics of FOL
- Semantics: We need interpretation –
specifies exactly which object, relation,and function are referred to by theconstant, predicates, and function symbols
- The truth of any sentence is determined by
a model and an interpretation for thesentence symbol
Formal Grammar of FOL
-^
Complex sentences: Atomic sentences cam form complex sentenceusing connectives
-^
Quantifiers: To express properties of entire collection of objects–
Universal quantifier
-^
<
variables
<
sentence
- Everyone at NUS is smart:
x At(x,NUS)
Smart(x)
-^
x
P
is true in a model
m
iff
P
is true with
x^
being each possible object in the
model
Roughly speaking, equivalent to the conjunction of instantiations of
P
At(KingJohn,NUS)
Smart(KingJohn)
^
At(Richard,NUS)
Smart(Richard)
^
At(NUS,NUS)
Smart(NUS)
^
...
Formal Grammar of FOL
-^
Existential Quantifier: It makes statement for every object–
< variables
sentence
-^
Someone at NUS is smart:
-^
x
At(x,NUS)
Smart(x)$
x P
is true in a model
m
iff
P
is true with
x
being some possible object
in the model
Roughly speaking, equivalent to the disjunction of instantiations of
P
At(KingJohn,NUS)
Smart(KingJohn)
^
At(Richard,NUS)
Smart(Richard)
^
At(NUS,NUS)
Smart(NUS)
^
Using FOL
- Domain: In knowledge representation, a
domain is just some part of the worldabout which we wish to express someknowledge
- Assertions and queries• Any query that is logically entailed by the
KB should be answered affirmatively
The kinship domain
-^
Domain of family relationships: Objects in this domain are people
-^
We will have two unary predicates: Male and Female
-^
To represent parenthood, brotherhood, marriage, so on…we will use binarypredicates: parent, sibling, brother, sister, child, daughter, son, spouse, etc.
-^
We will use functions for mother and father
-^
One’s mother is one’s female parent
-^
One’s husband is one’s male spouse
-^
Male and female are disjoint categories
-^
Parent and child are inverse relations
-^
A grandparent is a parent of one’s parent
-^
A sibling is another child of one’s parent
-^
Many such entries can be made
-^
Each entry is called Axiom which provide factual information from which usefulconclusion can be viewed
-^
Axioms are also called definitions
-^
Not all logical sentences are axioms. Some are theorem – they are entailed byaxioms
-^
Axioms can be simple plain facts:
The Wumpus World
-^
The FOL sentence stored in the KB must be include both thepercept and time at which it occurred.
-^
The actions are:
-^
To determine which is better action
-^
Synchronic sentences:
-^
Diachronic sentences:
-^
Representation of the environment:–
Simply squares can be represented as square1,2, square1,3, …– The adjacent squares:– A unary predicate Pit is true for square containing pit– A unary predicate for wumpus– Agent location– Given its current location, agent can infer properties of square from theproperties of percepts.– Since Pit can not move, hence from breezy and smelly squares, agentcan infer where is the Pit and where is the wumpus
The Wumpus World
- There are two kinds of synchronic rules:
- Diagnostic rules: to determine the effect of
hidden causes
- Causal rules: They reflect the assumed
directions of causality in the world
- Systems that work with causal rules are
called model based reasoning systems
- Difference of Model-based reasoning
systems and Diagnostic reasoning?