Module 4
Propositional Logic
Knowledge Representation Techniques:
Logical Representation
Logical representation is a language with some concrete rules which deals propositions.
Logical representation means drawing a conclusion based on various conditions.
This representation lays down some important communication rules.
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 which decide how 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.
Logical representation
Logical representation can be categorized into mainly two logics:
❑ Propositional Logics
❑ Predicate logics
Semantic Network Representation
❑ Semantic networks are alternative of predicate logic for knowledge
representation.
❑ In Semantic networks, we can represent our knowledge in the form of
graphical networks.
❑ This network consists of nodes representing objects and arcs which
describe the relationship between those objects.
❑ Semantic networks can categorize the object in different forms and
can also link those objects.
❑ Semantic networks are easy to understand and can be easily
extended.
Semantic Network Representation
• Example: Following are some statements which we need to
represent in the form of nodes and arcs.
• Statements:
Jerry is a cat.
Jerry is a mammal
Jerry is owned by Priya.
Jerry is brown colored.
All Mammals are animal.
Frame Representation
• A frame is a record like structure which consists of a collection of attributes
and its values to describe an entity in the world.
• Frames are the AI data structure which divides knowledge into substructures
by representing stereotypes situations.
• It consists of a collection of slots and slot values. These slots may be of any
type and sizes.
• Slots have names and values which are called facts.
• A frame is also known as slot-filter knowledge representation in artificial
intelligence.
• Example:
Production rules
• In production rules agent checks for the condition and if the condition exists
then production rule fires and corresponding action is carried out.
• The condition part of the rule determines which rule may be applied to a
problem. And the action part carries out the associated problem-solving steps.
This complete process is called a recognize-act cycle.
• The working memory contains the description of the current state of problems-
solving and rule can write knowledge to the working memory.
• This knowledge match and may fire other rules.
Example:
• IF (at bus stop AND bus arrives) THEN action (get into the bus)
• IF (on the bus AND paid AND empty seat) THEN action (sit down).
• IF (on bus AND unpaid) THEN action (pay charges).
• IF (bus arrives at destination) THEN action (get down from the bus).
Propositional Logics
▪ Propositional logic (PL) is the simplest form of logic where all the
statements are made 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.
▪ Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
some basic facts about propositional logic:
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• Propositional logic consists of an object, relations or function,
and logical connectives
• The propositions and connectives are the basic elements of the
propositional logic.
• 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.
Logical Connectives:
❑ Negation: A sentence such as ¬ P is called negation of P. A literal can be
either Positive literal or negative literal.
❑ Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called
a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking.
→ P∧ Q.
❑ Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor.
Q= Ritika is Doctor,
so we can write it as P ∨ Q.
Logical Connectives:
❑ Implication: A sentence such as P → Q, is called an implication.
Implications are also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining,
Q= Street is wet,
so it is represented as P → Q
❑ Bi conditional: A sentence such as P⇔ Q is a Bi conditional sentence,
example If I am breathing, then I am alive
P= I am breathing,
Q= I am alive,
it can be represented as P ⇔ Q.
Following is the summarized table for Propositional
Logic Connectives:
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:
For negation: For Conjunction: For Disjunction
Truth Table:
• For Implication: For Bi directional: P & Q are
implication is true if P and Q are both true
or if P and Q are both false
Exercise to convert sentence into Proposition
logic
Prolog Language….