You are on page 1of 49

PANIMALAR ENGINEERING COLLEGE

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

21EC1401 - ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING (LAB


INTEGRATED)
UNIT – II NOTES
Introduction to Prolog

Knowledge Representation, Problems in representing knowledge, knowledge


representation using propositional and predicate logic, logical consequences, syntax, and
semantics of an expression, semantic Tableau Forward and backward reasoning. Proof
methods, substitution and unification, conversion to clausal form, normal forms, resolution,
refutation, deduction, theorem proving, inferencing, monotonic and non-monotonic
reasoning.

KNOWLEDGE REPRESENTATION

What exactly is meant by knowledge representation?

Knowledge consists of facts, concepts, rules, and so forth. It can be represented in


different forms, as mental images in one's thoughts, as spoken or written words in some
language, as graphical or other pictures, and as character strings or collections of magnetic
spots stored in a computer as shown in figure.
Example:

Suppose we wish to write a program to play a simple card game using the standard
deck of 52 playing cards. We will need some way to represent the cards dealt to each player
and a way to express the rules. We can represent cards in different ways.

1. The most straightforward way is to record the suit (clubs, diamonds, hearts, spades)
and face values (ace.' 2,3, ... , IO, jack, queen, king) as a symbolic pair. So the queen
of hearts might be represented as <queen, hearts>.

2. Alternatively, we could assign abbreviated codes (c6 for the 6 of clubs), numeric
values which ignore suit (1, 2, ... , 13), or some other scheme. If the game we wish to
play is bridge, suit as well as value will be important.

3. On the other hand, if the game is black jack, only face values are important and a
simpler program will result if only numeric values are used.

To see how important a good representation is, one only needs to try solving a few simple
problems using different representations. Consider the problem of discovering a pattern in the
sequence of numbers 1 1 2 3 4 7. A change of base in the number from l 0 to 2 transforms the
number to
011011011011011011.

Clearly a representation in the proper base greatly simplifies finding the


pattern solution. There are several representation schemes that have become popular among
AI practitioners. Perhaps the most important of these is first order predicate logic. It has
become important because it is one of the few methods that has a well-developed theory, has
reasonable expressive power, and uses valid form of inferring. Other representation schemes
include frames and associative networks (also called semantic and conceptual networks),
fuzzy logic, modal logics, and object-oriented methods.

To solve the complex problems encountered in artificial intelligence,


one needs both large amount of knowledge and some mechanisms for manipulating that
knowledge to create solutions to new problems. We must consider the following point that
pertains to all discussions of representation, namely that we are dealing with two different
kinds of entities:
• Facts: truths in some relevant world. These are the things we want to represent.
• Representations of facts in some chosen formalism. These are the things we will
actually be able to manipulate.
• The knowledge level, at which facts (including each agent's behaviours and current
goals) are described.
• The symbol level, at which representations of objects at the knowledge level are
'defined in terms of symbols that can be manipulated by programs, we will follow a model
more like the one shown in above figure.

Representations and Mappings

• In order to solve complex problems encountered in artificial intelligence, one needs both
a large amount of knowledge and some mechanism for manipulating that knowledge to
create solutions.

• Knowledge and Representation are two distinct entities. They play central but
distinguishable roles in the intelligent system.

• Knowledge is a description of the world. It determines a system’s competence by what it


knows.

• Moreover, Representation is the way knowledge is encoded. It defines a system’s


performance in doing something.

• Different types of knowledge require different kinds of representation.

The Knowledge Representation models/mechanisms are often based on:


• Logic
• Rules
• Frames
• Semantic Net
Knowledge is categorized into two major types:

1. Tacit corresponds to “informal” or “implicit“

• Exists within a human being;


• It is embodied.
• Difficult to articulate formally.
• Difficult to communicate or share.
• Moreover, Hard to steal or copy.
• Drawn from experience, action, subjective insight

2. Explicit formal type of knowledge, Explicit

• Explicit knowledge
• Exists outside a human being;
• It is embedded.
• Can be articulated formally.
• Also, Can be shared, copied, processed and stored.
• So, Easy to steal or copy
• Drawn from the artifact of some type as a principle, procedure, process, concepts.
A variety of ways of representing knowledge have been exploited in AI programs.
There are two different kinds of entities, we are dealing with.
1. Facts: Truth in some relevant world. Things we want to represent.
2. Also, Representation of facts in some chosen formalism. Things we will be able to
manipulate.
These entities structured at two levels:
1. The knowledge level, at which facts described.
2. Moreover, the symbol level, at which representation of objects defined in terms of
symbols that can manipulate by programs.

Framework of Knowledge Representation

• The computer requires a well-defined problem description to process and provide a well
defined acceptable solution.

• Moreover, To collect fragments of knowledge we need first to formulate a description in


our spoken language and then represent it in formal language so that computer can
understand.

• Also, The computer can then use an algorithm to compute an answer. So, This process
illustrated as knowledge representation framework.

The steps are:


• The informal formalism of the problem takes place first.
• It then represented formally and the computer produces an output.
• This output can then represented in an informally described solution that user understands
or checks for consistency.
The Problem solving requires,
• Formal knowledge representation, and
• Moreover, Conversion of informal knowledge to a formal knowledge that is the
conversion of implicit knowledge to explicit knowledge.

Mapping between Facts and Representation

• Knowledge is a collection of facts from some domain.


• Also, We need a representation of “facts“ that can manipulate by a program.
• Moreover, Normal English is insufficient, too hard currently for a computer program to
draw inferences in natural languages.
• Thus some symbolic representation is necessary. A good knowledge representation enables
fast and accurate access to knowledge and understanding of the content.
A knowledge representation system should have following properties.
1. Representational Adequacy
• The ability to represent all kinds of knowledge that are needed in that domain.
2. Inferential Adequacy
• Also, The ability to manipulate the representational structures to derive new
structures corresponding to new knowledge inferred from old.
3. Inferential Efficiency
• The ability to incorporate additional information into the knowledge structure that
can be used to focus the attention of the inference mechanisms in the most
promising direction.
4. Acquisitional Efficiency
• Moreover, The ability to acquire new knowledge using automatic methods
wherever possible rather than reliance on human intervention.

Knowledge Representation Schemes

Relational Knowledge
• The simplest way to represent declarative facts is a set of relations of the same sort used
in the database system.
• Provides a framework to compare two objects based on equivalent attributes. o Any
instance in which two different objects are compared is a relational type of knowledge.
• The table below shows a simple way to store facts.
• Also, The facts about a set of objects are put systematically in columns.
• This representation provides little opportunity for inference.

• Given the facts, it is not possible to answer a simple question such as: “Who is the
heaviest player?”
• Also, But if a procedure for finding the heaviest player is provided, then these facts will
enable that procedure to compute an answer.
• Moreover, We can ask things like who “bats – left” and “throws – right”.

Inheritable Knowledge
• Here the knowledge elements inherit attributes from their parents.
• The knowledge embodied in the design hierarchies found in the functional, physical and
process domains.
• Within the hierarchy, elements inherit attributes from their parents, but in many cases, not
all attributes of the parent elements prescribed to the child elements.
• Also, The inheritance is a powerful form of inference, but not adequate.
• Moreover, The basic KR (Knowledge Representation) needs to augment with inference
mechanism.
• Property inheritance: The objects or elements of specific classes inherit attributes and
values from more general classes.
• So, The classes organized in a generalized hierarchy.

• Boxed nodes — objects and values of attributes of objects.


• Arrows — the point from object to its value.
• This structure is known as a slot and filler structure, semantic network or a collection of
frames.
The steps to retrieve a value for an attribute of an instance object:
1. Find the object in the knowledge base
2. If there is a value for the attribute report it
3. Otherwise look for a value of an instance, if none fail
4. Also, Go to that node and find a value for the attribute and then report it
5. Otherwise, search through using is until a value is found for the attribute.

Inferential Knowledge
• This knowledge generates new information from the given information.
• This new information does not require further data gathering form source but does
require analysis of the given information to generate new knowledge.
• Example: given a set of relations and values, one may infer other values or relations. A
predicate logic (a mathematical deduction) used to infer from a set of attributes.
Moreover, Inference through predicate logic uses a set of logical operations to relate
individual data.
• Represent knowledge as formal logic: All dogs have tails ∀x: dog(x)  hastail(x)
• Advantages:
• A set of strict rules.
• Can use to derive more facts.
• Also, Truths of new statements can be verified.
• Guaranteed correctness.
• So, Many inference procedures available to implement standard rules of logic popular in
AI systems. e.g Automated theorem proving.

Procedural Knowledge
• A representation in which the control information, to use the knowledge, embedded in the
knowledge itself. For example, computer programs, directions, and recipes; these indicate
specific use or implementation.
• Moreover, Knowledge encoded in some procedures, small programs that know how to do
specific things, how to proceed.
• Advantages:
• Heuristic or domain-specific knowledge can represent.
• Moreover, Extended logical inferences, such as default reasoning facilitated.
• Also, Side effects of actions may model. Some rules may become false in time.
Keeping track of this in large systems may be tricky.
• Disadvantages:
• Completeness — not all cases may represent.
• Consistency — not all deductions may be correct. e.g If we know that Fred is a
bird we might deduce that Fred can fly. Later we might discover that Fred is an
emu.
• Modularity sacrificed. Changes in knowledge base might have far-reaching effects.
• Cumbersome control information.

PROBLEMS IN REPRESENTING KNOWLEDGE

All Knowledge representation schemes suffer from problems. We will discuss them here.

• Are any attributes of objects so basic that they occur in almost every problem
domain. If there are, we need to make sure that they are handled appropriately in
each of the mechanisms we propose. If such attributes exist, what are they?

• Are there any important relationships that exists among attributes of objects?

• At what level should knowledge be represented? Is there a good set of primitives.


into which all knowledge can be broken down? Is it helpful to use such primitives?

• How should sets of objects be represented?

• Given a large amount of knowledge stored in a database, how can relevant parts
be accessed when they are needed?

Important Attributes

There are two attribute that are of very general significance, and we have already seen
.their use. instance and.1sa. These attributes are important because they support property
inheritance. They are called a variety of things in AI systems, but the names do not
matter. What does matter is that they represent class membership and class inclusion
and that class inclusion is transitive.

Relationship among Attributes

The attributes that we use to describe objects are themselves entities that we represent.
what properties do they have independent of the specific knowledge they encode? There
are four such properties are listed issues that should be raised when using a knowledge
representation technique:

Inverses

The relationship between the attributes of an object, such as, inverses, existence, techniques
for reasoning about values and single valued attributes. We can consider an example of an
inverse in

band(John Zorn, Naked City)

This can be treated as John Zorn plays in the band Naked City or John Zorn's band is Naked
City.

The second approach is to use attributes that focus on single entity but to use in them pairs.
One the inverse of the other. The band information is represented with two attributes.

band = Naked City

band-members = John Zorn, Bill Frissell, Fred Frith, Joey Barron,

Existence in isa hierarchy

Just as there are classes of objects and specialized subsets of those classes, there are attributes
and specializations of attributes. Consider, for example, the attribute height. It Is actually a
specialization of the more general attribute physical-size which is, in turn, a specialization of
physical-attribute. These generalization-specialization relationships are important for
attributes, for the same reason that they are important for other concepts they support
inheritance. In the case of attributes, they support inheriting, information on about such things
as constraints on the values that the attribute can have and mechanisms for computing those-
values.

Techniques for Reasoning about values

Sometimes values of attributes are specified explicitly when a knowledge base is created.
Several kinds of information can play a role in this reasoning, including:

• Information about the type of the value. For example, the value of height must be a number
measured m a unit of length. ·
• Constraints on the value, often stated in terms of related entities. For example, the age of a
person cannot be greater than the age of either of that person's parents.
• Rules for computing the value when it is needed, These rules are called backward rules.
Such rules have also been called if-needed rules.
• Rules that describe actions that should be taken if a value ever becomes known. These rules
are called forward rules, or sometimes if-added rules.

Single-valued attribute

A specific but very useful kind of attribute is one that is guaranteed to take a unique value.
For example, a baseball player can, at any one time, have only a single height and be a
member of only one team. If there is already a value present for one of these attributes and a
different value is asserted, then one of two things has happened. Either a. change has
occurred in the world or there is now a contradiction in the knowledge base that needs to be
resolved. Knowledge-representation systems have taken several different approaches to
providing support for single-valued attributes! including:

• Introduce. an explicit notation for temporal interval. If two different values are ever asserted
for the same temporal interval, signal a contradiction automatically.
• Assume that the only temporal interval that is of interest is now, So if a new value is
asserted, replace the old value.

Choosing the Granularity of Representation

At what level should the knowledge be represented and what are the primitives. Choosing the
Granularity of Representation Primitives are fundamental concepts such as holding, seeing,
playing and as English is a very rich language with over half a million words it is clear we
will find difficulty in deciding upon which words to choose as our primitives in a series of
situations.

If Tom feeds a dog then it could become:

feeds(tom, dog)

If Tom gives the dog a bone like:

gives(tom, dog, bone) Are these the same?

In any sense does giving an object food constitute feeding?

If give(x, food) feed(x) then we are making progress.

There are several arguments against the use of low-level primitives. One is that simple high-
level facts may require a lot of storage when broken down into primitives. Much of that
storage is really wasted since the low-level rendition of a particular high level concept will
appear many times, once for each time the high-level concept is referenced. For example,
suppose that actions are being represented as combinations of a small set of primitive actions.
Then the fact that John punched Mary might be represented as shown in first figure. The
representation says that there was physical contact between John's fist and Mary. The contact
was caused by John propelling his fist toward Mary, and to do that John first went to where
Mary was. But suppose we also know that Mary punched John. Then we must also store the
structure shown in second figure below. If, however, punching were represented simply as
punching, then most of the detail of both structures could be omitted from the structures
themselves. It could instead be stored just once in a common representation of the concept of
punching.
Representing Set of Objects

It is important to be able to represent set of objects for several reasons. One is that there are
some properties that are true of sets that are not true of the individual members of a set. As
examples, consider the assertions that are being made in the sentences.

"There are more sheep than people in Australia" and "English speakers can be found all over
the world.".

The only way to represent the facts described in these sentences is to attach assertions to the
sets representing people, sheep, and English speakers, since, for example, no single English
speaker can be found all over the world. The other reason that it is important to be. able to
represent sets of objects is that if a property is true of all (or even most) elements of a set,
then it is more efficient to associate it once with the set rather than to associate it explicitly
with every element of the set.

Thus if we assert something like large(Elephant), it must be clear whether we are asserting
Some property of the set itself (i.e., that the set of elephants is large) or some property that
holds for individual elements of the set (i.e., that anything that is an elephant is large). There
are three obvious ways in which sets may be represented. The simplest is just by a name.

Finding the Right Structures as Needed

This is the issue of locating appropriate knowledge structures that have been stored in
memory. For example, suppose we have a script (a description of a class of events in terms of
contexts, participants, and subevents) that describes the typical sequence of events in a .
restaurant. This script would enable us to take a text such as ·

John went to Steak and Ale last night. He ordered a large, rare steak, paid his bill, and left.
And answer yes to the question: Did john eat dinner last night?

Notice that nowhere in the story was John's eating anything mentioned explicitly. But the fact
that when one goes to a restaurant one eats will be contained in the restaurant script. If we
know in advance to use the restaurant script, then we can answer the question easily. But in·
order to be able to reason about a variety of things, a system must have many scripts for
everything from going to work to sailing around the world. How will it select the appropriate
one each time? For example, nowhere in our story was the word "restaurant" mentioned. · · _
In fact in order to have access to the right structure for describing a particular situation, it is
necessary to solve all of the following problems.

• How to perform an initial selection of the most appropriate structure.


• How to fill in appropriate details from the current situation.
• How to find a better structure 'if the one chosen initially turns out not to be appropriate.
• What to do if none of the available structures is appropriate.
• When to create and remember a new structure.

There is no good, general-purpose method for solving all these problems. Some knowledge-
representation technique solve some of them. This leads to two questions: how to select an
initial structure to consider and how to find a better structure (or revise it) if that one turns out
not to be a good match.
KNOWLEDGE REPRESENTATION USING PROPOSITIONAL AND PREDICATE
LOGIC

SYNTAX AND SEMANTICS FOR PROPOSITIONAL LOGIC

Valid statements or sentences in PL are determined according to the rules of propositional


syntax. This syntax governs the combination of basic building blocks such as propositions
and logical connectives. Propositions are elementary atomic sentences. (We shall also use the
term formulas or well-formed formulas in place of sentences) Propositions may be either true
or false but may take on no other value. Some examples of simple propositions are

It is raining.
My car is painted silver.
John and Sue have five children.
Snow is white.
People live on the moon.

Compound propositions are formed from atomic formulas using the logical connectives not
and or if . . . then, and if and only if. For example, the following are compound formulas.

It is raining and the wind is blowing.


The moon is made of green cheese or it is not.
If you study hard you will be rewarded.
The sum of 10 and 20 is not 50.

We will use capital letters, sometimes followed by digits, to stand for propositions; T and F
are special symbols having the values true and false, respectively.

The following symbols will also be used for logical connectives.

- for not or negation

& for and or conjunction

V for or or disjunction

for if . . . then or implication

for if and only if or double implication

In addition, left and right parentheses, left and right braces, and the period will be used as
delimiters for punctuation. So, for example, to represent the compound sentence "It is raining
and the wind is blowing" we could write (R & B) where R and B stand for the propositions "It
is raining" and "the wind is blowing," respectively. If we write (R V B) we mean "it is raining
or the wind is blowing or both" that is, V indicates inclusive disjunction.

Syntax

The syntax of PL is defined recursively as follows.


Semantics

The semantics or meaning of a sentence is just the value true or false; that is, it is an
assignment of a truth value to the sentence. The values true and false should not be confused
with the symbols T and F which can appear within a sentence. An interpretation for a
sentence or group of sentences is an assignment of a truth value to each propositional symbol.
As an example, consider the statement (P & -Q). One interpretation (I1) assigns true to P and
false to Q. A different interpretation (I2) assigns true to P and true to Q. Clearly, there are
four distinct interpretations for this sentence. Some semantic rules are summarized in the
table below.

We can now find the meaning of any statement given an interpretation I for the statement.
For example, let I assign true to P, false to Q and false to R in the statement

Application of rule 2 then gives -Q as true, rule 3 gives (P & -Q) as true, rule 6 gives (P & -
Q) ~ R as false, and rule 5 gives the statement value as false.
Properties of statements

Satisfiable. A statement is satisfiable if there is some interpretation for which it is true.


Contradiction. A sentence is contradictory (unsatisfiable) if there is no interpretation for
which it is true.
Valid. A sentence is valid if it is true for every interpretation. Valid sentences are also called
tautologies.
Equivalence. Two sentences are equivalent if they have the same truth value under every
interpretation.
Logical consequences. A sentence is a logical consequence of another if it is satisfied by all
interpretations which satisfy the first.

LOGICAL CONSEQUENCES

More generally, it is a logical consequence of other statements if and only if for any
interpretation in which the statements are true, the resulting statement is also true. A valid
statement is satisfiable, and a contradictory statement is invalid, but the converse is not
necessarily true. As examples of the above definitions consider the following statements.
P is satisfiable but not valid since an interpretation that assigns false to P assigns false to the
sentence P.

P V - P is valid since every interpretation results in a value of true for (P V -P).


P & - P is a contradiction since every interpretation results in a value of false for (P & -P).
P and -CP) are equivalent since each has the same truth values under every interpretation.
P is a logical consequence of ( P & Q) since any interpretation for which (P & Q) is true, P is
also true.

The notion of logical consequence provides us with a means to perform valid inferencing in
PL. The following are two important theorems which give criteria for a statement to be a
logical consequence of a set of statements.
Theorem 4.1. The sentence s is a logical consequence of s1,……….., sn if and only if s1 & s2
& ... & sn s is valid.
Theorem 4.2. The sentence s is a logical consequence of s1,……….., sn if and only if s1 & s2
& ... &sn &‘s is inconsistent. Table 4.2 lists some of the important laws of PL.

One way to determine the equivalence of two sentences is by using truth table. For example
the conditional elimination and Bi-conditional elimination in the above table can be verified
by the following truth table.

Inference Rules

The inference rules of PL provide the means to perform logical proofs or deductions. The
problem is, given a set of sentences S = {s1,……….., sn} (the premises), prove the truth of s
(the conclusion); that is, show that Sl-s. The use of truth tables to do this is a form of
semantic proof. Other syntactic methods of inference or deduction are also possible. Such
methods do not depend on truth assignments but on syntactic relationships only; that is, it is
possible to derive new sentences which are logical consequences of s1…....... sn using only
syntactic operations. Few inference rules are given here.
SYNTAX AND SEMANTICS FOR PREDICATE LOGIC (FOPL-First Order
Predicate Logic)

expressiveness is one of the requirements for any serious representation scheme. It should be
possible to accurately represent most, if not all concepts which can be verbalized. PL falls
short of this requirement in some important respects. It is too "coarse" to easily describe
properties of objects, and it lacks the structure to express relations that exist among two or
more entitles. Furthermore, PL does not permit us to make generalized statements about
classes of similar objects. These are serious limitations when reasoning about real world
entities. For example, given the following statements, it should be possible to conclude that
John must take the Pascal course.

All students in Computer Science must take Pascal.

John is a Computer Science major.

As stated, it is not possible to conclude in PL that John must take Pascal since the second
statement does not occur as part of the first one. To draw the desired conclusion with a valid
inference rule, it would be necessary to rewrite the sentences.
FOPL was developed by logicians to extend the expressiveness of PL. It is a generalization of
PL that permits reasoning about world objects as relational entities as well as classes or
subclasses of objects. This generalization comes from the introduction of predicates in place
of propositions, the use of functions and the use of variables together with variable
quantifiers.

These concepts are formalized below.


The syntax for FOPL, like PL, is determined by the allowable symbols and rules of
combination. The semantics of FOPL are determined by interpretations assigned to
predicates, rather than propositions. This means that an interpretation must also assign values
to other terms including constants, variables and functions, since predicates may have
arguments consisting of any of these terms. Therefore, the arguments of a predicate must be
assigned before an interpretation can be made.

Syntax of FOPL

The symbols and rules of combination permitted in FOPL are defined as follows.
Semantics for FOPL

When considering specific wffs, we always have in mind some domain D. If not stated
explicitly, D will be understood from the context. D is the set of all elements or objects from
which fixed assignments are made to constants and from which the domain and range of
functions are defined. The arguments of predicates must be terms (constants, variables, or
functions). Therefore, the domain of each n-place predicate is also defined over D.
For example, our domain might be all entities that make up the Computer Science
Department at the University of Texas. In this case, constants would be professors (Bell,
Cooke, Gelfond, and so on), staff (Martha, Pat, Linda, and so on), books, labs, offices, and so
forth. The functions we may choose might be
PROPOSITIONAL LOGIC: RESOLUTION

Resolution in Propositional Logic:


Resolution is a rule of inference leading to a refutation theorem—theorem proving technique
for statements in propositional logic and first- order logic. In other words, iteratively applying
resolution rule in a suitable way allows for telling whether, a propositional formula (WFF –
Well-formed formulas) is satisfiable.

The following steps should be carried out in sequences to employ it for theorem
proving in propositional using resolution:

Resolution Algorithm:
Given:
A set of clauses, called axioms and a goal.

Aim:
To test whether the goal is derivable from the axioms.
Begin:
1. Construct a set S of axioms plus the negated goal.
2. Represent each element of S into conjunctive normal form (CNF) by the following
steps:
a) Replace ‘if-then’ operator by NEGATION and OR operation by theorem using 10.

(b) Bring each modified clause into the following form and then drop AND operators
connected between each square bracket. The clauses thus obtained are in conjunctive normal
from (CNF). It may be noted that pij may be in negated or non-negated form.
3. Repeat:
(a) Select any two clauses from S, such that one clause contains a negated literal and the other
clause contains its corresponding positive (non-negated) literal.

(b) Resolve these two clauses and call the resulting clause the resolvent. Remove the parent
clauses from S.
Until a null clause is obtained or no further progress can be made.

4. If a null clause is obtained, then report: “goal is proved”

Example 1:
We are given the axioms given in the first column of table 6.3, and we want to prove R. First
we convert the axioms to clause form, as shown in the second column of the table. Then we
negate R, producing ¬ R which is already in clause form it is added into the given clauses
(data base).
Then we look for pairs of clauses to resolve together. Although many pair of clauses can be
resolved, only those pairs which contain complementary literals will produce a resolvent
which is likely to lead to the goal shown by empty clause (shown as a box). We begin by
resolving R with the clause ¬ R since that is one of the clauses which must be involved in the
contradiction we are trying to find. The sequence of contradiction resolvents of the example
in table 6.3., is shown in Fig. 6.4.

The procedure adopted in the above example can be explained as follows:


Resolution process starts with a set of clauses all assumed to be true. The clause 2 becomes
true when either ¬ P or ¬ Q or R is true. Since ¬ R is assumed to be true, clause 2 remains
true for either ¬ P or ¬ Q. This is the first resolvent clause. Now the proposition 1 says that P
is true meaning thereby that ¬ P cannot be true. This leaves only one possibility ¬ Q for
clause 2 to be true. This is shown by second resolvent. Proposition 4 can be true if either ¬ T
or Q is true.But ¬ Q must be true, so for proposition 4 to be true the only way for clause 4 to
be true is for ¬ T to be true, shown as third resolvent. But clause 5 says that T is true.

Example 2:
Consider the following knowledge base:
1. If the-humidity-is-high or the-sky-is-cloudy.
2. If the-sky-is-cloudy then it-will-rain.
3. If the-humidity-is-high then it-is-hot.
4. It-is-not-hot.
and the goal: It-will-rain prove by resolution theorem that the goal is derivable from the
knowledge base.
Proof:
Let us first denote the above clauses by the following symbols.

p = the-humidity-is high, q = the-sky-is-cloudy, r = it-will-rain, s = it-is-hot.

The CNF form of the above clause thus become-

1. p ∨ q
2. ¬ q ∨ r (after applying theorem 10)
3. ¬ p ∨ s (after applying theorem 10)
4. ¬ s
5. ¬ r
and the negated goal = ¬ r. The set of statements; S, thus includes all these 5 clauses in
Normal Form. When all the clauses are connected through connector ∧ they are called in CNF
and conjugated terms for the set S. For example

Now by resolution algorithm, we construct the graph of Fig. 6.5. Since it terminates with a
null clause the goal is proved.
KNOWLEDGE REPRESENTATION USING PREDICATE LOGIC

Representation of Simple Facts in Logic

Propositional logic is useful because it is simple to deal with and a decision procedure for it
exists.
Also, In order to draw conclusions, facts are represented in a more convenient way as,
1. Marcus is a man.
• man(Marcus)
2. Plato is a man.
• man(Plato)
3. All men are mortal.
• mortal(men)
But propositional logic fails to capture the relationship between an individual being a man
and
that individual being a mortal.
• How can these sentences be represented so that we can infer the third sentence from the
first two?
• Also, Propositional logic commits only to the existence of facts that may or may not be
the case in the world being represented.
• Moreover, It has a simple syntax and simple semantics. It suffices to illustrate the process
of inference.
• Propositional logic quickly becomes impractical, even for very small worlds.

Predicate logic
First-order Predicate logic (FOPL) models the world in terms of
• Objects, which are things with individual identities
• Properties of objects that distinguish them from other objects

• Relations that hold among sets of objects

• Functions, which are a subset of relations where there is only one “value” for any given
“input”
First-order Predicate logic (FOPL) provides
• Constants: a, b, dog33. Name a specific object.
• Variables: X, Y. Refer to an object without naming it.
• Functions: Mapping from objects to objects.
• Terms: Refer to objects
• Atomic Sentences: in(dad-of(X), food6) Can be true or false, Correspond to propositional
symbols P, Q.
A well-formed formula (wff) is a sentence containing no “free” variables. So, That is, all
variables are “bound” by universal or existential quantifiers.
(∀x)P(x, y) has x bound as a universally quantified variable, but y is free.

Quantifiers
Universal quantification
• (∀x)P(x) means that P holds for all values of x in the domain associated with that variable
• E.g., (∀x) dolphin(x) → mammal(x)
Existential quantification
• (∃ x)P(x) means that P holds for some value of x in the domain associated with that
variable
• E.g., (∃ x) mammal(x) ∧ lays-eggs(x)
Also, Consider the following example that shows the use of predicate logic as a way of
representing knowledge.
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. Also, All Pompeians were either loyal to Caesar or hated him.
6. Everyone is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
The facts described by these sentences can be represented as a set of well-formed formulas
(wffs)
as follows:
1. Marcus was a man.
• man(Marcus)
2. Marcus was a Pompeian.
• Pompeian(Marcus)
3. All Pompeians were Romans.
• ∀x: Pompeian(x) → Roman(x)
4. Caesar was a ruler.
• ruler(Caesar)
5. All Pompeians were either loyal to Caesar or hated him.
• inclusive-or
• ∀x: Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar)
• exclusive-or
• ∀x: Roman(x) → (loyalto(x, Caesar) ∧¬ hate(x, Caesar)) ∨

• (¬loyalto(x, Caesar) ∧ hate(x, Caesar))

6. Everyone is loyal to someone.


• ∀x: ∃y: loyalto(x, y)
7. People only try to assassinate rulers they are not loyal to.
• ∀x: ∀y: person(x) ∧ ruler(y) ∧ tryassassinate(x, y)
• →¬loyalto(x, y)
8. Marcus tried to assassinate Caesar.
• tryassassinate(Marcus, Caesar)

Now suppose if we want to use these statements to answer the question: Was Marcus loyal to
Caesar?
Also, Now let’s try to produce a formal proof, reasoning backward from the desired goal: ¬
Ioyalto(Marcus, Caesar)
In order to prove the goal, we need to use the rules of inference to transform it into another
goal
(or possibly a set of goals) that can, in turn, transformed, and so on, until there are no
unsatisfied goals remaining.

Figure: An attempt to prove ¬loyalto(Marcus, Caesar).


• The problem is that, although we know that Marcus was a man, we do not have any way
to conclude from that that Marcus was a person. Also, We need to add the representation
of another fact to our system, namely: ∀ man(x) → person(x)
• Now we can satisfy the last goal and produce a proof that Marcus was not loyal to
Caesar.
• Moreover, From this simple example, we see that three important issues must be
addressed in the process of converting English sentences into logical statements and then
using those statements to deduce new ones:

1. Many English sentences are ambiguous (for example, 5, 6, and 7 above). Choosing the
correct interpretation may be difficult.
2. Also, There is often a choice of how to represent the knowledge. Simple representations
are desirable, but they may exclude certain kinds of reasoning.
3. Similalry, Even in very simple situations, a set of sentences is unlikely to contain all the
information necessary to reason about the topic at hand. In order to be able to use a set of
statements effectively. Moreover, It is usually necessary to have access to another set of
statements that represent facts that people consider too obvious to mention.

Representing Instance and ISA Relationships

* Specific attributes instance and isa play an important role particularly in a useful form of
reasoning called property inheritance.
* The predicates instance and isa explicitly captured the relationships they used to express,
namely class membership and class inclusion.
* Figure shows the first five sentences of the last section represented in logic in three
different ways.
* The first part of the figure contains the representations we have already discussed. In
these representations, class membership represented with unary predicates (such as
Roman), each of which corresponds to a class.
* Asserting that P(x) is true is equivalent to asserting that x is an instance (or element) of P.
* The second part of the figure contains representations that use the instance predicate
explicitly.

The following figure shows three ways of representing class membership: isa relationships

• The predicate instance is a binary one, whose first argument is an object and whose second
argument is a class to which the object belongs.
• But these representations do not use an explicit isa predicate.
• Instead, subclass relationships, such as that between Pompeians and Romans, described
as shown in sentence 3.
• The implication rule states that if an object is an instance of the subclass Pompeian then it
is an instance of the superclass Roman.
• Note that this rule is equivalent to the standard set-theoretic definition of the subclass
superclass relationship.
• The third part contains representations that use both the instance and isa predicates
explicitly.
• The use of the isa predicate simplifies the representation of sentence 3, but it requires that
one additional axiom (shown here as number 6) be provided.

Computable Functions and Predicates

• To express simple facts, such as the following greater-than and less-than relationships:
gt(1,O) It(0,1) gt(2,1) It(1,2) gt(3,2) It( 2,3)
• It is often also useful to have computable functions as well as computable predicates.
Thus we might want to be able to evaluate the truth of gt(2 + 3,1)
• To do so requires that we first compute the value of the plus function given the arguments
2 and 3, and then send the arguments 5 and 1 to gt.
Consider the following set of facts, again involving Marcus:
1) Marcus was a man.
man(Marcus)
2) Marcus was a Pompeian.
Pompeian(Marcus)
3) Marcus was born in 40 A.D.
born(Marcus, 40)
4) All men are mortal.
x: man(x) → mortal(x)
5) All Pompeians died when the volcano erupted in 79 A.D.
erupted(volcano, 79) ∧ ∀ x : [Pompeian(x) → died(x, 79)]
6) No mortal lives longer than 150 years.
x: t1: At2: mortal(x) born(x, t1) gt(t2 – t1,150) → died(x, t2)
7) It is now 1991.
now = 1991
So, Above example shows how these ideas of computable functions and predicates can be
useful.
It also makes use of the notion of equality and allows equal objects to be substituted for each
other whenever it appears helpful to do so during a proof.
• So, Now suppose we want to answer the question “Is Marcus alive?”
• The statements suggested here, there may be two ways of deducing an answer.
• Either we can show that Marcus is dead because he was killed by the volcano or we can
show that he must be dead because he would otherwise be more than 150 years old, which we
know is not possible.
• Also, As soon as we attempt to follow either of those paths rigorously, however, we
discover, just as we did in the last example, that we need some additional knowledge. For
example, our statements talk about dying, but they say nothing that relates to being alive,
which is what the question is asking. So we add the following facts:
8) Alive means not dead.
x: t: [alive(x, t) → ¬ dead(x, t)] [¬ dead(x, t) → alive(x, t)]
9) If someone dies, then he is dead at all later times.
x: t1: At2: died(x, t1) gt(t2, t1) → dead(x, t2)
So, Now let’s attempt to answer the question “Is Marcus alive?” by proving: ¬ alive(Marcus,
now)

RESOLUTION

Resolution is a theorem proving technique that proceeds by building refutation proofs,


i.e., proofs by contradictions.

Resolution is used, if there are various statements are given, and we need to prove a
conclusion of those statements. Unification is a key concept in proofs by resolutions.
Resolution is a single inference rule which can efficiently operate on the conjunctive normal
form or clausal form.

Clause: Disjunction of literals (an atomic sentence) is called a clause. It is also known as a
unit clause.

Conjunctive Normal Form: A sentence represented as a conjunction of clauses is said to


be conjunctive normal form or CNF.

Steps for Resolution:

1. Conversion of facts into first-order logic.


2. Convert FOL statements into CNF
3. Negate the statement which needs to prove (proof by contradiction)
4. Draw resolution graph (unification).

To better understand all the above steps, we will take an example in which we will
apply resolution.

Example:

a. John likes all kind of food.


b. Apple and vegetable are food
c. Anything anyone eats and not killed is food.
d. Anil eats peanuts and still alive
e. Harry eats everything that Anil eats.

Prove by resolution that:

f. John likes peanuts.

Step-1: Conversion of Facts into FOL Step-2: Conversion of FOL into CNF

In the first step we will convert all the given Eliminate all implication (→) and rewrite
statements into its first order logic.
1. ∀x ¬ food(x) V likes(John, x)
2. food(Apple)Λ
food(vegetables)
3. ∀x ∀y ¬ [eats(x, y) Λ ¬
killed(x)] V food(y)
4. eats (Anil, Peanuts) Λ
alive(Anil)
5. ∀x ¬ eats(Anil, x) V
eats(Harry, x)
6. ∀x¬ [¬ killed(x) ] V alive(x)
7. ∀x ¬ alive(x) V ¬ killed(x)
8. likes(John, Peanuts).

Move negation (¬)inwards and rewrite Rename variables or standardize variables

a. ∀x ¬ food(x) V likes(John, x) a. ∀x ¬ food(x) V likes(John, x)


b. food(Apple) Λ food(vegetables) b. food(Apple) Λ food(vegetables)
c. ∀x ∀y ¬ eats(x, y) V killed(x) V food(y) c. ∀y ∀z ¬ eats(y, z) V killed(y) V food(z)
d. eats (Anil, Peanuts) Λ alive(Anil) d. eats (Anil, Peanuts) Λ alive(Anil)
e. ∀x ¬ eats(Anil, x) V eats(Harry, x) e. ∀w¬ eats(Anil, w) V eats(Harry, w)
f. ∀x ¬killed(x) ] V alive(x) f. ∀g ¬killed(g) ] V alive(g)
g. ∀x ¬ alive(x) V ¬ killed(x) g. ∀k ¬ alive(k) V ¬ killed(k)
h. likes(John, Peanuts). h. likes(John, Peanuts).

o Eliminate existential instantiation quantifier o Drop Universal quantifiers.


by elimination. In this step we will drop all universal
In this step, we will eliminate existential quantifier since all the statements are not
quantifier ∃, and this process is known implicitly quantified so we don't need it.
as Skolemization. But in this example problem 1. ¬ food(x) V likes(John, x)
since there is no existential quantifier so all the 2. food(Apple)
statements will remain same in this step.
3. food(vegetables)
4. ¬ eats(y, z) V killed(y) V food(z)
5. eats (Anil, Peanuts)
6. alive(Anil)
7. ¬ eats(Anil, w) V eats(Harry, w)
8. killed(g) V alive(g)
9. ¬ alive(k) V ¬ killed(k)
10. likes(John, Peanuts).

Step-3: Negate the statement to be proved


o Distribute conjunction ∧ over disjunction¬.
This step will not make any change in this In this statement, we will apply negation to the
problem. conclusion statements, which will be written as
¬likes(John, Peanuts)

Step-4: Draw Resolution graph:

Now in this step, we will solve the


problem by resolution tree using substitution.
For the above problem, it will be given as
follows:

FORWARD AND BACKWARD CHAINING

In artificial intelligence, forward and backward chaining is one of the important


topics, but before understanding forward and backward chaining lets first understand that
from where these two terms came.
Inference engine:

The inference engine is the component of the intelligent system in artificial intelligence,
which applies logical rules to the knowledge base to infer new information from known facts.
The first inference engine was part of the expert system. Inference engine commonly
proceeds in two modes, which are:
a. Forward chaining

b. Backward chaining

Horn Clause and Definite clause:

Horn clause and definite clause are the forms of sentences, which enables knowledge base to
use a more restricted and efficient inference algorithm. Logical inference algorithms use
forward and backward chaining approaches, which require KB in the form of the first-order
definite clause.

Definite clause: A clause which is a disjunction of literals with exactly one positive
literal is known as a definite clause or strict horn clause.

Horn clause: A clause which is a disjunction of literals with at most one positive literal is
known as horn clause. Hence all the definite clauses are horn clauses.

Example: (¬ p V ¬ q V k). It has only one positive literal k.

It is equivalent to p ∧ q → k.

Forward Chaining

Forward chaining is also known as a forward deduction or forward reasoning method when
using an inference engine. Forward chaining is a form of reasoning which start with atomic
sentences in the knowledge base and applies inference rules (Modus Ponens) in the forward
direction to extract more data until a goal is reached.

The Forward-chaining algorithm starts from known facts, triggers all rules whose premises
are satisfied, and add their conclusion to the known facts. This process repeats until the
problem is solved.

Properties of Forward-Chaining:

o It is a down-up approach, as it moves from bottom to top.


o It is a process of making a conclusion based on known facts or data, by starting from
the initial state and reaches the goal state.
o Forward-chaining approach is also called as data-driven as we reach to the goal using
available data.
o Forward -chaining approach is commonly used in the expert system, such as CLIPS,
business, and production rule systems.

Consider the following famous example which we will use in both approaches:

Example:

"As per the law, it is a crime for an American to sell weapons to hostile nations. Country A,
an enemy of America, has some missiles, and all the missiles were sold to it by Robert, who
is an American citizen."
Prove that "Robert is criminal."

To solve the above problem, first, we will convert all the above facts into first-order definite
clauses, and then we will use a forward-chaining algorithm to reach the goal.

Facts Conversion into FOL:


o It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r
are variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
o Country A has some missiles. ?p Owns(A, p) ∧ Missile(p). It can be written in two
definite clauses by using Existential Instantiation, introducing new Constant T1.
Owns(A, T1) ......(2)
Missile(T1) .......(3)
o All of the missiles were sold to country A by Robert.
?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
o Missiles are weapons.
Missile(p) → Weapons (p) .......(5)
o Enemy of America is known as hostile.
Enemy(p, America) →Hostile(p) ........(6)
o Country A is an enemy of America.
Enemy (A, America) .........(7)
o Robert is American
American(Robert). ..........(8)

Forward chaining proof:

Step-1:

In the first step we will start with the known facts and will choose the sentences which do not
have implications, such as: American(Robert), Enemy(A, America), Owns(A, T1), and
Missile(T1). All these facts will be represented as below.

Step-2:

At the second step, we will see those facts which infer from available facts and with satisfied
premises.

Rule-(1) does not satisfy premises, so it will not be added in the first iteration.

Rule-(2) and (3) are already added.

Rule-(4) satisfy with the substitution {p/T1}, so Sells (Robert, T1, A) is added, which infers
from the conjunction of Rule (2) and (3).
Rule-(6) is satisfied with the substitution(p/A), so Hostile(A) is added and which infers from
Rule-(7).

Step-3:

At step-3, as we can check Rule-(1) is satisfied with the substitution {p/Robert, q/T1, r/A},
so we can add Criminal(Robert) which infers all the available facts. And hence we reached
our goal statement.

Hence it is proved that Robert is Criminal using forward chaining approach.

Backward Chaining:

Backward-chaining is also known as a backward deduction or backward reasoning method


when using an inference engine. A backward chaining algorithm is a form of reasoning,
which starts with the goal and works backward, chaining through rules to find known facts
that support the goal.

Properties of backward chaining:

o It is known as a top-down approach.


o Backward-chaining is based on modus ponens inference rule.
o In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts
true.
o It is called a goal-driven approach, as a list of goals decides which rules are selected
and used.
o Backward -chaining algorithm is used in game theory, automated theorem proving
tools, inference engines, proof assistants, and various AI applications.
o The backward-chaining method mostly used a depth-first search strategy for proof.

Example:

In backward-chaining, we will use the same above example, and will rewrite all the rules.

o American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)


Owns(A, T1) ........(2)
o Missile(T1)
o ?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
o Missile(p) → Weapons (p) .......(5)
o Enemy(p, America) →Hostile(p) ........(6)
o Enemy (A, America) .........(7)
o American(Robert). ..........(8)

Backward-Chaining proof:

In Backward chaining, we will start with our goal predicate, which is Criminal(Robert), and
then infer further rules.

Step-1:

At the first step, we will take the goal fact. And from the goal fact, we will infer other facts,
and at last, we will prove those facts true. So our goal fact is "Robert is Criminal," so
following is the predicate of it.

Step-2:

At the second step, we will infer other facts form goal fact which satisfies the rules. So as we
can see in Rule-1, the goal predicate Criminal (Robert) is present with substitution
{Robert/P}. So we will add all the conjunctive facts below the first level and will replace p
with Robert.

Here we can see American (Robert) is a fact, so it is proved here.


Step-3:t At step-3, we will extract further fact Missile(q) which infer from Weapon(q), as it
satisfies Rule-(5). Weapon (q) is also true with the substitution of a constant T1 at q.

Step-4:

At step-4, we can infer facts Missile(T1) and Owns(A, T1) form Sells(Robert, T1, r) which
satisfies the Rule- 4, with the substitution of A in place of r. So these two statements are
proved here.
Step-5:

At step-5, we can infer the fact Enemy(A, America) from Hostile(A) which satisfies Rule-
6. And hence all the statements are proved true using backward chaining.
SEMANTIC TABLEAU

Since the 1980s another technique for determining the validity of arguments in either PC
(Pedictive Coding) or LPC (Linear Predictive Coding)has gained some popularity, owing
both to its ease of learning and to its straightforward implementation by computer programs.
Originally suggested by the Dutch logician Evert W. Beth, it was more fully developed and
publicized by the American mathematician and logician Raymond M. Smullyan. Resting on
the observation that it is impossible for the premises of a valid argument to be true while
the conclusion is false, this method attempts to interpret (or evaluate) the premises in such a
way that they are all simultaneously satisfied and the negation of the conclusion is also
satisfied. Success in such an effort would show the argument to be invalid, while failure to
find such an interpretation would show it to be valid.

The construction of a semantic tableau proceeds as follows: express the premises


and negation of the conclusion of an argument in PC using only negation (∼)
and disjunction (∨) as propositional connectives. Eliminate every occurrence of two negation
signs in a sequence (e.g., ∼∼∼∼∼a becomes ∼a). Now construct a tree diagram branching
downward such that each disjunction is replaced by two branches, one for the left disjunct
and one for the right. The original disjunction is true if either branch is true. Reference to De
Morgan’s laws shows that a negation of a disjunction is true just in case the negations of both
disjuncts are true [i.e., ∼(p ∨ q) ≡ (∼p · ∼q)]. This semantic observation leads to the rule that
the negation of a disjunction becomes one branch containing the negation of each disjunct:

Consider the following argument:

Write:

Now strike out the disjunction and form two branches:

Only if all the sentences in at least one branch are true is it possible for the original premises
to be true and the conclusion false (equivalently for the negation of the conclusion). By
tracing the line upward in each branch to the top of the tree, one observes that no valuation
of a in the left branch will result in all the sentences in that branch receiving the value true
(because of the presence of a and ∼a). Similarly, in the right branch the presence of b and
∼b makes it impossible for a valuation to result in all the sentences of the branch receiving
the value true. These are all the possible branches; thus, it is impossible to find a situation in
which the premises are true and the conclusion false. The original argument is therefore valid

This technique can be extended to deal with other connectives:

Furthermore, in LPC, rules for instantiating quantified wffs need to be introduced. Clearly,
any branch containing both (∀x)ϕx and ∼ϕy is one in which not all the sentences in that
branch can be simultaneously. Again, if all the branches fail to be simultaneously satisfiable,
the original argument is valid.
UNIFICATION ALGORITHM
CONVERSION TO DIFFERENT FORMS

DEDUCTION
PROPOSITIONAL THEOREM PROVING

Theorem proving is very popular in artificial intelligence application in mathematics. It was a


very early technique proved to be effective in checking the mathematical theorems.

Standard Logical Equivalence

INFERENCING

It applies logical rulesw to the knowledge base to infer new information from known facts.
Inference engine proceeds in two modes:
1. Forward Chaining 2. Backward Chaining
The location of inference engine is shown in the figure here.
In artificial intelligence, we need intelligent computers which can create new logic
from old logic or by evidence, so generating the conclusions from evidence and
facts is termed as Inference.

Inference rules:

Inference rules are the templates for generating valid arguments. Inference rules are applied
to derive proofs in artificial intelligence, and the proof is a sequence of the conclusion that
leads to the desired goal.

In inference rules, the implication among all the connectives plays an important role.
Following are some terminologies related to inference rules:

o Implication: It is one of the logical connectives which can be represented as P → Q.


It is a Boolean expression.
o Converse: The converse of implication, which means the right-hand side proposition
goes to the left-hand side and vice-versa. It can be written as Q → P.
o Contrapositive: The negation of converse is termed as contrapositive, and it can be
represented as ¬ Q → ¬ P.
o Inverse: The negation of implication is called inverse. It can be represented as ¬ P →
¬ Q.

From the above term some of the compound statements are equivalent to each other, which
we can prove using truth table:

Play Video

Hence from the above truth table, we can prove that P → Q is equivalent to ¬ Q → ¬ P, and
Q→ P is equivalent to ¬ P → ¬ Q.
Types of Inference rules:
1. Modus Ponens:

The Modus Ponens rule is one of the most important rules of inference, and it states that if P
and P → Q is true, then we can infer that Q will be true. It can be represented as:

Example:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.

Proof by Truth table:

2. Modus Tollens:

The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P will also true. It
can be represented as:

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P

Proof by Truth table:

3. Hypothetical Syllogism:

The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true, and Q→R
is true. It can be represented as the following notation:
Example:

Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R

Proof by truth table:

4. Disjunctive Syllogism:

The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q will be true. It
can be represented as:

Example:

Statement-1: Today is Sunday or Monday. ==>P∨Q


Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q

Proof by truth-table:

5. Addition:

The Addition rule is one the common inference rule, and it states that If P is true, then P∨Q
will be true.
Example:

Statement: I have a vanilla ice-cream. ==> P


Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)

Proof by Truth-Table:

6. Simplification:

The simplification rule state that if P∧ Q is true, then Q or P will also be true. It can be
represented as:

Proof by Truth-Table:

7. Resolution:

The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be true. It can be
represented as

Proof by Truth-Table:
MONOTONIC AND NON-MONOTONIC REASONING

Monotonic Reasoning:

In monotonic reasoning, once the conclusion is taken, then it will remain the same
even if we add some other information to existing information in our knowledge base. In
monotonic reasoning, adding knowledge does not decrease the set of prepositions that can be
derived.

To solve monotonic problems, we can derive the valid conclusion from the available
facts only, and it will not be affected by new facts.

Monotonic reasoning is not useful for the real-time systems, as in real time, facts get
changed, so we cannot use monotonic reasoning.

Monotonic reasoning is used in conventional reasoning systems, and a logic-based


system is monotonic.

Any theorem proving is an example of monotonic reasoning.

Example:

o Earth revolves around the Sun.

It is a true fact, and it cannot be changed even if we add another sentence in


knowledge base like, "The moon revolves around the earth" Or "Earth is not round," etc.

Advantages of Monotonic Reasoning:

o In monotonic reasoning, each old proof will always remain valid.


o If we deduce some facts from available facts, then it will remain valid for always.

Disadvantages of Monotonic Reasoning:

o We cannot represent the real world scenarios using Monotonic reasoning.


o Hypothesis knowledge cannot be expressed with monotonic reasoning, which means
facts should be true.
o Since we can only derive conclusions from the old proofs, so new knowledge from
the real world cannot be added.
Non-monotonic Reasoning

In Non-monotonic reasoning, some conclusions may be invalidated if we add some


more information to our knowledge base.

Logic will be said as non-monotonic if some conclusions can be invalidated by adding


more knowledge into our knowledge base.

Non-monotonic reasoning deals with incomplete and uncertain models.

"Human perceptions for various things in daily life, "is a general example of non-
monotonic reasoning.

Example: Let suppose the knowledge base contains the following knowledge:

o Birds can fly


o Penguins cannot fly
o Pitty is a bird

So from the above sentences, we can conclude that Pitty can fly.

However, if we add one another sentence into knowledge base "Pitty is a penguin",
which concludes "Pitty cannot fly", so it invalidates the above conclusion.

Advantages of Non-monotonic reasoning:

o For real-world systems such as Robot navigation, we can use non-monotonic


reasoning.
o In Non-monotonic reasoning, we can choose probabilistic facts or can make
assumptions.

Disadvantages of Non-monotonic Reasoning:

o In non-monotonic reasoning, the old facts may be invalidated by adding new


sentences.
o It cannot be used for theorem proving.

You might also like