0% found this document useful (0 votes)
2 views

A_ Algorithm Optimalit

The A* algorithm is optimal when the heuristic is admissible for tree-search and consistent for graph-search, ensuring that the f(n) values are non-decreasing along any path. It expands nodes in order of increasing f(n) and prunes subtrees with f(n) greater than the optimal cost, making it efficient. However, A* can be impractical for large problems due to its exponential time complexity and high memory usage.

Uploaded by

VIVEK H.S.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

A_ Algorithm Optimalit

The A* algorithm is optimal when the heuristic is admissible for tree-search and consistent for graph-search, ensuring that the f(n) values are non-decreasing along any path. It expands nodes in order of increasing f(n) and prunes subtrees with f(n) greater than the optimal cost, making it efficient. However, A* can be impractical for large problems due to its exponential time complexity and high memory usage.

Uploaded by

VIVEK H.S.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

A* Algorithm Optimality

As we mentioned earlier, A∗ has the following properties: the tree-search version of A∗ is


optimal if h(n) is admissible, while the graph-search version is optimal if h(n) is consistent.
We show the second of these two claims since it is more useful. The argument es
sentially mirrors the argument for the optimality of uniform-cost search, with g replaced by
f—just as in the A∗ algorithm itself.
The first step is to establish the following: if h(n) is consistent, then the values of
f(n) along any path are nondecreasing. The proof follows directly from the definition of
consistency. Suppose n is a successor of n; theng(n)=g(n)+c(n,a,n) for some action
a, and we have
f(n)=g(n)+h(n)=g(n)+c(n,a,n)+h(n) ≥ g(n)+h(n)=f(n).
The next step is to prove that whenever A∗ selects a node n for expansion, the optimal path
to that node has been found. Were this not the case, there would have to be another frontier
node n on the optimal path from the start node to n, by the graph separation property of
9 Withan admissible but inconsistent heuristic, A∗ requires some extra bookkeeping to ensure
optimality.
96
Chapter 3.
Solving Problems by Searching
(a) The initial state
(b) After expanding Arad
Arad
366=0+366
Arad
Sibiu
393=140+253
(c) After expanding Sibiu
Sibiu
Timisoara
447=118+329
Arad
Zerind
449=75+374
Timisoara
Arad
Fagaras
646=280+366
Oradea
415=239+176 671=291+380
Rimnicu Vilcea
413=220+193
(d) After expanding Rimnicu Vilcea
Sibiu
447=118+329
Arad

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 1/15
Zerind
449=75+374
Timisoara
Arad
Fagaras
Oradea
646=280+366 415=239+176 671=291+380
(e) After expanding Fagaras
447=118+329
Rimnicu Vilcea
Craiova
Pitesti
526=366+160
417=317+100
Sibiu
553=300+253
Zerind
449=75+374
Arad
Sibiu
Arad
646=280+366
Fagaras
Oradea
Timisoara
447=118+329
Rimnicu Vilcea
671=291+380
Sibiu
Bucharest
591=338+253 450=450+0
Craiova
526=366+160
Pitesti
417=317+100
(f) After expanding Pitesti
Sibiu
Arad
646=280+366
Fagaras
Oradea
Arad
Timisoara
Zerind
449=75+374
Sibiu
553=300+253
447=118+329
Rimnicu Vilcea
671=291+380
Sibiu
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 2/15
Bucharest
591=338+253 450=450+0
Craiova
526=366+160
Pitesti
Sibiu
553=300+253
Bucharest
418=418+0
Figure 3.24
Craiova
Rimnicu Vilcea
615=455+160 607=414+193
Zerind
449=75+374
Stages in an A∗ search for Bucharest. Nodes are labeled with f = g+h.The
h values are the straight-line distances to Bucharest taken from Figure 3.22.
Section 3.5.
Informed (Heuristic) Search Strategies
97
O
Z
A
380
T
N
S
400
L
R
F
I
V
P
M
D
Figure 3.25
420
C
H
B
U
G
E
Mapof Romania showing contours at f = 380, f = 400,andf = 420, with
Arad as the start state. Nodes inside a given contour have f-costs less than or equal to the
contour value.
CONTOUR
Figure 3.9; because f is nondecreasing along any path, nwould have lower f-cost than n
and would have been selected first.
From the two preceding observations, it follows that the sequence of nodes expanded
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 3/15
by A∗ using GRAPH-SEARCH is in nondecreasing order of f(n). Hence, the first goal node
selected for expansion must be an optimal solution because f is the true cost for goal nodes
(which have h=0) and all later goal nodes will be at least as expensive.
The fact that f-costs are nondecreasing along any path also means that we can draw
contours in the state space, just like the contours in a topographic map. Figure 3.25 shows
an example. Inside the contour labeled 400, all nodes have f(n) less than or equal to 400,
and so on. Then, because A∗ expands the frontier node of lowest f-cost, we can see that an
A∗ search fans out from the start node, adding nodes in concentric bands of increasing f-cost.
With uniform-cost search (A∗ search using h(n)=0), the bands will be “circular”
around the start state. With more accurate heuristics, the bands will stretch toward the goal
state and become more narrowly focused around the optimal path. If C∗ is the cost of the
optimal solution path, then we can say the following:
• A∗ expands all nodes with f(n) <C∗.
• A∗mightthen expand some ofthe nodes right on the “goal contour” (where f(n)=C∗)
before selecting a goal node.
Completeness requires that there be only finitely many nodes with cost less than or equal to
C∗, a condition that is true if all step costs exceed some finite and if b is finite.
Notice that A∗ expands no nodes with f(n) >C∗—for example, Timisoara is not
expanded in Figure 3.24 even though it is a child of the root. We say that the subtree below
98
Chapter 3.
Solving Problems by Searching
PRUNING
OPTIMALLY
EFFICIENT
ABSOLUTE ERROR
RELATIVE ERROR
Timisoara is pruned; because hSLD is admissible, the algorithm can safely ignore this subtree
while still guaranteeing optimality. The concept of pruning—eliminating possibilities from
consideration without having to examine them—is important for many areas of AI.
One final observation is that among optimal algorithms of this type—algorithms that
extend search paths from the root and use the same heuristic information—A∗ is optimally
efficient for any given consistent heuristic. That is, no other optimal algorithm is guaran
teed to expand fewer nodes than A∗ (except possibly through tie-breaking among nodes with
f(n)=C∗). This is because any algorithm that does not expand all nodes with f(n) <C∗
runs the risk of missing the optimal solution.
That A∗ search is complete, optimal, and optimally efficient among all such algorithms
is rather satisfying. Unfortunately, it does not mean that A∗ is the answer to all our searching
needs. The catch is that, for most problems, the number of states within the goal contour
search space is still exponential in the length of the solution. The details of the analysis are
beyond the scope of this book, but the basic results are as follows. For problems with constant
step costs, the growth in run time as a function of the optimal solution depth d is analyzed in
terms of the the absolute error or the relative error of the heuristic. The absolute error is
defined as Δ ≡ h∗ −h,whereh∗ is the actual cost of getting from the root to the goal, and
the relative error is defined as ≡ (h∗ − h)/h∗.
The complexity results depend very strongly on the assumptions made about the state
space. The simplest model studied is a state space that has a single goal and is essentially a
tree with reversible actions. (The 8-puzzle satisfies the first and third of these assumptions.)
In this case, the time complexity of A∗ is exponential in the maximum absolute error, that is,
O(bΔ). For constant step costs, we can write this as O(b d),whered is the solution depth.
For almost all heuristics in practical use, the absolute error is at least proportional to the path
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 4/15
cost h∗, so is constant or growing and the time complexity is exponential in d. We can
also see the effect of a more accurate heuristic: O(b d)=O((b)d), so the effective branching
factor (defined more formally in the next section) is b .
When the state space has many goal states—particularly near-optimal goal states—the
search process can be led astray from the optimal path and there is an extra cost proportional
to the number of goals whose cost is within a factor of the optimal cost. Finally, in the
general case of a graph, the situation is even worse. There can be exponentially many states
with f(n) <C∗ even if the absolute error is bounded by a constant. For example, consider
a version of the vacuum world where the agent can clean up any square for unit cost without
even having to visit it: in that case, squares can be cleaned in any order. With N initially dirty
squares, there are 2N states where some subset has been cleaned and all of them are on an
optimal solution path—and hence satisfy f(n) <C∗—even if the heuristic has an error of 1.
The complexity of A∗ often makes it impractical to insist on finding an optimal solution.
One can use variants of A∗ that find suboptimal solutions quickly, or one can sometimes
design heuristics that are more accurate but not strictly admissible. In any case, the use of a
good heuristic still provides enormous savings compared to the use of an uninformed search.
In Section 3.6, we look at the question of designing good heuristics.
Computation time is not, however, A∗’s main drawback. Because it keeps all generated
nodes in memory (as do all GRAPH-SEARCH algorithms), A∗ usually runs out of space long
Section 3.5.
Informed (Heuristic) Search Strategies
99
function RECURSIVE-BEST-FIRST-SEARCH(problem) returns a solution, or failure
return RBFS(problem,MAKE-NODE(problem.INITIAL-STATE),∞)
function RBFS(problem,node,f limit) returns a solution,orfailure and a new f-cost limit
if problem.GOAL-TEST(node.STATE) then return SOLUTION(node)
successors ←[]
for each action in problem.ACTIONS(node.STATE) do
add CHILD-NODE(problem,node,action) intosuccessors
if successors is empty then return failure, ∞
for each s in successors do /* update f with value from previous search, if any */
s.f ←max(s.g + s.h, node.f))
loop do
best ←the lowest f-value node in successors
if best.f > f limit then return failure, best.f
alternative ←the second-lowest f-value among successors
result,best.f ←RBFS(problem,best,min(f limit,alternative))
if result= failure then return result
Figure 3.26
The algorithm for recursive best-first search.
before it runs out of time. For this reason, A∗ is not practical for many large-scale prob
lems. There are, however, algorithms that overcome the space problem without sacrificing
optimality or completeness, at a small cost in execution time. We discuss these next. in simple
words explain this concept

The passage elaborates on the properties and behavior of the A* search algorithm, focusing on its
completeness, optimality, and efficiency under different heuristic conditions. Here's a concise
breakdown of the key points:

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 5/15
Key Properties of A*

1. Optimality:
Tree-Search: A* is optimal if the heuristic h(n) is admissible (never overestimates the true
cost to reach the goal).
Graph-Search: A* is optimal if h(n) is consistent (satisfies the triangle inequality: h(n) ≤
c(n, a, n′ ) + h(n′ )).
2. Non-Decreasing f (n):

When h(n) is consistent, the f (n) = g(n) + h(n) values along any path are non-decreasing.
This follows from the consistency property.
3. Expansion of Nodes:
A* ensures that when a node is expanded, the optimal path to that node has already been
found.
The sequence of node expansions is in non-decreasing order of f (n).
4. Contours in State Space:
Nodes are expanded in concentric bands of increasing f (n) values. This is similar to
topographic contours where nodes inside a contour have f (n) ≤ contour value.
The algorithm expands all nodes with f (n) < C ∗ (optimal cost) and possibly some nodes on
the goal contour (f (n) = C ∗ ).
5. Pruning:
Subtrees with f (n) > C ∗ are pruned, ensuring efficiency without sacrificing optimality when
h(n) is admissible.
6. Optimal Efficiency:
Among algorithms that extend paths using the same heuristic information, A* is optimally
efficient—it expands the fewest nodes necessary, given a consistent heuristic.

Limitations of A*

1. Exponential Time Complexity:


For large state spaces, the time complexity of A* is exponential, driven by the depth d of the
solution and the heuristic's absolute or relative error.
2. Memory Usage:
A* maintains all generated nodes in memory, leading to high space complexity and potential
exhaustion of available memory.
3. Practicality:
For many problems, A*'s space and time requirements make it impractical for finding an
optimal solution. Alternatives include:
Variants that find suboptimal solutions more quickly.
Heuristics that are more accurate but not strictly admissible.
4. Multiple Goal States:
When there are many near-optimal goals, the search can become less focused, increasing
computational cost.

Conclusion

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 6/15
A* is a powerful algorithm that balances completeness, optimality, and efficiency when guided by a
consistent heuristic. Despite its strengths, its exponential time and space complexities pose significant
challenges for large-scale problems, leading to the need for alternative strategies or heuristic
improvements.

in simple point exaplain

Here’s a simplified explanation of A* search and its properties:

1. Optimality:
A* is optimal (finds the best solution) if:
The heuristic h(n) is admissible (it never overestimates the true cost to the goal) for
tree-search.
The heuristic h(n) is consistent (for any node n and its successor, the estimated cost is
less than or equal to the step cost plus the estimated cost from the successor) for
graph-search.
2. Nondecreasing f(n):
If the heuristic is consistent, the value of f(n) = g(n) + h(n) (cost so far + estimated cost to
goal) along any path does not decrease. This ensures proper ordering of nodes for expansion.
3. Node Expansion:
When A* selects a node n for expansion, it guarantees that the optimal path to n has already
been found.
Nodes with lower f(n) are always expanded first.
4. Contours of f(n):
Nodes are expanded in increasing order of f(n). This creates "contours" (bands) of nodes with
similar f(n) values.
The search focuses more narrowly on the optimal path when the heuristic is accurate.
5. Efficiency and Drawbacks:
A* is optimally efficient for any consistent heuristic—it expands the minimum number of
nodes necessary to guarantee an optimal solution.
However, A* can run out of memory quickly because it keeps all generated nodes in memory.
In large problems, this can make A* impractical.

Explain the Knowledge–based agents with an algorithm and explain the


TELL and ASK functions used for same.

Knowledge-Based Agents

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 7/15
A knowledge-based agent is an AI agent that acts based on the knowledge it possesses about the
world. It uses a knowledge base (KB) to store facts and rules and employs reasoning mechanisms to
deduce actions.

Components of a Knowledge-Based Agent

1. Knowledge Base (KB):


A repository of facts and rules about the environment.
Represented using formal logic or other symbolic representations.
2. Inference Engine:
Mechanism to derive new knowledge or make decisions using the existing knowledge base.
3. TELL Function:
Adds new knowledge (facts or rules) to the knowledge base.
4. ASK Function:
Queries the knowledge base to retrieve information or validate facts.

Algorithm for a Knowledge-Based Agent

Algorithm:

1. Initialize KB: Start with a knowledge base containing prior knowledge.


2. Perceive Environment:
Use sensors to perceive the current state of the environment.
3. Update KB using TELL:
Add new perceptual information to the KB.
4. Query KB using ASK:
Use the ASK function to infer actions based on the current knowledge.
5. Act:
Choose the action based on inference and execute it.
6. Repeat:
Loop through the above steps as the environment changes.

TELL and ASK Functions

1. TELL(KB, Sentence):
Adds the given sentence (fact or rule) to the KB.
Updates the KB to reflect new knowledge.
Example:
`TELL(KB, "It is raining")`
Adds the fact "It is raining" to the KB.
2. ASK(KB, Query):
Queries the KB to check if the query is entailed by the KB.
Returns a result (true/false or specific values).
Example:
`ASK(KB, "Is it raining?")`
Returns true if the KB contains "It is raining".

Example of a Knowledge-Based Agent


Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 8/15
Scenario:
An agent is tasked to turn on a sprinkler if it’s not raining and the garden is dry.

Algorithm:

python

function KNOWLEDGE_BASED_AGENT(percept):
KB ← InitializeKB()
TELL(KB, percept) # Add the current percept to KB
if ASK(KB, "Is it raining?") = true:
action ← "Do nothing"
else if ASK(KB, "Is the garden dry?") = true:
action ← "Turn on the sprinkler"
else:
action ← "Do nothing"
return action

Explanation of TELL and ASK in the Example

1. TELL Function:
Adds percepts like "It is raining" or "The garden is dry" to the KB.
Example:
`TELL(KB, "It is raining")` updates the KB with the current weather condition.
2. ASK Function:
Queries the KB to make decisions.
Example:
`ASK(KB, "Is it raining?")` retrieves the fact from the KB to determine the next action.

Advantages of Knowledge-Based Agents

Can make intelligent decisions based on knowledge.


Able to learn and update their knowledge over time.
Flexible in dealing with dynamic environments.

Limitations

Complex to design for large-scale systems.


Computationally expensive due to reasoning mechanisms.

Considering Wumpus world example give the characteristics and simple


knowledge base using propositional logic and Prove that Wumpus is in the
room (1, 3).

Wumpus World Example

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 9/15
The Wumpus World is a classic AI problem that consists of a grid-based environment. The agent
navigates through the grid to find gold while avoiding pits and the Wumpus (a dangerous creature). The
agent senses the environment using percepts like breeze, stench, and glitter.

Characteristics of the Wumpus World

1. Fully or Partially Observable: Partially observable as the agent only perceives its immediate
surroundings.
2. Deterministic: Actions have deterministic outcomes.
3. Discrete: The grid-based environment is divided into distinct rooms.
4. Static: The environment does not change while the agent is deliberating.
5. Single Agent: Only one agent navigates the grid.

Knowledge Base in Propositional Logic

Propositions

P (x, y): There is a pit in room (x, y).


W (x, y): The Wumpus is in room (x, y).
B(x, y): There is a breeze in room (x, y).
S(x, y): There is a stench in room (x, y).
OK(x, y): Room (x, y) is safe.

Rules in Propositional Logic

1. Breeze and Pit Relationship:


B(x, y) ⟺ P (x + 1, y) ∨ P (x − 1, y) ∨ P (x, y + 1) ∨ P (x, y − 1)
2. Stench and Wumpus Relationship:
S(x, y) ⟺ W (x + 1, y) ∨ W (x − 1, y) ∨ W (x, y + 1) ∨ W (x, y − 1)
3. Wumpus Uniqueness:
∃!W (x, y) (Only one Wumpus exists in the grid).

Knowledge Base (KB)

1. There is a stench in room (1, 2):


S(1, 2).
2. There is no stench in room (2, 2):
¬S(2, 2).
3. The stench implies Wumpus in adjacent rooms:
S(1, 2) ⟺ W (1, 3) ∨ W (2, 2).
4. There is no Wumpus in (2, 2):
¬W (2, 2).

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 10/15
Prove that the Wumpus is in Room (1, 3)

Given KB:

1. S(1, 2).
2. ¬S(2, 2).
3. S(1, 2) ⟺ W (1, 3) ∨ W (2, 2).
4. ¬W (2, 2).

Steps:

1. From Rule 3 and Fact 1:


S(1, 2) ⟺ W (1, 3) ∨ W (2, 2).
Substituting S(1, 2) = true:
true ⟺ W (1, 3) ∨ W (2, 2).
2. Simplify using Fact 4 (¬W (2, 2)):
W (1, 3) ∨ f alse.
Therefore, W (1, 3) = true.

3. Thus, the Wumpus is in room (1, 3).

Conclusion

Using propositional logic and the knowledge base, we proved that the Wumpus is in room (1, 3).

The models of a logical language are the formal structures that constitute the possible worlds under
consideration. Each model links the vocabulary of the logical sentences to elements of the possible
world,
so that the truth of any sentence can be determined. Thus, models for propositional logic link
proposition
symbols to predefined truth values. Models for first-order logic have objects. The domain of a model
is the
set of objects or domain elements it contains. The domain is required to be nonempty—every
possible world
must contain at least one object.
A relation is just the set of tuples of objects that are related.
• Unary Relation: Relations relates to single Object.
• Binary Relation: Relation Relates to multiple objects Certain kinds of relationships are best
considered as functions, in that a given object must be related to exactly one object.
For Example:
Richard the Lionheart, King of England from 1189 to 1199; His younger brother, the evil King John,
who
ruled from 1199 to 1215; the left legs of Richard and John; crown Unary Relation: John is a king
Binary
Relation : crown is on head of john , Richard is brother ofjohn The unary "left leg" function includes
the

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 11/15
following mappings:
(Richard the Lionheart) ->Richard's left leg (King John) ->Johns left Leg explain in understanding way

The explanation deals with logical models and how they represent relationships and functions in
logical languages like propositional and first-order logic. Let’s break it down into simple terms:

What is a Logical Model?

A logical model is like a blueprint for a possible world. It defines:

1. Objects: Things in the world (e.g., people, animals, items).


2. Relations: How objects are connected or related to each other.
3. Functions: Specific types of relationships where one object is connected to exactly one other
object.

This helps determine the truth of logical sentences in the world.

Types of Relations in a Logical Model

1. Unary Relation:
Describes a property or characteristic of a single object.
Example:
"John is a king."
This is a unary relation because it tells us something about John alone.
2. Binary Relation:
Describes a relationship between two objects.
Example:
"The crown is on the head of John."
Here, two objects (crown and John) are connected by a relationship (is on the head of).

Functions as Special Relationships

A function is a relationship where:

Each input (object) is linked to exactly one output (object).


Example:
The left leg function maps a person to their left leg:
Richard the Lionheart → Richard’s left leg.
King John → John’s left leg.
This is a function because each person has exactly one left leg.

Example in the Context of Richard the Lionheart and King John

1. Objects in the Model:


Richard the Lionheart.
King John.
Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 12/15
The crown.
Their left legs.
2. Unary Relation:
"John is a king": This tells us about a single object (John).
3. Binary Relation:
"The crown is on the head of John": This links two objects (the crown and John) in a specific
relationship.
4. Function:
The left leg function:
Input: Richard or John.
Output: Richard’s left leg or John’s left leg.

Key Points

Unary relations focus on a single object (e.g., "is a king").


Binary relations describe connections between two objects (e.g., "crown is on head").
Functions are relationships where one object maps to exactly one other object (e.g., left leg
function).

Logical models provide a framework to describe and reason about such relationships in any possible
world.

main what it is saying i am not able to understand

Let me simplify further! 😊


What the Explanation is About

The text is talking about logical models and how they describe relationships between objects in a world.
A logical model uses relations and functions to explain how objects are connected. Here's what each
term means:

Key Concepts

1. Logical Model:
It’s like a way to describe a world.
It includes:
Objects: Things like people, animals, or items (e.g., Richard, John, crown).
Relations: How these things are connected (e.g., “John is a king” or “The crown is on
John’s head”).
Functions: Special relationships where one object is related to exactly one other object
(e.g., “John’s left leg”).

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 13/15
Types of Relations

1. Unary Relation:
Describes something about one object.
Example: “John is a king.”
It tells us about John only.
2. Binary Relation:
Describes a relationship between two objects.
Example: “The crown is on John’s head.”
This connects two objects: the crown and John.
3. Function:
A type of relationship where one object is connected to only one other object.
Example: The left leg function:
Richard → Richard’s left leg.
John → John’s left leg.
Each person is related to exactly one left leg.

Simple Example

Imagine a world with:

Objects: Richard, John, crown.


Unary Relation: “John is a king.”
Binary Relation: “The crown is on John’s head.”
Function: “John’s left leg.”

This model explains how these objects are connected and helps us reason about this world.

Why It’s Useful

Logical models let us organize information and figure out if statements about the world are true. For
example:

If you know “John is a king” and “The crown is on John’s head,” you can use these relationships to
understand the world.

Does this make more sense now? 😊

in one line explain the example

The example describes a world where John is a king (unary relation), the crown is on John’s head
(binary relation), and each person has a unique left leg (function).

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 14/15
The objects in Kinship domain are people. We have 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.
We use functions for Mother and Father, because every person has exactly one of each of these.
We can represent each function and predicate, writing down what we know in terms of the other
symbols.

In the kinship domain:

1. Objects: People (e.g., John, Mary).

2. Unary Predicates:
Male(x): x is a male.
Female(x): x is a female.
3. Binary Predicates:
Parent(x, y): x is a parent of y.
Sibling(x, y): x and y are siblings.
Brother(x, y): x is a brother of y.
Sister(x, y): x is a sister of y.
Child(x, y): x is a child of y.
Daughter(x, y): x is a daughter of y.
Son(x, y): x is a son of y.
Spouse(x, y): x is a spouse of y.
Wife(x, y): x is the wife of y.
Husband(x, y): x is the husband of y.
Grandparent(x, y): x is a grandparent of y.
Grandchild(x, y): x is a grandchild of y.
Cousin(x, y): x is a cousin of y.
Aunt(x, y): x is an aunt of y.
Uncle(x, y): x is an uncle of y.
4. Functions:
Mother(x): Returns the mother of x.
Father(x): Returns the father of x.

Example Representation:

Parent(Mary, John): Mary is the parent of John.


Male(John): John is male.
Sibling(John, Alice): John and Alice are siblings.
Mother(John) = Mary: Mary is John’s mother.

Printed using Save ChatGPT as PDF, powered by PDFCrowd HTML to PDF API. 15/15

You might also like