UNIT 3 Complete Note
UNIT 3 Complete Note
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.
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.
• 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
¬ (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.
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
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.
Forward Chaining
Backward Chaining :
Forward Chaining:
Step 1: Facts
Step 2: Rules
Step 3: Conclusion
Backward Chaining
Step 1: Conclusion
Step 2 : Rules
Step 3 : Facts
ONTOLOGY ENGINEERING
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 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.
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:
Part A (2 marks)
1. Define inference?
5. Define satisfiability
6. What is ontological commitment
7. Illustrate interface
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.