0% found this document useful (0 votes)
14 views16 pages

UNIT 3 Complete Note

The document discusses the role of knowledge and representation in artificial intelligence, emphasizing the importance of knowledge bases and reasoning processes for problem-solving. It covers various aspects of knowledge representation, including propositional and first-order logic, inference mechanisms, and ontology engineering. Additionally, it highlights the differences between declarative and procedural knowledge, as well as inference strategies like forward and backward chaining.

Uploaded by

D. Saravana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views16 pages

UNIT 3 Complete Note

The document discusses the role of knowledge and representation in artificial intelligence, emphasizing the importance of knowledge bases and reasoning processes for problem-solving. It covers various aspects of knowledge representation, including propositional and first-order logic, inference mechanisms, and ontology engineering. Additionally, it highlights the differences between declarative and procedural knowledge, as well as inference strategies like forward and backward chaining.

Uploaded by

D. Saravana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Unit : III

KNOWLEDGE : Role and Representation

Knowledge:
Knowledge is the information about a domain that can be used to solve problem in that domain. The
representation of knowledge and the reasoning processes that bring knowledge tolife are central to the
entire field of artificial intelligence.
• Knowledge and reasoning are enable successful behaviors that would be very hard to
achieve.
• Knowledge and reasoning also play a crucial role in dealing with partially observable
environments.
• A knowledge-based agent can combine general knowledge with current percepts to
infer hidden aspects of the current state prior to selecting actions.

Knowledge Representation and Reasoning / Knowledge Management:

• The central component of a knowledge-based agent is its knowledge base, or KB.


• A knowledge base is a set of sentences.
• Knowledge Representation Language:-Each sentence is expressed in a language called a
Knowledge Representation Language and represents some assertion about the world.
• Inference :- There is a way to add new sentences to the knowledge base is TELL and to query
what is know is ASK.
TELL :- A way to add new sentences to the knowledge base
ASK :- A way to query what is known.
Both tasks may involve INFERENCE that is, deriving new sentences from old.
Knowledge Based Agent Program

function KB-AGEN T(percept) returns an action


static: KB, a knowledge base
t, a counter, initially 0, indicating time
TELL(KB, MAKE-PERCEPT-SENTENCE(percept ,t))
action ← AsK(KB, MAKE-ACTION- QUERY(t))
TELL(KB, MAKE-ACTION-SENTENCE(action,t))
T ←t+1
return action

Like all our agents, it takes a percept as input and returns an action.
• The agent maintains a knowledge base, KB, which may initially contain some background
knowledge. Each time the agent program is called, it does threethings.
• First, it TELLS the knowledge base what it perceives.
• Second, it ASKS the knowledge base what action it should perform. In the process of answering
this query, extensive reasoning may be done about the current state of the world, about the outcomes
of possible action sequences, and so on.
• Third, the agent records its choice with TELL and executes the action. The TELL is necessary to let
the knowledge base know that the hypothetical action has actually been executed.
The details of the Representation Language are hidden inside three functions that implement the
interface between the sensors and actuators and the core representation andreasoning system.
• MAKE-PERCEPT-SENTENCE takes a percept and a time and returns a sentence
asserting that the agent perceived the given percept at the given time.
• MAKE-ACTION-QUERY takes a time as input and returns a sentence that asks what
action should be done at the current time.
• MAKE-ACTION-SENTENCE constructs a sentence asserting that the chosen action was
executed. The details of the inference mechanisms are hidden inside TELL and ASK.
Knowledge Representation Types:
• Designing the representation language to make it easy to express this knowledge in
the form of sentences simplifies the construction problem enormously. This is
called the declarative approach to system building.

• The procedural approach encodes desired behaviors directly as program code;


minimizing the role of explicit representation and reasoning can result in a much
more efficient system.

LOGIC / Knowledge Engineering behind logical agents

• Knowledge bases consists of sentences. These sentences are expressed according to the syntax
of the representation language, which specifies all the sentences that are well formed.
• The syntax is clear enough in ordinary arithmetic:
"x + y = 4" is a well-formed sentence, whereas "x2y+ =" is not.
semantics
• A logic must also define the semantics of the language.
• Semantics means "meaning" of sentences. In logic, the definition is more precise.
• The semantics of the language defines the truth of each sentence with respect to each
possibleworld.
• For example, "x + y = 4" is true in a world where x is 2 and y is 2, but false in a world
where xis 1 and y is 1.1 .
Example : Assume x and y as the number of men and women sitting at a table playing bridge, for
example, and the sentence x + y = 4 is true when there are four in total; formally, the possible
models are just all possible assignments of numbers to the variables x and y. Each such assignment
fixes the truth of any sentence of arithmetic whose variables are x and y.

Entailment
• Entailment means that one thing follows from another. Relation of logical entailment
between sentences is involved that a sentence follows logical from another sentence.
• KB ╞ α Knowledge base KB entails sentence α if and only if α is true in all worlds
where KB is true.

– E.g., the KB containing “the Giants won” and “the Reds won” entails “Either the Giants won
or the Reds won”.
– E.g., x+y = 4 entails 4 = x+y.
– Entailment is a relationship between sentences (i.e., syntax) that is based on semantics.

PROPOSITIONAL LOGIC

• Propositional logic is the simplest logic.


• The syntax of propositional logic and its semantics-the way in which the truth of sentences is
determined.
Syntax -The syntax of propositional logic defines the allowable sentences.
The atomic sentences - the indivisible syntactic elements consist of a single proposition
symbol. Each such symbol stands for a proposition that can be true or false.
Rules:
• Uppercase names are used for symbols (ie) P,Q,R and so on.
• Names are Arbitrary
Complex Sentences : Complex sentences are constructed from simpler sentences using logical
connections. There are five connectives.
➢ If S is a sentence, ¬S is a sentence (negation)
➢ If S1 and S2 are sentences, S1 ˄S2 is a sentence (conjunction)
➢ If S1 and S2 are sentences, S1 ˅S2 is a sentence (disjunction)
➢ If S1 and S2 are sentences, S1  S2 is a sentence (implication)
➢ If S1 and S2 are sentences, S1  S2 is a sentence (biconditional / IF AND ONLY IF)

¬ (not). A sentence such as ¬Wl,3 is called the negation of Wl,3. A literal is either an atomic sentence
(a positive literal) or a negated atomic sentence (a negative literal).
/\ (and). A sentence whose main connective is /\, such as Wl,3 /\ P3,1, is called a conjunction; its
parts are the conjuncts. (The /\ looks like an "N' for "And.")
V (or). A sentence using V, such as (W1,3/\P3,1) VW2,2, is a disjunction of the Disjuncts (Wl,3 /\ P3,1)
and W2,2.
 (implies). A sentence such as (W1,3/\ P3,1)  ¬ W2,2 is called an implication (or conditional). Its
premise or antecedent is (Wl,3/\ P3,1),and its conclusion or consequent is W2,2. Implications arealso
known as rules or if-then statements.
 (if and only if). The sentence W1,3 ¬ W2,2 is a biconditional.

BNF(Backus-Naur Form): The figure shows about the BNF grammar of sentence inpropositional
logic.

A BNF (Backus-Naur Form) grammar of sentences in propositional logic.

The order of precedence in propositional logic


• The order of precedence in propositional logic is (from highest to lowest) ¬, /\, V,  .
• Hence, the sentence ¬P V Q /\ R S is equivalent to the sentence ((¬P) V (Q /\ R))  S.
• Precedence does not resolve ambiguity in sentences such as A /\ B /\ C, which could be read as
((A /\ B) /\ C) or as (A /\ (B /\ C)). These two readings mean the same thing according to the
semantics.
The rules for each connective can be summarized in a truth table that specifies the truth value
of a complex sentence for each possible assignment of truth values to its components.

Truth tables for the logical connectives

Equivalence, validity, and satisfiability

Logical equivalence: two sentences α and β are logically equivalent if they are true in the same
set of models. We write this as a α  β.
Example : Two sentences α and β are logically equivalent if they are true in same models:
• α ≡ ß if and only if α╞ β and β╞ α.
• Equivalence for any two sentences α and β is α ≡ ß if and only if α╞ β and β╞ α

Validity
A sentence is valid if it is true in all models.
e.g., A V¬ A, A  A, (A  (A  B))  B. These are valid / true statements.
Valid sentences are also known as tautologies-they are necessarily true. Because the sentence
True is true in all models, every valid sentence is logically equivalent to True.
For any sentences KB and α , KB ╞ α if and only if (KB  α) is valid. Every valid implication
sentence describes an inference.

Satisfiability
A sentence is satisfiable if it is true in some model.
For example, the knowledge base given earlier, (R1  R2  R3  R4  R s), is satisfiable because
there are three models in which it is true.
If a sentence a is true in a model m, then we say that m satisfies α, or that m is a model of α.
Satisfiability can be checked by enumerating the possible models until one is found that satisfies
the sentence.
The symbols α, β and γ stands for arbitrary sentences of propositional logic.

FIRST-ORDER LOGIC

FOL, a representation language of knowledge which is powerful than propositional logic


(ie)Boolean logic. FOL is an expressive.
• It follows Procedural approach
• It derive facts from other facts(ie.) dependent

First-order logic (like natural language) assumes the world contains


➢ Noun- refers to Objects. Eg.Name, place, thing.
➢ Verb refers to relations
➢ Some relations are functions
➢ Relation has only one value
Functions have many values assigned to it.
• Objects: people, houses, numbers, colors, baseball games, wars,
• Properties: red, round, prime, Small
• Relations: bigger than, part of, comes between, …
• Functions: father of, best friend, one more than, plus, …
Example :
1. “Evil King John ruled England in 1200”
Objects: John, England, 1200;
Relation: King
Function : Ruled
Properties: evil
2. "One plus two equals three"
Objects: one, two, three
Relation: equals;
Function : Plus
3. "Squares neighboring the wumpus are smelly."
Objects: wumpus, squares
Property: smelly;
Relation: neighboring.

Quantifiers in FOL
• To express properties of entire collections of objects, instead of enumerating the objects by
name.
• First-order logic contains two standard quantifiers, called Universal (∀) and Existential (Ǝ).

Universal quantification(∀)
• This quantifier is usually denoted as ∀ and Pronounced as “For All”.
• Logical Expression is true for all objects x(variable) in the universe.
• Eg. "All kings are persons“ is written in first-order logic as
• ∀x King (x) Person(x). (ie) "For all x, if x is a king, then x is a person”. X →
Variable.

Existential quantification(Ǝ)
• It makes a statement about some object in the universe without naming it, by using an
existential quantifier.
• Pronounced as “There Exists” logical expression which is true for some objects x (variable) in
the universe.
Nested Quantifiers
The sentences are represented using both quantifiers (ie) universal and existential are called Nested
Quantifiers.
There are two types of sentences in which different nested quantifiers are used.
Example:
“Everybody loves somebody” ∀x Ǝy Loves(x,y)
"There is someone who is loved by everyone”, → Ǝy ∀x Loves(x,y)
“Everyone will be loved by some body”, → ∀x (Ǝy Loves( x, y))
“Some one will be loved by everybody” → Ǝx(∀y Loves(x,y))

Some Examples:
Inference
Use of efficient procedures and rules by the Inference Engine is essential in deducting a correct, flawless
solution. In case of knowledge-based ES, the Inference Engine acquires and manipulates the knowledge
from the knowledge base to arrive at a particular solution.
In case of rule based ES, it −
• Applies rules repeatedly to the facts, which are obtained from earlier rule application.
• Adds new knowledge into the knowledge base if required.
• Resolves rules conflict when multiple rules are applicable to a particular case.

To recommend a solution, the Inference Engine uses the following strategies −


• Forward Chaining
• Backward Chaining

Forward Chaining
Backward Chaining :

Example based on FOL – Forward and Backward Chaining


FOL Representation:

Forward Chaining:

Step 1: Facts

Step 2: Rules
Step 3: Conclusion

Backward Chaining
Step 1: Conclusion

Step 2 : Rules

Step 3 : Facts
ONTOLOGY ENGINEERING

Ontology means Remaining. Representing the abstract concepts is sometimes called


ontological engineering-it is related to the knowledge engineering process.

In "toy" domains, the choice of representation is not that important; it is easy to come up with a
consistent vocabulary. Real world problems such as shopping on the Internet or controlling a robot
in a changingphysical environment require more general and flexible representations, we have
many choice of representation like Actions, Time, Physical objects and Beliefs so this occur in
different domains.

The upper ontology of the world

The general framework of concepts is called an upper ontology, because of the convention of
drawing graphs with the general concepts at the top and the more specific concepts below them.

Characteristics of General purpose ontology.


1. A general purpose ontology should be applicable in more or less special purpose domain.
2. In any demanding domain, different areas of knowledge must be unified.

Ontology Commitment
An ontological commitment of a language is one or more objects postulated to exist by that language.
The 'existence' referred to need not be 'real', but exist only in a universe of discourse. As an example,
legal systems use vocabulary referring to 'legal persons' that are collective entities that have rights.
Algorithm:

Various Representation of Ontology Engineering:

Part A (2 marks)
1. Define inference?

2. Illustrate ASK and TELL inference?

3. Define atomic sentences

4. State the law of distributivity

5. Define satisfiability
6. What is ontological commitment

7. Illustrate interface

8. Contrast forward and backward chaining

9. What is declarative and procedural knowledge.

10. What is a knowledge base?

11. Define Prepositional Logic with example?

12. What is the need First Order Logic?

Part B (12 marks)

1. Identify and explain the method that is followed by logicians

2. Recollect propositional logic with atomic sentences

3. Create the order of precedence in propositional logic

4. Create truth table for logical conversion of complex sentences

5. Recollect inference rules

6. Explain nested quantifiers

7. Illustrate with example for forward and backward chaining.


8. Illustrate forward and backward chaining process for the given statements.

The law says that it is a crime for an American to sell weapons to hostile nations. Country Q, an
enemy of America, has some missiles, and all of its missiles were sold to it by Jack, who is an
American.

1. Prove thar “Jack is criminal”

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy