0% found this document useful (0 votes)
64 views108 pages

Unit-Ii: Adversarial Search

The document discusses adversarial search problems in games and optimal decision making. It introduces concepts like game trees, the minimax algorithm, alpha-beta pruning, and constraint satisfaction problems. Alpha-beta pruning reduces the search space by pruning branches that will not influence the final decision. Constraint satisfaction problems provide a natural way to represent problems with constraints between variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views108 pages

Unit-Ii: Adversarial Search

The document discusses adversarial search problems in games and optimal decision making. It introduces concepts like game trees, the minimax algorithm, alpha-beta pruning, and constraint satisfaction problems. Alpha-beta pruning reduces the search space by pruning branches that will not influence the final decision. Constraint satisfaction problems provide a natural way to represent problems with constraints between variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 108

Go, change the

world

UNIT-II
ADVERSARIAL SEARCH
Go, change the
world

CONTENTS
• Games
• Optimal decision in games
• Alpha-beta pruning
Go, change the
world

Introduction
• Multiagents should consider the actions of other
agents and how they affect self.
• Games are competitive environments , agents goal
are in conflict, gives rise to adversarial search
problems.
• Games are deterministic, turn-taking, two-player,
zero-sum games of perfect information .
• State of a game is easy to represent and agents are
restricted to a small number of actions whose
outcomes are defined by precise rules.
Go, change the
world
Introduction
• Games are interesting as they are hard to solve.
• Ex: chess has an average branching factor of about
35, assuming game goes to 50 moves per player,
search tree has about nodes.
• Game playing research deals on how to make the
best possible use of time
• Games deals with optimal move and algorithm for
finding it
• Pruning is considered which ignores portions of the
search tree which makes no difference to final
choice.
Go, change the
world

Introduction
• Games are considered with 2 players MAX and MIN
• At the end of the game points are awarded to the
winning player and penalties are given to the lose.
Go, change the
world

Definition of game
Go, change the
world

Definition of game
• initial state, actions function, result function
define the game tree for the game- a tree where
the nodes are game states and the edges are
moves.
Go, change the
world

Game tree for tic-tac-toe game


Go, change the
world

Optimal decision in games


• Normal search problem is to find sequence of
actions leading to goal state.
• Utilities are given by leaf nodes.
Go, change the
world

Optimal decision in games


• Given a game tree optimal strategy can be
determined from the minimax value of each node
written as MINIMAX(n).

• Utility function gives the utility values to leaf nodes.


Go, change the
world

Min max algorithm


• Uses a simple recursive computation of the
minimax values of each successor state
• Recursion proceeds all the way down to the leaves
of the tree, then minimax values are backed up
through the tree as the recursion unwinds.
• Minimax performs complete depth-first exploration
of the game tree
• If the maximum depth of the tree is m and there
are b legal moves at each point then the time
complexity of the minimax algorithm is
Go, change the
world

Min max algorithm


• Space complexity is
Go, change the
world

Min-Max algorithm
Go, change the
world

Example 1:
Go, change the
world

Example-2
Go, change the
world

Example-3
Go, change the

Optimal decision in multiplayer


world

games
Go, change the
world

Alpha-beta pruning
• Problem with min-max search is the number of
game states to be explored is exponential
• Alpha beta pruning reduces the search to half
• Idea is to eliminate large parts of tree from
consideration
• When applied to standard minimax tree, it returns
the same move as minimax , but prunes branches
which would not influence the final decision.
Go, change the
world

Alpha beta pruning-example


Go, change the
world

Alpha beta pruning-example


Go, change the
world

Value of root node is given by:


Go, change the
world

Alpha beta pruning


• Alpha beta pruning can be applied to trees of any
depth
• It is possible to prune entire subtrees rather than
just leaves.
Go, change the
world

Alpha beta pruning


• Minimax is depth-first search
• Alpha-beta pruning gets its name from the
following two parameters that describes bounds on
the back-up values :
• value of the best, highest value, choice found so far
at any choice point along the path for MAX.
• value of the best, lowest value, choice found so far
at any choice point along the path for MIN.
Go, change the
world

Algorithm for alpha-beta pruning


Go, change the
world

Example:
Go, change the
world

Move ordering
• Effectiveness of alpha beta pruning is dependent on
the order of the nodes visited.
• Visiting in proper order ensures the nodes to be
examined by alpha beta pruning will reduce to
• Number of nodes visited by minimax is
• Adding dynamic move-ordering schemes brings
theoretical limits
• Use of iterative deepening provides killer move
heuristic
Go, change the
world

Constraint satisfaction problems


• Defining constraints satisfaction problems
• Backtracking search for CSPs
Go, change the
world

Constraint satisfaction problems

• Each domain Di consists of a set of allowable


values, {v1,...,vk} for variable Xi
• Each constraint Ci consists of a pair <scope, rel>
• scope is a tuple of variables that participate in the
constraint
Go, change the
world

Constraint satisfaction problems


• rel is a relation that defines the values that those
variables can take on.
• A relation can be represented as an explicit list of
all tuples of values that satisfy the constraint (OR)
• as an abstract relation that supports two
operations:
testing if a tuple is a member of the relation
enumerating the members of the relation.
Go, change the
world

Constraint satisfaction problems


• For example, if X1 and X2 both have the domain
{A,B}, then the constraint saying the two variables
must have different values can be written as<(X1,
X2), [(A, B),(B,A)]> or as <(X1, X2), X1 = X2>.
• Each state in a CSP is defined by an assignment of
values to some or all of the variables, {Xi = vi , Xj =
vj ,...}.
• An assignment that does not violate any constraints
is called a consistent or legal assignment
Go, change the
world

Constraint satisfaction problems


• A complete assignment is one in which every
variable is assigned, and a solution to a CSP is a
consistent, complete assignment.
• A partial assignment is one that assigns values to
only some of the variables.
Go, change the
world

Example problem: Map coloring


Go, change the
world

Example problem: Map coloring


• task of coloring each region either red, green, or
blue in such a way that no neighboring regions have
the same color.
• To formulate this as a CSP, define the variables to
be the regions X = {WA, NT, Q, NSW ,V, SA, T} .
• The domain of each variable is the set Di = {red,
green, blue}.
• The constraints require neighboring regions to have
distinct colors.
Go, change the
world

Example problem: Map coloring


• Since there are nine places where regions border,
there are nine constraints:
Go, change the
world

Why CSP?
• CSP yields a natural representation of wide variety
of problems
• Easy to solve a problem using CSP than to design a
custom solution using another search technique
• CSP solvers are faster than a state space searchers
as CSP eliminates large state space
• Ex: if we choose {SA=blue} , without CSP the
assignments would be with CSP the assignment
would be .
Go, change the
world

Variations on CSP formulation


• The simplest kind of CSP involves variables that
have discrete, finite domains.
• Ex: map coloring problems, schedule with time
limits, 8-queens problem
• A discrete domain can be infinite, such as the set of
integers or strings
• With infinite domains, it is no longer possible to
describe constraints by enumerating all allowed
combinations of values
Go, change the

Example problem: Job-shop


world

scheduling
• Consider the problem of scheduling assembly of a
car.
• Whole job is composed of tasks , each task is a
variable, the value of each variable is the time that
the task starts expressed in minutes
• Constraint is one task must start before other
• Constraint also can specify a task takes certain
amount of time to complete
Go, change the
world

Variations on CSP formulation


• Constraint language is used for infinite domain
problems.
• Constraints can be linear and non linear
• Constraints can be unary, binary,global
• Unary : For example, in the map-coloring problem
it could be the case that South Australians won’t
tolerate the color green; we can express that with
the unary constraint <(SA), SA green>
Go, change the
world

Variations on CSP formulation


• Reasons for preferring global constraints over binary
constraints:
• First, it is easier and less error-prone to write the
problem description using global constraints
• it is possible to design special-purpose inference
algorithms for global constraints that are not available
for a set of more primitive constraints.
• Constraints generally are absolute constraints
violation of which rules out potential solution.
• Many real-world CSPs include preference constraints
Go, change the
world

Variations on CSP formulation


• CSPs with preferences can be solved with
optimization search methods, either path-based or
local. Such a problem is called a constraint
optimization problem, or COP.
Go, change the
world

Backtracking Search for CSPs


• backtracking search algorithms that work on partial
assignments
• local search algorithms over complete assignments.
Go, change the
world

Backtracking Search for CSPs


• apply a standard depth-limited search
• A state would be a partial assignment, and an
action would be adding var = value to the
assignment
• for a CSP with n variables of domain size d, the
branching factor at the top level is nd because any
of d values can be assigned to any of n variables. At
the next level, the branching factor is (n − 1)d, and
so on for n levels.
Go, change the
world

Backtracking algorithm
Go, change the
world

Backtracking algorithm
• backtracking search is used for a depth-first search
that chooses values for one variable at a time and
backtracks when a variable has no legal values left
to assign.
• BACKTRACKING-SEARCH keeps only a single
representation of a state and alters that
representation rather than creating new ones
Go, change the
world

Backtracking algorithm
• Which variable should be assigned next (SELECT-
UNASSIGNED-VARIABLE), and in what order should
its values be tried (ORDER-DOMAIN-VALUES)?
• What inferences should be performed at each step
in the search (INFERENCE)?
• When the search arrives at an assignment that
violates a constraint, can the search avoid repeating
this failure?
Go, change the
world
Go, change the
world

Variable and value ordering


• The simplest strategy for SELECT-UNASSIGNED-
VARIABLE is to choose the next unassigned variable
in order, {X1, X2,...}.
• This is static variable ordering
• For example, after the assignments for WA = red
and NT = green, there is only one possible value for
SA, so it makes sense to assign SA = blue next
rather than assigning Q. After SA is assigned, the
choices for Q, NSW , and V are all forced.
Go, change the
world

Variable and value ordering


• This intuitive idea—choosing the variable with the
fewest “legal” values—is called the minimum
remaining-values (MRV) heuristic also called most
constrained variable or fail first heuristic.
• The MRV heuristic doesn’t help at all in choosing
the first region
• degree heuristic attempts to reduce the branching
factor on future choices by selecting the variable
that is involved in the largest number of constraints
Go, change the
world

Variable and value ordering


• Once a variable has been selected, the algorithm
must decide on the order in which to examine its
values. For this, the least-constraining-value
heuristic can be effective.
• For example, suppose that the generated the
partial assignment with WA = red and NT = green
and next choice is for Q
Go, change the
world

Interleaving search and inference


• One of the simplest forms of inference is called
forward checking

• Maintaining Arc Consistency (MAC)) can be used as


solution to problem arising from forward checking
Go, change the

Intelligent backtracking: Looking


world

backward
• BACKTRACKING-SEARCH algorithm has a very
simple policy for what to do when a branch of the
search fails: back up to the preceding variable and
try a different value for it. This is called
chronological backtracking because the most recent
decision CHRONOLOGICAL BACKTRACKING point is
revisited.
Go, change the

Intelligent backtracking: Looking


world

backward
• Applying simple backtracking with a fixed variable
ordering Q, NSW , V , T, SA, WA, NT. Suppose we
have generated the partial assignment {Q = red,
NSW = green, V = blue, T = red}. When we try the
next variable, SA, we see that every value violates a
constraint.backtracking in the above case is of no
use.
• A more intelligent approach to backtracking is to
backtrack to a variable that might fix the problem—
a variable that was responsible for making one of
the possible values of SA impossible called
backjumping
Go, change the

Intelligent backtracking: Looking


world

backward
• Consider again the partial assignment {WA = red,
NSW = red} ,Suppose we try T = red next and then
assign NT, Q, V , SA.
• conflict-directed backjumping.
Go, change the
world

Logical Agents
• Knowledge-based agents
• Wumpus world
• Logic
• Propositional logic
• Propositional theorem proving
Go, change the
world

Logical agents
• Reasoning , operating on knowledge
representation, to deduce conclusions exhibiting
intelligence is part of knowledge-based agents.
• Logic is general class of representation to support
knowledge-based agents
• Knowledge base is the central component of
knowledge based agent.
• KB is set of sentences
• Each sentence is represented in knowledge
representation language
Go, change the
world

Logical agents
• Each sentence represents an assertion about the
world.
• Axiom is another term used for sentence
• Way to add new sentence to KB is TELL and way to
query KB is ASK.
• KB initially contains some background knowledge
Go, change the
world

Knowledge based agents


Go, change the
world

Actions of agent program


TELLS KB what it perceives
ASKS KB what action it should perform
TELLS KB which action was chosen

Details of representation are hidden inside


MAKE-PERCEPT-SENTENCE
MAKE-ACTION-QUERY
MAKE-ACTION-SEQUENCE
Go, change the
world

Knowledge based agent


• Declarative approach
• Procedural approach
Go, change the
world

Wumpus world
• The wumpus world is a cave consisting of rooms
connected by passageways.
• Lurking somewhere in the cave is the terrible
wumpus.
• The wumpus can be shot by an agent, but the agent
has only one arrow.
• Some rooms contain bottomless pits that will trap
anyone who wanders into these rooms (except for
the wumpus, which is too big to fall in)
Go, change the
world

Wumpus world
Go, change the
world

Wumpus world
• Performance measure: +1000 for climbing out of the cave
with the gold, –1000 for falling into a pit or being eaten by
the wumpus, –1 for each action taken and –10 for using up
the arrow. The game ends either when the agent dies or
when the agent climbs out of the cave.
• Environment:A 4 × 4 grid of rooms. The agent always starts
in the square labeled [1,1], facing to the right. The locations
of the gold and the wumpus are chosen randomly, with a
uniform distribution, from the squares other than the start
square. In addition, each square other than the start can be
a pit, with probability 0.2.
Go, change the
world

Wumpus world
• Actuators: The agent can move Forward, TurnLeft
by 90◦, or TurnRight by 90◦. The agent dies a
miserable death if it enters a square containing a
pit or a live wumpus. The action Grab can be used
to pick up the gold if it is in the same square as the
agent. The action Shoot can be used to fire an
arrow in a straight line in the direction the agent is
facing. Finally, the action Climb can be used to
climb out of the cave, but only from square [1,1]
Go, change the
world

Wumpus world
• Sensors: The agent has five sensors, each of which gives a
single bit of information: –
• In the square containing the wumpus and in the directly
adjacent squares, the agent will perceive a Stench.
• In the squares directly adjacent to a pit, the agent will
perceive a Breeze.
• In the square where the gold is, the agent will perceive a
Glitter.
• When an agent walks into a wall, it will perceive a Bump.
• When the wumpus is killed, it emits a woeful Scream that
can be perceived anywhere in the cave
Go, change the
world

Wumpus world
• Percept-The percepts will be given to the agent
program in the form of a list of five symbols;
• [Stench, Breeze, None, None, None].
Go, change the

a knowledge-based wumpus agent


world

exploring the environment


Go, change the

a knowledge-based wumpus agent


world

exploring the environment


Go, change the
world

Logic
• Logic must define the semantics
• Semantics must establish truth of each sentence with
respect to each possible world as either true or false
• logical entailment between sentences—the idea that a
sentence follows logically from another sentence. In
mathematical notation,
• we write α |= β
• The formal definition of entailment is this: α |= β if and only
if, in every model in which α is true, β is also true. Using the
notation just introduced, we can write α |= β if and only if
M(α) ⊆ M(β
Go, change the
world

Logic
• An inference algorithm that derives only entailed
sentences is called sound or truth preserving.
• The final issue to consider is grounding
Go, change the
world

Propositional logic:syntax
• The syntax of propositional logic defines the
allowable sentences.
• The atomic sentences consist of a single
proposition symbol.
• symbols that start with an uppercase letter and
may contain other letters or subscripts. Ex: for
example: P, Q, R, W1,3
• Complex sentences are constructed from simpler
sentences, using parentheses and logical
connectives
Go, change the
world

Propositional logic:syntax
• There are five connectives in common use:
¬ (not), ∧ (and), ∨ (or), ⇒ (implies), ⇔ (if and only
if)
Go, change the

A BNF (Backus–Naur Form)


world

grammar of sentences
Go, change the
world

Semantics
• The semantics defines the rules for determining the
truth of a sentence with respect to a particular
model.
• The semantics for propositional logic specify how to
compute the truth value of any sentence, given a
model.
Go, change the
world

Semantics
• For complex sentences, we have five rules
• ¬P is true iff P is false in m.
• P ∧ Q is true iff both P and Q are true in m.
• P ∨ Q is true iff either P or Q is true in m.
• P ⇒ Q is true unless P is true and Q is false in m.
• P ⇔ Q is true iff P and Q are both true or both
false in m.
Go, change the
world

Semantics
Go, change the
world

TT enumeration algorithm
Go, change the
world

Standard logic equivalences


Go, change the

Propositional theorem proving world

• Entailment can be done by Theorem proving—


applying rules of inference directly to the sentences
in our knowledge base to construct a proof of the
desired sentence without consulting models.
• The first concept is logical equivalence: two
sentences α and β are logically equivalent if they
are true in the same set of models. Written as α ≡
β. For example, it can be shown (using truth tables)
that P ∧ Q and Q ∧ P are logically equivalent
Go, change the

Propositional theorem proving world

• An alternative definition of equivalence is as


follows: any two sentences α and β are equivalent
only if each of them entails the other: α ≡ β if and
only if α |= β and β |= α.
• second concept is validity, A sentence is valid if it is
true in all models.
• the sentence P ∨ ¬P is valid
• Valid sentences are also known as tautologies—
they are necessarily true.
Go, change the

Propositional theorem proving world

• The third concept is satisfiability.


• A sentence is satisfiable if it is true in, or satisfied
by, some model.
Go, change the
world

Inference and proofs


• The best-known rule is called Modus Ponens and is
written as
• The notation means that, whenever any sentences
of the form α ⇒ β and α are given, then the
sentence β can be inferred.
• For example, if (WumpusAhead ∧WumpusAlive) ⇒
Shoot and (WumpusAhead ∧ WumpusAlive) are
given, then Shoot can be inferred
Go, change the
world

Inference and proofs


• Another inference rule is And-Elimination, which
says that, from a conjunction, any of the conjuncts
can be inferred:
Go, change the
world

Inference and proofs


• the equivalence for biconditional elimination yields
the two inference rules

• One final property of logical systems is


monotonicity, which says that the set of entailed
sentences can only increase as information is added
to the knowledge base.
Go, change the
world

Conjunctive Normal Form


• A sentence expressed as a conjunction of clauses is
said to be in conjunctive normal form(CNF)
Go, change the

converting the sentence B1,1 ⇔


world

(P1,2 ∨ P2,1) into CNF


1. Eliminate ⇔, replacing α ⇔ β with (α ⇒ β) ∧ (β ⇒ α).
• (B1,1 ⇒ (P1,2 ∨ P2,1)) ∧ ((P1,2 ∨ P2,1) ⇒ B1,1) .
2. Eliminate ⇒, replacing α ⇒ β with ¬α ∨ β:
• (¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬(P1,2 ∨ P2,1) ∨ B1,1) .
3. CNF requires ¬ to appear only in literals, so we “move ¬
inwards” by repeated application of the following
equivalences
¬(¬α) ≡ α (double-negation elimination)
¬(α ∧ β) ≡ (¬α ∨ ¬β) (De Morgan)
¬(α ∨ β) ≡ (¬α ∧ ¬β) (De Morgan)
Go, change the

converting the sentence B1,1 ⇔


world

(P1,2 ∨ P2,1) into CNF


• Applying above rule we have,
• (¬B1,1 ∨ P1,2 ∨ P2,1) ∧ ((¬P1,2 ∧ ¬P2,1) ∨ B1,1) .
4. Now we have a sentence containing nested ∧ and
∨ operators applied to literals. We apply the
distributivity law , distributing ∨ over ∧ wherever
possible.
(¬B1,1 ∨ P1,2 ∨ P2,1) ∧ (¬P1,2 ∨ B1,1) ∧ (¬P2,1 ∨
B1,1) .
The original sentence is now in CNF, as a conjunction
of three clauses
Go, change the
world

Proof by resolution
• if the available inference rules are inadequate,
resolution, that yields a complete inference
algorithm when coupled with any complete search
algorithm.
• Inference procedures based on resolution work by
using the principle of proof by contradiction
• to show that KB |= α, we show that (KB ∧ ¬α) is
unsatisfiable.
Go, change the

Proof By Contradiction world

• Assume the opposite of your conclusion.


• Use the assumption to derive new consequences
until one is the opposite of your premise.
• Conclude that the assumption must be false and
that its opposite (your original conclusion) must be
true.
Go, change the
world

A resolution algorithm
Go, change the
world

A resolution algorithm
• The process continues until one of two things
happens:
• there are no new clauses that can be added, in
which case KB does not entail α; or,
• two clauses resolve to yield the empty clause, in
which case KB entails α
Go, change the
world

Horn clauses and definite clauses


• definite clause, which is a disjunction of literals of
which exactly one is positive.
• Slightly more general is the Horn clause, which is a
disjunction of literals of which at most one is
positive. So all definite clauses are Horn clauses,
• clauses with no positive GOAL CLAUSES literals;
these are called goal clauses
Go, change the
world

Forward and backward chaining


• The forward-chaining algorithm (KB, q) determines
if a single proposition symbol q—the query—is
entailed by a knowledge base of definite clauses.
• It begins from known facts (positive literals) in the
knowledge base
• If all the premises of an implication are known,
then its conclusion is added to the set of known
facts.
• This process continues until the query q is added or
until no further inferences can be made
Go, change the
world

Forward Chaining
Go, change the
world

Backward Chaining
• The backward-chaining algorithm, as its name
suggests, works backward from the query. If the
query q is known to be true, then no work is
needed.
• Otherwise, the algorithm finds those implications in
the knowledge base whose conclusion is q.
• If all the premises of one of those implications can
be proved true (by backward chaining), then q is
true
Go, change the
world

Set of Horn clauses, and-or graph


Go, change the
world

First Order Logic


• Syntax and semantics of first-order logic
• Using first order logic
Go, change the
world

First Order Logic


• models for propositional logic link proposition symbols to
predefined truth values.
• Models for first-order logic are much more interesting
• The domain of a model is the set of objects or domain
elements it contains.
• The objects in the model may be related in various ways, a
relation is just the set of tuples of objects that are related.
• A tuple is a collection of objects arranged in a fixed order
and is written with angle brackets surrounding the objects.
Go, change the
world

Symbols
• The basic syntactic elements of first-order logic are
the symbols that stand for objects, relations, and
functions.
• The symbols, therefore, come in three kinds:
• constant symbols-which stand for objects
• predicate symbols-stands for relations
• function symbols-stands for functions
Symbols begin with upper case letters
Go, change the
world

Interpretation
• in addition to its 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 symbols.
• A term is a logical expression that refers to an
object. Constant symbols are therefore terms, but it
is not always convenient to have a distinct symbol
to name every object.
Go, change the
world

Atomic sentences
• 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).
• Married(Father (Richard), Mother (John))- atomic
sentences having complex terms as arguments.
• logical connectives can be used to construct more
complex sentences,.
Go, change the
world

Complex sentences
• Brother (Richard, John) ∧ Brother (John, Richard)
• King(Richard) ∨ King(John)
• ¬King(Richard) ⇒ King(John)
Go, change the
world

Universal quantification
• “All kings are persons,” is written in first-order logic
as

• ∀ x King(x) ⇒ Person(x) .
• the sentence ∀ x P, where P is any logical
expression, says that P is true for every object x.
Go, change the
world

Existential quantification (∃)


• Universal quantification makes statements about
every object. Similarly, we can make a statement
about some object in the universe without naming
it, by using an existential quantifier
• that King John has a crown on his head,
• ∃ x Crown(x) ∧ OnHead(x, John) .
• ∃ x P says that P is true for at least one object x
Go, change the
world

Nested quantifiers
• “Brothers are siblings”
• ∀ x ∀ y Brother (x, y) ⇒ Sibling(x, y) .

• siblinghood is a symmetric relationship


• ∀ x, y Sibling(x, y) ⇔ Sibling(y, x) .

• “Everybody loves somebody”


• ∀ x ∃ y Loves(x, y)
Go, change the
world

Nested quantifiers
• “There is someone who is loved by everyone,”
∃ y ∀ x Loves(x, y)

“Everyone likes ice cream”


: ∀ x Likes(x,IceCream) is equivalent to
¬∃ x ¬Likes(x,IceCream
Go, change the
world

De Morgans rules
• The De Morgan rules for quantified and
unquantified sentences are as follows:

Go, change the
world

Equality
• equality symbol to signify that two terms refer to
the same object.
• Father (John) = Henry says that the object referred
to by Father (John) and the object referred to by
Henry are the same.
Go, change the
world

Assertions and queries in FOL


• Sentences are added to a knowledge base using
TELL. Such sentences are called assertions.
• TELL(KB, King(John)) .
• TELL(KB, Person(Richard)) .
• TELL(KB, ∀ x King(x) ⇒ Person(x)) .
• ask questions of the knowledge base using ASK
• ASK(KB, King(John))
• Questions asked with ASK are called queries or
goals.

You might also like