Ai Unit 3 Notes
Ai Unit 3 Notes
AI Unit 3 notes
What to Represent:
o Object: All the facts about objects in our world domain. E.g., Guitars contains
strings, trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behavior which involves knowledge about how to do
things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the
knowledge base. It is represented as KB. The Knowledgebase is a group of the
Sentences (Here, sentences are used as a technical term and not identical with
the English language).
Types of knowledge
1. Declarative Knowledge:
2. Procedural Knowledge
3. Meta-knowledge:
4. Heuristic knowledge:
5. Structural knowledge:
Propositional logic (PL) is the simplest form of logic where all the statements are made by
representation in propositions. A proposition is a declarative statement which is either true or
false. It is a technique of knowledge logical and mathematical form.
Example:
1. a) It is Sunday.
2. b) The Sun rises from West (False proposition)
3. c) 3+3= 7(False proposition)
4. d) 5 is a prime number.
The syntax of propositional logic defines the allowable sentences for the knowledge
representation. There are two types of Propositions:
a. Atomic Propositions
b. Compound propositions
Example:
Example:
Truth Table:
In propositional logic, we need to know the truth values of propositions in all possible
scenarios. We can combine all the possible combination with logical connectives, and
the representation of these combinations in a tabular format is called Truth table.
Following are the truth table for all logical connectives:
Properties of Operators:
o Commutativity:
o P∧ Q= Q ∧ P, or
o P ∨ Q = Q ∨ P.
o Associativity:
o (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
o (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
o Identity element:
o P ∧ True = P,
o P ∨ True= True.
o Distributive:
o P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
o P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
o DE Morgan's Law:
o ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
o ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
o Double-negation elimination:
o ¬ (¬P) = P.
First-Order logic:
o First-order logic is another way of knowledge representation in artificial
intelligence. It is an extension to propositional logic.
o FOL is sufficiently expressive to represent the natural language statements in a
concise way.
o First-order logic is also known as Predicate logic or First-order predicate
logic. First-order logic is a powerful language that develops information about
the objects in a more easy way and can also express the relationship between
those objects.
o First-order logic (like natural language) does not only assume that the world
contains facts like propositional logic but also assumes the following things in
the world:
o Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
o Relations: It can be unary relation such as: red, round, is adjacent, or
n-any relation such as: the sister of, brother of, has color, comes between
o Function: Father of, best friend, third inning of, end of, ......
o As a natural language, first-order logic also has two main parts:
a. Syntax
b. Semantics
Atomic sentences:
o Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
o We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Complex Sentences:
o Complex sentences are made by combining atomic sentences using connectives.
Variables x, y, z, a, b,....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
o Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
o We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Complex Sentences:
o Complex sentences are made by combining atomic sentences using connectives.
Consider the statement: "x is an integer.", it consists of two parts, the first part x is
the subject of the statement and second part "is an integer," is known as a predicate.
Universal Quantifier:
Universal quantifier is a symbol of logical representation, which specifies that the
statement within its range is true for everything or every instance of a particular thing.
o For all x
o For each x
o For every x.
Example:
All man drink coffee.
Let a variable x which refers to a cat so all x can be represented in UOD as below:
It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:
Existential quantifiers are the type of quantifiers, which express that the statement
within its scope is true for at least one instance of something.
If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
It will be read as: There are some x where x is a boy who is intelligent.
Points to remember:
o The main connective for universal quantifier ∀ is implication →.
o The main connective for existential quantifier ∃ is and ∧.
Properties of Quantifiers:
o In universal quantifier, ∀x∀y is similar to ∀y∀x.
o In Existential quantifier, ∃x∃y is similar to ∃y∃x.
o ∃x∀y is not similar to ∀y∃x.
Situation Calculus
The situation calculus is a logical language for representing changes. The Situation
Calculus is a logic formalism designed for representing and reasoning about dynamical
domains.
In First-Order Logic, sentences are either true or false and stay that way. Nothing is
corresponding to any sort of change.
Situation Calculus :
Basic Elements
in(robot, kitchen)
in(robot, livingRoom)
in(robot,kitchen,2:02pm)
in(robot,livingRoom,2:17pm)
The Situation Calculus is a logic formalism for representing and reasoning about
dynamic domains.
The basic concepts in the situation calculus are situations, actions and
fluent. Briefly, actions are what make the dynamic world change from one situation to
another when performed by agents. Fluents are situation-dependent functions used to
describe the effects of actions.
There are two kinds of them, relational fluents and functional fluent .
The former have only two values: true or false, while the latter can take a range of values.
For instance, one may have a relational fluent called handempty which is true in a situation
if the robot’s hand is not holding anything. We may need a relation like this in a robot
domain.
One may also have a functional fluent called battery-level whose value in a situation is an
integer between 0 and 100 denoting the total battery power remaining on one’s laptop
computer.
To describe a dynamic domain in the situation calculus, one has to decide on the set of
actions available for the agents to perform, and the set of fluents needed to describe the
changes these actions will have on the world.
For example, consider the classic blocks world where some blocks of equal size can be
arranged into a set of towers on a table. The set of actions in this domain depends on what
the imaginary agent can do. If we imagine the agent to be a one-handed robot that can be
Downloaded by Sasi Prabha Singaravelu ([email protected])
lOMoARcPSD|44893945
directed to grasp any block that is on the top of a tower, and either add it to the top of
another tower or put it down on the table to make a new tower, then we can have the
following actions .
stack(x, y)—put block x on block y, provided the robot is holding x, and y is clear, i.e. there
is no other block on it;
• unstack(x, y)—pick up block x from block y, provided the robot’s hand is empty, x is on
y, and x is clear;
• pickup(x)—pick up block x from the table, provided the robot’s hand is empty, x is on the
table and clear.
To describe the effects of these actions, we can use the following relational fluents:
• clear(x)—true in a situation if block x is the top block of a tower, i.e. the robot is not
holding it, and there is no other block on it.
If, however, the agent in this world can move a block from a clear position to another clear
position, then we only need the following action:
• move(x, y)—move block x to position y, provided that block x is clear to move, where a
position is either a block or the table.
To summarize, the situation calculus is a first-order language with the following special
sorts: situation, action, and fluent (for relational fluents). There could be other sorts, some of
them domain dependent like block for blocks in the blocks world or loc for locations in
logistics domain, and others domain independent like truth for truth values.
For now we assume the following special domain independent predicates and functions:
We can now axiomatize our first blocks world domain with the following first-order
sentences (all free variables are assumed to be universally quantified):
Description logics
Usually, the terminological knowledge base is defined at the design time of the
system and defines the ontology, and it only changes as the meaning of the vocabulary
changes, which should be rare.
The assertional knowledge base usually contains the knowledge that is situation-
specific and is only known at run time.
It is typical to use triples to define the assertional knowledge base and a language such
as OWL Web Ontology Language to define the terminological knowledge base.
OWL describes domains in terms of the following:
Individuals are things in the world that is being described (e.g., a particular
house or a particular booking may be individuals).
Classes are sets of individuals. A class is the set of all real or potential things
that would be in that class. For example, the class "House" may be the set of all
things that would be classified as a house, not just those houses that exist in the
domain of interest.
Properties are used to describe individuals. A datatype property has values
that are primitive data types, such as integers or strings. For example,
"streetName" may be a datatype property between a street and string. An object
property has values that are other individuals. For example, "nextTo" may be a
property between two houses, and "onStreet" may be a property between a house
and a street.
In philosophy, ontology is the study of what exists. In AI, an ontology is a specification of
Default Reasoning