15 Knowledge Representation in AI-Part I
15 Knowledge Representation in AI-Part I
Part-1
As per their knowledge, they perform various actions in the real world.
Knowledge representation can use this knowledge to solve the real world problems
like diagnosis a medical condition or communicating with humans in natural
language.
1. Declarative Knowledge:
It is used to describe things such as tags, models and taxonomies that describe
knowledge.
For example: bibliography
4. Heuristic knowledge:
Heuristic knowledge is representing knowledge of some experts in a field or
subject.
Heuristic knowledge is rules of thumb based on previous experiences,
awareness of approaches, and which are good to work but not guaranteed.
5. Structural knowledge:
Structural knowledge is basic knowledge to problem-solving.
It describes relationships between various concepts such as kind of, part of, and
grouping of something.
It describes the relationship that exists between concepts and objects.
Relationship between Knowledge and Intelligence:
Syntax Semantics
Using syntax we can decide how we can These are the rules by using which we can
construct legal sentences in a logic. interpret the sentences.
It determines which symbol we can use in It assigns a meaning to each sentences.
knowledge representation
How to write those particular symbols
Propositional logic
Propositional/Boolean logic is the simplest form of logical representation in
which all the statements are represented by propositions.
A proposition is a declarative statement which is either true or false.
It is a technique of knowledge representation in logical and mathematical form.
Propositional logic consists of an object, relations or function, and logical
connectives/logical operators.
For example:
Sun rises from East (True)
7 is a prime number (True)
2+2 = 5 (False)
A proposition formula which is always true is called tautology, and it is also
called a valid sentence.
A proposition formula which is always false is called Contradiction.
Statements which are questions, commands, or opinions are not propositions
such as "Where is Ram?", "How do you do?", "What is your name?", are not
propositions.
It consists of precisely defined syntax and semantics which supports the sound
inference. Each sentence can be translated into logics using syntax and semantics.
Syntax:
Syntaxes are the rules using which we can construct legal sentences in the
logic.
It determines which symbol we can use in knowledge representation.
How to write those symbols.
Semantics:
Semantics are the rules by which we can interpret the sentence in the logic.
Semantic also involves assigning a meaning to each sentence.
Atomic: These are the simple propositions consisting of single proposition
symbol. For example 1+1 = 2 is an atomic proposition.
Compound/complex/composite: These are constructed by combining atomic
propositions, using parenthesis and logical connectives. For example: (It is not
raining today in Patiala)
Logical Connectives
1. Negation: A sentence such as ¬ P is called negation of P. A literal can be either
Positive literal or negative literal. For example: Today is not holiday can be
represented as ¬ P , where P: Today is holiday.
2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction. For example: Ramu eats fries, and Aman drinks soda.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions. For example- The clock is slow
or the time is correct can be represented as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication. Implications
are also known as if-then rule. For example: If there is a rain then the streets
are wet.
5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, For
example If I am breathing, then I am alive
Truth Tables of Logical Connectors
"If you get an A+, then your father will give you a gift."
The statement will be true if your father keep his promise and false if he does n't.
Suppose it's true that you get an A+ and it's true that your father give you a gift. Since he
kept his promise, the implication is true. This corresponds to the first row in the table.
Suppose it's true that you get an A+ but it's false that your father give you a gift. Since he
didn't keep his promise, the implication is false. This corresponds to the second row in the
table.
What if it's false that you get an A+? Whether or not your father give you a gift, he has n't
broken his promise. Thus, the implication can't be false, so (since this is a two-valued
logic) it must be true. This explains the last two rows of the table.
Note: We can create truth table for more than three propositions
Construct a truth table for ¬ P ∧(P →Q)
Show that (P →Q) V (Q →P) is a tautology.
Truth table for (P →Q) ∧ (Q →R)
Examples
It is hot
It is humid
It is raining
Write down the proposition logic for
1. If it is humid then it is hot
2. If it is hot and humid then it is not raining
Take A= It is hot.
1. B → A
B = It is humid. 2. (A ∧ B) → ¬C
C= It is raining.
P: Good mobile phones are not cheap
Q: Cheap mobile phones are not good
L: P implies Q
M: Q implies P
N: P is equivalent to Q
Which one of the following about L, M, and N is CORRECT?
(A) Only L is TRUE.
(B) Only M is TRUE.
(C) Only N is TRUE.
(D) L, M and N are TRUE
Truth Table
Let a and b be two proposition a b ~a ~b P Q
a: Good Mobile phones. T T F F F F
b: Cheap Mobile Phones. T F F T T T
F T T F T T
P and Q can be written in logic as F F T T T T
P: a → ~b
Q: b → ~a. It clearly shows P and Q are equivalent.
so option D is Correct
First-order logic does not only assume that the world contains facts like
propositional logic but also assumes the following things in the world:
Objects: A, B, people, numbers, colors etc.
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
Function: Father of, best friend, third inning of, end of, ......
Predicate Logic/First Order Logic
In Propositional Logic(PL), we can represent statements/facts which are either true
or false.
PL is not sufficient to represent the complex sentences or natural language
statements. The propositional logic has very limited expressive power.
∀x.∃y.(owns(x, y) ∧ house(y))
∃x.(owns(Ram, x) ∧ house(x))
where Ram is an individual constant symbol.
Example 6: “Ram does not own a house” is translated as
¬∃x.(owns(Ram, x) ∧ house(x))
∃x.∀y.(owns(x, y) → ¬house(y))
Advantages Disadvantages
Logical representation help to perform Logical representations have some
logical reasoning restrictions and are challenging to work
with.
This representation is the basis for the This technique may not be very natural
programming languages and inference may not be very efficient.