Block 1
Block 1
Block 1
Introduction
Objectives
Some Simple Definition of A.I.
Definition by Eliane Rich
Definition by Buchanin and Shortliffe
Another Definition by Elaine Rich
Definition by Barr and Feigenbaum
Definition by Shalkoff
Summary
Further Readings/References
Introduction to Intelligence
and Artificial Intelligence
Page Nos.
5
6
6
6
8
12
13
18
19
20
1.0 INTRODUCTION
In this unit, we discuss intelligence, both machine and human. However, as our
subject matter in the course is machine intelligence, or artificial intelligence, our
discussion of the subject matter is mainly from the point of view of machine
intelligence. Machine intelligence is popularly known as Artificial Intelligence and is
generally referred to by its abbreviation viz. AI. We also shall use the name AI for
the discipline throughout. The style of discussion in this unit is to start with a
definition of AI by some pioneer in the field, and then elaborate the ideas involved in
the definition. Further, while elaborating the ideas involved in the definition, we
introduce a number of relevant new ideas, concepts and definitions to be used later. In
this process, we have introduced and/or explained the following:
i)
ii)
iii)
iv)
v)
vi)
vii)
viii)
Introduction to A.I
1.1 OBJECTIVES
After going through this unit, you should be able to:
discuss the concepts of intelligence and artificial intelligence as visualised by
a number of leading experts in the field;
enumerate the fields in which human beings are still better than computers;
tell the difference between the concepts of:
(i) Symbol and number
(ii) Algorithmic and non-algorithmic methods
(iii) Information and knowledge
(iv) Polynomial time and exponential time complexities
tell the relation of information to organisation and to intelligence.
Comment 1, Definition 1: Implicit in the Richs definition is the idea that there are
mental tasks that computers can do better than human beings and vice-versa, there are
tasks which at the moment human beings can do better than computers. It is wellknown that computers are better than human beings in the matter of
numerical computation,
Introduction to Intelligence
and Artificial Intelligence
On the other hand, at the moment, human beings are much better than machine in
the matter of
understanding including the capability of explaining,
predicting the behaviour and structure of a system,
in the matter of common-sense reasoning,
in drawing conclusions when available information is either incomplete,
inconsistent or even both, and
also, in visual understanding and speech understanding, which require
simultaneous availability (availability in parallel) of large amount of information.
In essence, it is found that computers are better than human beings in tasks
requiring sequential but fast computations, where human beings are better than
computers in tasks, requiring essentially parallel processing. In order to clarify
what it is for a problem to essentially require parallel processing for its solution, we
consider the following problem:
C
Figure 1.1
We are given a paper with some letter, say, C written on it and a card-board with a
pin-hole in it. The card board is placed on the paper in such a manner that the letter is
fully covered by the card board as shown in Figure 1.1. We are allowed to look at the
paper only through the pin-hole in the card-board. The problem is to tell correctly the
letter written on the paper by just looking through the pin-hole. As the information
about the black and white pixels is not available simultaneously, it is not possible to
figure out the letter written on the paper. The figuring out the letter on the paper
requires, simultaneous availability of the whole of the grey-level information of all the
points constituting the letter and its surrounding on the paper. The gray-level
information of the surrounding of the letter provides the context in which to interpret
the letter.
We consider another example that shows the significance of contextual information or
knowledge and its simultaneous availability for visual understanding. From the
following picture, we can conclude that one of the curved lines represents a river and
other curved lines represent sides of the hills only on the basis of the simultaneous
availability of information of the pixels.
Introduction to A.I
Contextual information plays a very important role not only in the visual
understanding but also in the language and speech understanding. In case of speech
understanding, consider the following example, in which the word with has a
number of meanings (or connotations) each being determined by the context.
Further, the phrase for a long time may stand for a few hours to millions of years,
but again determined by the context, as explained below.
Definition 2 AI is the branch of computer science that deals with symbolic rather
than numeric processing and non-algorithmic methods including the rules of
thumb or heuristics instead of algorithms as techniques for solving problems.
Introduction to Intelligence
and Artificial Intelligence
Introduction to A.I
use symbolic processing. It is not out of place to mention that not all problems
which even can be stated precisely or formally, are amenable to computer
solutions using even symbolic processing. More discussion in this respect follows
next, under Comments/Explanations 2 for Definition 2.
Comments/Explanation 2, Definition 2 : Algorithmic method vs non-algorithmic
method, heuristics : We recall that an Algorithm is a step-by-step procedure with
well-defined starting and ending points, which is guaranteed to reach a solution to a
specific problem. A solution to a problem which can be expressed as an algorithm is
called an algorithmic solution. An algorithmic solution may involve only numeric
processing or may involve symbolic processing with/without numeric processing. For
the purpose of further discussion, symbolic processing includes/subsumes numeric
processing. Algorithmic approach even when using symbolic processing has
limitations. During 1930s, a number of logicians and mathematicians including
Gdel, Church, Post, Turing and Kleene suggested a number of mathematical
models of a computer, and through these models tried to explain the nature of
computation, established a number of useful results about computation and also
found the limits of computational power.
They proved that even through a problem may be expressed precisely or formally (i.e.,
in terms of mathematical entities like sets, relations functions etc.), yet it need not
yield to an algorithmic solution. A problem which has at least one algorithmic
solution is called a solvable problem. They further proved that out of even solvable
problems, only a small fraction can be solved if only feasible amount of resources
like, time and space are used. Informally, feasible amount of resources means that
the requirement for resources does not increase too rapidly with the increase in size of
the problem. The notion of the size of a problem will be defined formally later on
(under comment 1 on Definition 3). However, an intuitive idea about the concept of
the size of a problem and its role in estimating the resource requirement for solving
the problem can be had through the simple problem of calculating income tax for each
of the tax-payers. The requirement of resources like, time and computing equipment
for 1000 tax-payers would be much less, as compared to the requirement of resources
for computing income-tax for one million tax payers. In this problem, n, the number of
tax-payers for whom the income-tax is to be calculated, may be taken as size of the
problem.
This limitation and other difficulties with algorithmic solutions has given impetus to
efforts for finding non-algorithmic solutions of problems. Neural Network
approach to solving many difficult problems, is a well-known alternative to
algorithmic methods of solving problems. In AI, there are mainly two approaches to
solve problems, which generally difficult to solve with algorithmic methods. One
approach is Neural approach, mentioned just above. The other approach is called
symbolic approach. The symbolic approach cannot be said to be non-algorithmic. The
main difference between symbolic approach of AI and algorithmic approach is that
symbolic approach of AI emphasizes exploitation of the knowledge of the domain and
the environment of the problem under consideration. Some of this knowledge is in the
form rules of thumb, generally, called heuristics in AI.
In order to realise the limitations of algorithmic approach to solving problems, we
need not refer to highly theoretical work by the earlier mentioned
logicians/mathematicians. The limitation of the approach may be appreciated through
the following simple example.
Consider the problem of crossing from one side over to the other side of a busy road
on which a number of vehicles are moving at different velocities. A step-by-step (i.e.,
algorithmic) method of solving this problem may consist of:
10
(i)
(ii)
(iii)
(iv)
Introduction to Intelligence
and Artificial Intelligence
1 2
at , and
2
calculating the times that would be taken by each of the various vehicles to
reach the path intended to be followed to cross over.
Adjusting dynamically our speeds on the path so that no collision takes place
with any of the vehicle moving on the road.
The above is a systematic step-by-step method, i.e., an algorithm, of crossing the road
that may ensure no collision with any vehicle. But, how many of us can follow it?
Hardly anybody! First of all, it is practically impossible to measure distances,
velocities and accelerations of various vehicles on the road, even within a radius of
one kilometer. Secondly, even if we assume theoretically that it is possible to measure
distances, velocities and accelerations of various vehicles and to calculate safe timings
to cross the road, we would not like or care to follow the above-mentioned algorithm,
because our past experience, our sense of survival and other built-in mechanisms have
allowed us, in the past, to cross over safely without following any systematic method.
All of us just guess the distances of the vehicles, safe enough to cross over, and then
actually cross over at an appropriate time. Not even one in 1000, on an average gets
hurt when crossing a road using only guesses, in a crowded city like, Delhi, where
movement of vehicles is one of the most chaotic and unruly in the whole world.
However, this is not to deny that once in a while, the guess is incorrect and someone
or other gets hurt or even is killed almost every day.
Each one of us every day, comes across hundreds of problems similar to the one of
crossing of a road. And, for each such problem one uses a good guess and one
generally is able to solve the problem satisfactorily each time, though the solutions
may not be the best possible ones. And, or once in a while, we even fail to get any
solution using the guess. However, if we insist on only following a systematic stepby-stop method that guarantees best possible solution for solving each problem, then
we would hardly be able to make any progress in our day to day business of even
mere survival.
The essence of the above discussion is that while attempting solutions of many of the
problems, it is not only desirable but almost essential that for each of such problems
we follow some good guess instead of following a step-by-step systematic method
that guarantees the best solution. In A.I, these guesses are called heuristics. In later
chapters, we discuss heuristics in detail. However, for the time being, we state that
heuristics are good guesses, possibly based on past experience, judgement, intuition
or hunches, which lead us most of the time to reasonably good solutions, though these
guesses do not guarantee the best solutions or even any solution for every instance of
the problem under consideration.
The advantage of using heuristics is that we do not have to rethink completely
everytime we are faced with a problem of the type of which another problem has
already been solved satisfactorily. If we have a handy rule of thumb that may apply to
the current problem, it may suggest to us how to proceed.
11
Introduction to A.I
12
Introduction to Intelligence
and Artificial Intelligence
In view of the previous comments, no polynomical time algorithmic solution can exist
for any (exponentially) hard problem. However, there are mechanisms/techniques
which when used in a solution of a hard problem, though divest the solution of its
step-by-step or algorithmic characteristic, yet may make it a polynomial time solution.
Use of appropriate knowledge of the problem domain has been found useful in
techniques that when used, solve hard problems in polynomial time. Definition 3
declares the scope of (or the subject-matter) AI as the study of techniques that
exploit appropriate knowledge to solve hard problems in polynomial time. The
role of appropriate knowledge in reducing time complexity of a solution cannot be
overemphasized. The following simple example supports this claim abundantly:
Ms X is to meet Ms Y at her residence. Initially, let us assume that Ms X knows only
that Ms Y lives in Delhi and knows nothing else about Ms Ys residence. A step-bystep or algorithmic solution to the problem may be to search the residential places, one
by one, in some order, in Delhi and to stop when Ms. Ys place is located. The
complexity of the algorithm, on the average, is undoubtedly very large. However, if
X further knows that Y lives in some particular colony say Hauz Khas in Delhi, then
search is substantially reduced by searching residential places only within Hauz Khas.
Further, if Ms X also knows the house number in Hauz Khas, then there is hardly any
search required and X can directly reach Ys residence. Next, consider just opposite
situation so far as availability of knowledge is concerned. Let us X even do not know
that Y lives in Delhi. We can easily guess the plight of X when she, if follows a stepby-step method, is required to search, possibly all over the world, for the residence of
Y.
The importance of (relevant) knowledge in solving difficult problems was recognised
by the pioneers in the very early stages in the development of A.I. As we shall find
subsequently, major portion of A.I. is constituted of discussion of various issues
about knowledge: methods for acquisition of knowledge, for representation of
knowledge, for organisation of knowledge, for manipulation of knowledge, for
maintenance of knowledge and for restricting search of the problem domain by
exploiting the knowledge of the domain.
13
Introduction to A.I
Fisher and Firschein in their book Intelligence: The Eye, the Brain and the
Computer [9] on Page 4 state that they expect an intelligent agent to be able to:
They further state that there are a number of human attributes that are related
to the concept of intelligence, but are normally considered distinct from it:
14
Awareness (consciousness)
Aesthetic appreciation (art, music)
Emotion (anger, sorrow, pain, pleasure, love, hate)
Sensory acuteness
Muscular coordination (motor skills)
Introduction to Intelligence
and Artificial Intelligence
Next, we discuss intelligence from more fundamental level. The ideas explained
below are based on the Information Transfer Model of scientific phenomena due to
Norbert Wiener (1894-1964). Norbert Wiener, an intellectual prodigy and author of
the famous book entitled Cybernetics [14], suggested the Transfer of Information
model to be a better model than the prevailing model based on Transfer of Energy for
explanation of a number of scientific phenomena. Through the Wieners theory, a new
discipline was born, also, called Cybernetics
However, our discussion is mainly based on ideas explained in the book Beyond
Information by Tom Stonier [10]: According to the ideas explained in Stonier,
there are four fundamental properties of the universe viz. energy, matter,
information and evolution (or change). The cardinality of information in the
universal scheme of things can be judged from the following argument: All the
entities from down to nucleons to the whole of the universe, each is known to us as an
organised system of simpler objects, e.g., fundamental particles organise into
nucleolus, nucleolus organise to form atomic nuclei, which alongwith electrons and
protons organise into atoms and so on. Molecules, polymers, membranes, organs,
living beings, societies, planets, planetary systems, galaxies and finally the whole
universe, each is known as an organised system of some simpler objects. An
organisation builds upon pre-existing organisations. Thus an organised system is
recursively obtained (or defined) as an interdependent assembly of elements
and/or organised systems. And it is information what is exchanged between
components of an organised system to effect their interdependence and to maintain
the integrity of the system as long as the system survives against the fourth
fundamental property of the universe, i.e., evolution or change. Gravitational pull,
now an established entity, is just an information processing activity. Thus
information is no more or no less an abstract concept than energy or matter.
What mass is to matter and the heat is to energy, so is organisation to
information. Each of the former is a visible and measurable form of the
corresponding latter. More the mass, more the matter in a system; more the heat,
more the capacity to do work, i.e., energy in the system; similarly higher the degree
(or more the complexity) of the organization (in terms of underlying organizations of
the components and their components and so on, and in terms of the number and
levels of interactions and relations between components at a particular level) higher is
the information content of the system.
The relation between information and organisation and the characteristic
difference between the two is exactly what is the relation and characteristic
difference between a number and a numeral. A number is an abstract concept,
wheras a numeral is its physical manifestation or representation. A number may have
many representations and even may use many mediums for representations or
manifestations. In the form of, writing on the paper, as patterns of ink dots on a
piece of paper, the same number may be represented as 7 in decimal, 111 in binary,
and even 4 + 2 + 1 again in decimal. In computers memory, the same number is
represented with the help of electronic components, a different medium, and not as
shapes composed of ink-dots. In human brain the same number is represented,
possibly, as some neural net.
Summarising, a number is a concept which needs a medium for its manifestation
or physical representation for the purpose of conveying, or transformation. This
representation is called a numeral. But it should be clear that when we say that I
need two books, the word two is not just the sequence of three letters viz t, w
and o i.e., the representation, which is intended to be conveyed but just it is the
abstract number which is intended to be conveyed. Because of the tangibility or
15
Introduction to A.I
16
and leave large number of cases uncategorisable. To begin with, we start with a
working definition of intelligence and then later expand on it:
Introduction to Intelligence
and Artificial Intelligence
17
Introduction to A.I
18
Objections to Turing Test: There have been a number of objections to the Turing
test as a test of intelligence of a machine. One of the most well known objections is
called Chinese Room Test proposed by John Searle. The essence of the Chinese
Room Test, that we are going to explain below, is that convincing successfully by a
system, say A , of possessing qualities of another system, say B, does not imply that
the system A actually possesses the qualities of B. For example, the capability of
convincing others by a male human of being a woman, does not give the male the
quality of bearing a child like a woman.
Introduction to Intelligence
and Artificial Intelligence
The scenario for the Chinese Room Test consists of a single room with two windows.
In the room a scholar on Shakespeare, knowing English, but not knowing Chinese, is
sitting with a sort of encyclopedia on Shakespeare. The encyclopedia is printed in
such a way that for each pair of facing pages, one page is written in Chinese
characters and the other page is translation in English of the contents of the facing
page in Chinese. Through one of the windows questions on Shakespeares literature in
Chinese characters are sent to the person sitting inside. The person looks through the
encyclopedia and on finding in the encyclopedia the exact copy of the sequence of
characters sent in, reads its translation in English, thinks of its answer and writes the
answer in English for his/her own understanding, finds the corresponding sequence of
Chinese characters in the encyclopedia, and sends the sequence of Chinese characters
through the other window. Now, Searle says that, though the scholar successfully
behaves as if s/he knows Chinese, but, as per assumption it is not so. Just from the fact
that a system is able to simulate a quality, it can not be inferred that the system
possesses the quality.
1.8 SUMMARY
This is an introductory unit to the course. The unit gives a birds eye view of the
whole of the course of Artificial Intelligence. The approach, in the unit, is to start with
a definition by some pioneer in A.I. In the process of discussion of the definition, a
number of relevant new concepts are gradually built up and discussed.
In Section 0.3, we discuss definition of A.I., as given by Eliane Rich . It states:
Artificial Intelligence is the study of how to make computers do things, at which,
at the moment, people are better.
.
In this context, it was discussed that human beings are still better than computers in
the problem areas, which require parallel processing and simultaneous availability of
information.
According to the next definition of A.I., as given by Buchamin & Shortliffe:
AI is the branch of computer Science that deals with symbolic rather than
numeric processing and non-algorithmic methods including the rules of thumb or
heuristics in stead of algorithms as techniques for solving problems.
In Section 0.4, we discuss the differences (i) between number and symbol, (ii)
between algorithmic and non-algorithmic methods of solving problems.
In the Section 0.5, another definition by Eliane Rich, as given below, is discussed:
Artificial Intelligence is the study of techniques for solving exponentially hard
problems in polynomial time exploiting knowledge about the problem domain.
In context of this definition, we discuss the difference between exponentially hard
problems versus polynomial time problem.
In section 0.6, we discuss the following definition of A.I. by Barr & Feigenbaum:
Artificial Intelligence is the part of computer science concerned with designing
19
Introduction to A.I
20
The Propositional
Logic
Introduction
Objectives
Logical Study of Valid and Sound Arguments
Non-Logical Operators
Syntax of Propositional Logic
Semantics/Meaning in Propositional Logic
Interpretations of Formulas
Validity and Inconsistency of Propositions
Equivalent forms in the Prepositional Logic (PL)
Normal Forms
Logical Deduction
Applications
Summary
Solutions/Answers
Further/Readings
Page Nos.
21
23
23
25
26
27
29
30
32
33
35
37
38
38
43
2.0 INTRODUCTION
Symbolic logic may be thought of as a formal language for representing facts about
objects and relationships between objects of a problem domain alongwith a precise
inferencing mechanism for reasoning and deduction. An inferencing mechanism
derives the knowledge, which is not explicitly/directly available in the knowledge
base, but can be logically inferred from what is given in the knowledge base.
The reason why the subject-matter of the study is called Symbolic Logic is that
symbols are used to denote facts about objects of the domain and relationships
between these objects. Then the symbolic representations and not the original facts
and relationships are manipulated in order to make conclusions or to solve problems.
Also, we mentioned that a Symbolic Logic, apart from having other characteristics, is
a formal language. As a formal language, there must be clearly stated unambiguous
rules for defining various constituents or constructs, viz. alphabet set, words, phrases,
sentences etc. of the language and also for associating meaning to each of these
constituents.
The study of Symbolic Logic is significant, specially, for academic pursuits, in view
of the fact that it is not only descriptive (i.e., it tells how the human beings reason)
but it is also normative (i.e., it tells how the human beings should reason).
In this unit, we shall first study the simplest form of symbolic logic, viz, the
Propositional Logic (PL). In the next unit, we consider a more general form of logic
called the First-Order Predicate Logic (FOPL). Subsequently, we shall consider other
symbolic systems including Fuzzy systems and some Non-monotonic systems.
In the propositional logic, we are interested in declarative sentences, i.e., sentences
that can be either true or false, but not both. Any such declarative sentence is called a
proposition or a statement. For example
(i)
(ii)
21
Introduction to A.I
(iii)
The truth of the proposition: Ram has a Ph. D degree. depends upon whether
Ram is actually a Ph. D or not.
Though, at present, it may not be known whether the statement is True or False,
yet it is sure that the sentence is either True or False and not both True and False
simultaneously.
For a given declarative sentence, its being True or False is called its Truth-value.
Thus, truth-value of (i) above is False and that of (ii) is True.
On the other hand, none of the following sentences can be assigned a truth-value, and
hence none of these, is a statement or a proposition:
(i)
Who was the first Prime Minister of India? (Interrogative sentence)
(ii) Please, give me that book. (Imperative sentence)
(iii) Ram must exercise regularly. (Imperative, rather Deontic)
(iv) Hurrah! We have won the trophy. (Exclamatory sentence)
In propositional logic, as mentioned earlier also, symbols are used to denote
propositions. For instance, we may denote the propositions discussed above as
follows:
P : The sun rises in the west,
Q : Sugar is sweet,
R : Ram has a Ph.D. degree.
The symbols, such as P, Q, and R, that are used to denote propositions, are called
atomic formulas, or atoms. As discussed earlier, in this case, the truth-value of P is
False, the truth-value of Q is True and the truth-value of R, though not known yet, is
exactly one of True or False, depending on whether Ram is actually a Ph. D or
not.
At this stage, it may be noted that once symbols are used in place of given statements
in, say, English, then the propositional system, and, in general, a symbolic system is
aware only of symbolic representations, and the associated truth values. The system
operate only on these representations. And, except for possible final translation, is not
aware of the original statements, generally given in some natural language, say,
English.
We can build, from atoms, more complex propositions, sometimes called compound
propositions, by using logical connectives.
Examples of such propositions are:
(i) Sun rises in the east and the sky is clear, and
(ii) If it is hot then it shall rain.
The logical connectives in the above two propositions are and and ifthen. In the
propositional logic, five logical operators or connectives, viz., ~ (not), (and),
(or), (if then), and (if and only if), are used. These five logical connectives can
be used to build compound propositions from given atomic formulas. More generally,
they can be used to construct more complicated compound propositions from
compound propositions by applying the connectives repeatedly. For example, if each
of the letters P, Q, C is used as a symbol for the corresponding statement, as follows:
P: The wind speed is high.
Q: Temperature is low.
C: One feels comfortable.
22
The Propositional
Logic
2.1 OBJECTIVES
After going through this unit, you should be able to:
tell about what is Logic, Symbolic Logic, and Propositional Logic (PL); further,
about why we study each of these; and about some detailed subject matter of
each of these;
tell the difference between a Proposition/Statement, which forms the basis of PL,
and a sentence in a natural language;
explain the difference between a logical operator and a non-logical operator; any
symbolic logic uses only logical operators;
explain the concept of arguments in a logical system and further should be able to
explain mutual differences between a (i) valid argument (ii) sound argument
(iii) invalid argument, and (iv) unsound argument;
explain the difference between various types of wffs, viz, valid wff; consistent
wff, invalid wff and inconsistent wff;
explain about the various tools, like truth table, logical deduction and reduction
to normal forms that are used to establish validity/invalidity of arguments, and
further should be able to use these tools for the purpose, and
use the tools and techniques of PL in solving problems that can be solved within
a PL system.
23
Introduction to A.I
24
The Propositional
Logic
(True statement/conclusion)
25
Introduction to A.I
Thus, by using the connective because we get a correct/True conclusion from two
True statements viz. P and Q.
Argument ( 2)
In the following using the word, because, we get incorrect/false conclusion from
True statements
Let
P: Dr. Man Mohan Singh was Prime Minister of
India in the year 2006
(True statement)
R: Chirapoonji, a town in north-east India, received maximum average rainfall in the
world during 1901-2000.
(True statement)
However to say
P because R, i.e., to say
Dr. Man Mohan Singe was Prime Minster of India in 2006, because Chirapoonji, a
town in north-east India, received maximum average rainfall in the world during
1901-2000.
is at least incorrect, if not ludicrous.
Thus from two True statements, P and R and by using connective because, in this
case, the conclusion is incorrect.
Thus, by using connective because, in one argument we get a correct conclusion from
two True statements and, on the other hand, we get an incorrect conclusion from True
statements.
An atom is a wff.
If A is a wff, then (~A) is a wff.
If A and B are wffs, then each of (A B), (A B), (A B), and (A B) is a
wff.
Any wff is obtained only by applying the above rules.
From the above recursive definition of a wff it is not difficult to see that expression:
(( P ( Q ( ~ R))) S) is a wff; because , to begin with, each of P, Q , ( ~ R) and
S, by definitions is a wff. Then, by recursive application, the expression: (Q ( ~ R))
is a wff. Again, by another recursive application, the expression: (P (Q ( ~ R)))
is a wff. And, finally the expression given initially is a wff.
Further, it is easy to see that according to the recursive definition of a wff, each of the
expressions: (P (Q )) and (P ( Q R )) is not a wff.
26
Thus, has least priority and ~ has highest priority. Further, if in an expression,
there are no parentheses and two connectives between three atomic formulas are used,
then the operator with higher priority will be applied first and the other operator will
be applied later.
The Propositional
Logic
For example: Let us be given the wff P Q ~ R without parenthesis. Then among
the operators appearing in wff, the operator ~ has highest priority. Therefore, ~ R is
replaced by (~R). The equivalent expression becomes P Q (~ R). Next, out of the
two operators viz and , the operators has higher priority. Therefore, by
applying parentheses appropriately, the new expression becomes P (Q (~ R)).
Finally, only one operator is left. Hence the fully parenthesized expression becomes (P
(Q (~ R)))
A
(i) T
(ii) T
(iii) F
B
T
F
T
~A
F
F
T
(A B)
T
F
F
(A B)
T
T
T
(iv) F
(A B)
T
F
T
(A B)
T
F
F
27
Introduction to A.I
L
F
T
F
T
SL
T
T
F
T
~L
T
F
T
F
~S
T
T
F
F
There is only one row, viz., first row, in which both the premises viz. S L and ~ L
are True. But in this case the conclusion represented by ~ S is also True. Hence, the
conclusion is valid.
Invalidity through Truth-Table
(i) If I overslept, then I am late
SL
(ii) I did not oversleep, i.e.,
~S
To conclude
(iii) I would not be late, i.e.,
~ L (invalid conclusion)
S
F
F
T
T
F
T
F
T
(S L) ~ S
T
T
F
T
~L
T
T
F
F
T
F
T
F
The invalidity of the argument is established, because, for validity last column must
contain True in those rows for which all axioms/premises are True. But in the second
row both S L and ~ S are True but ~ L is False
Ex. 1 Express the following statements in Propositional Logic.
a) If he campaigns hard, he will be elected.
b) If the humidity is high, it will rain either today or tomorrow.
c) Cancer will not be cured unless its cause is determined and a new drug for
cancer is found.
d) It requires courage and skills to climb a mountain.
Ex. 2: Let
P : He needs a doctor,
R : He has an accident,
U : He is injured.
28
Q : He needs a lawyer,
S : He is sick,
The Propositional
Logic
(S P) (R Q)
(P Q) R
b) P (S U)
d) (P Q) (S U)
29
Introduction to A.I
Table 1.6 Truth Table of (A B (R ( ~ S)
~S
(A B)
(R (~S))
(A B) (R
( ~ S)
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
T
T
T
T
F
F
F
F
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
T
T
T
T
F
F
F
F
F
F
F
F
F
F
F
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
T
F
T
T
T
T
T
T
T
T
T
T
T
T
A table, such as given above, that displays the truth values of a formula G for all
possible assignments of truth values to atoms occurring in G is called a Truth table
of G.
NOTATION: If A1,.An are all the atoms in a formula, it may be more convenient to
represent an interpretation by a set (m1,.mn), where mi is either Ai or ~Ai. mi is
written as Ai if T is assigned to Ai. But mi is written as ~ Ai if F is assigned to Ai.
For example, the set {A, ~B, ~R,S} represents an interpretation of a formula in which
A, B, R, and S are the only atoms and which are, respectively, assigned T, F, F, and T.
We will use the notation throughout.
Ex. 3: Construct a truth table for the formula.
P: (~ A B) (~ (A ~ B))
30
A
T
T
F
F
B
T
F
T
F
(A B)
T
F
T
T
(A B) A
T
F
F
F
((A B) A) B
T
T
T
T
The Propositional
Logic
A
T
T
F
F
B
T
F
T
F
~B
F
T
F
T
(A B)
T
F
T
T
(A ~ B)
F
T
F
F
((A B) (A ~ B)
F
F
F
F
31
Introduction to A.I
Examples:
(i) A Valid Formula:
(a) Even True is a wff which is always True and, hence, True is a valid formula.
(b) G1: A (~A) is True for all its interpretations. As G1 has only one atom viz. A,
terefore, it has only two interpretations. Let one interpretation of G1 be : A is
True. But then G1 assumes the value (True (~ True)) = True. The other
interpretation of G1 is : A is False. Then G1 assumes the value (False ~ False) =
True.
(ii) Consistent (True for at least one interpretation) but not valid Formula (i.e. is
invalid, i.e., False for at least one interpretation):
(a) The simplest example of such a formula is the formula G2: A. Then, for the
assignment A as True, G2 is True. Therefore G2 is consistent. On the other
hand, the interpretation of G2 with A as False, makes G2 false. Therefore, G2:
A is not valid.
(b) Both G3 : A B and G4 : A B are consistent but not valid. Both G3 and G4
are True under the assignment A as True and B as True. On the other hand,
both are False under the interpretation A as False and B as False.
(iii) Invalid (False for at least one interpretation) but not inconsistent (not False
for all interpretations): Any one of the examples in (ii) above
(iv) Inconsistent formula (i.e., which is false for all interpretations)
(a) Even False is a wff; which is always False, and hence is inconsistent.
(b) G5 : A (~A) is False, for all interpretations of G5. Actually, there are only
two interpretations of G5. One is : A is True. The other is : A is False. In both
cases G5 is False.
It will be shown later that the proof of the validity or inconsistency of a formula is a
very important problem. In the propositional logic, since the number of interpretations
of a formula is finite, one can always decide whether or not a formula in the
propositional logic is valid (inconsistent) by exhaustively examining all of its possible
interpretations.
Ex. 4: For each of the following formulas, determine whether it is valid, inconsistent,
consistent or some combination of these.
(i) E: ~ (~A) B
(ii) G: (A B) (~ B ~ A)
(iii) H: (A ~ A) (A B ) ( ~ A)
(iv) J: (A B) (~ A) ( B ~ B)
32
As will be clear later, it is often necessary to transform a formula from one form to
another, especially to a normal form. This is accomplished by replacing a formula in
the given formula by a formula equivalent to it and repeating this process until the
desired form is obtained.
The Propositional
Logic
Example
We can verify that the formula E: ~ (A B) is equivalent the formula G: to A ~ B
by examining the following truth table. The corresponding values in the last two
columns are identical.
Table Joint Truth table of ~ (A B) and (A ~ B)
A
T
T
F
F
B
T
F
T
F
~B
F
T
F
T
(A B)
T
F
T
T
~(A B)
F
T
F
F
A~B
F
T
F
F
(1.1)
(1.2)
(1.3)(a)
(1.4)(a)
(1.5)(a)
(1.6)(a)
(1.7)(a)
(1.8)(a)
(1.9)
(1.10)(a)
E G = (E G) (G E)
EG=~EG
E G = G E;
(E G) H = E (G H);
E (G H) = (E G) (E H);
E False = E;
E True = True
E ~ E = True;
~ (~ E) = E
~ (E G) = ~ E ~ G;
(b) E G = G E
(b) (E G) H = E (G H)
(b) E (G H) = (E G) (E H)
(b) E True = E
(b) E False = False
(b) E E = E
(b) ~ (E G) = ~ E ~ G
In the table given above, True denotes the fact that the wff is True under all
interpretations and False denotes the wff that is False under all interpretations.
Laws (1.3a), (1.3b) are often, called commutative laws; (1.4a), (1.4b) associative
laws; (1.5a), (1.5b), distributive laws: and (1.10a), (1.10b), De Morgans laws.
33
Introduction to A.I
(~ A B) (A ~ B C)
( A B) ( ~ B ~ A)
Using table of equivalent formulas given above, any valid Propositional Logic
formula can be transformed into CNF as well as DNF.
The steps for conversion to DNF are as follows
Step 1: Use the equivalences to remove the logical operators and :
(i) E G = (E g) (G E)
(ii) E G = ~ E G
Step 2 Remove ~s, if occur consecutively more than once, using
(iii) ~ (~E) = E
(iv) Use De Morgans laws to take ~ nearest to atoms
(v) ~(E G) = ~ E ~ G
(vi) ~(E G) = ~ E ~ G
Step 3 Use the distributive laws repeatedly
(vii) E (G H) = (E G) (E H)
(viii) E (G H) = (E G) (E H)
Example
Obtain a disjunctive normal form for the formula ~ (A (~ B C)).
Consider A (~B C) = ~ A (~B C)
Hence, ~ (A (~ B C)) = ~ (~ A (~B C))
= ~ (~ A) (~ (~ B C))
= A (B (~ C))
= (A B) (A (~ C))
(Using (E F) = (~ E F))
(Using ~ ( E F) =
~ E ~ F)
(Using ~ (~ E) = E and
~ (E F ) = ~ E ~ F
(Using E (F G) =
(E F) (E G))
However, if we are to obtain CNF of ~ A ( (~ B C)), in the last but one step, we
obtain
~ (A (~ B C)) = A (B ~ C), which is in CNF, because, each of A and
( B ~ C) is a disjunct.
Example: Obtain conjunctive Normal Form (CNF) for the formula: D (A
(B C))
34
Consider
D (A (B C))
(using E F = ~ E F for the inner implication)
= D (~ A (B C)) (using E F = ~ E F for the outer implication)
= ~ D (~ A (B C))
= ( ~ D ~ A) (B C) (using Associative law for disjunction)
= (( ~ D ~ A B) (~ D ~ A C)
The Propositional
Logic
(ii) (A B) R
35
Introduction to A.I
B
T
F
T
F
AB
T
F
T
T
~B
F
T
F
T
~A
F
F
T
T
36
The Propositional
Logic
= True (always)
Thus, ((A B) B) ~ A is valid.
Ex. 8: Using Truth Table show that G is a logical consequence of E1 and E2
where E1 : (A B), E2 : ~B , G : ~ A, by establishing validity of the formula (E1 E2
G).
Ex. 9: Use (i) the truth table technique (ii) reduction to DNF/CNF to show that
(A B) ~ B A is inconsistent which, in turn proves that ~ A is a logical
consequence of (A B) and ~ B.
2.11 APPLICATIONS
Next, we discuss some of the applications of Propositional Logic.
Example
Suppose the stock prices go down if the interest rate goes up. Suppose also that most
people are unhappy when stock prices go down. Assume that the interest rate goes up.
Show that we can conclude that most people are unhappy.
To show the above conclusion, let us denote the statements are as follows:
A : Interest rate goes up,
S : Stock prices go down
U : Most people are unhappy
The problem has the following four statements:
1)
2)
3)
4)
= (A (~A S) (~ S U))
(by using E F =
~ E F)
(by using E F =
F E, (to bring the
last clause A in the
beginning)
37
Introduction to A.I
2.12 SUMMARY
In this unit, to begin with, we discuss what is Symbolic Logic and why it is it is
important to study it. The subject matter of symbolic logic consists of arguments,
where an argument consists of a number of statements one of which is called
the conclusion and is supposed to be logically drawn from the others. Each one of the
other is called a premise, To be more specific, the subject of Symbolic Logic is the
study of how to develop tools and technique to draw correct conclusions from a given
set of premisses or to verify whether a conclusion is correct or not. A conclusion is
correct in the sense: Whenever all the premisses are True then conclusion is
necessarily True. An argument with correct conclusion is called a valid argument.
Next, a sound argument is defined as a valid argument in which premises also have to
be True.
(in some world).
In this unit, we study only a specific branch of symbolic logic, viz. Propositional
Logic (PL).
Next, we discuss how a statement, also called a well-formed formula (wff) and also a
Proposition, which is the basic unit of an argument in PL, is appropriately denoted
and how it is interpreted, i.e., how a wff is given meaning. The meaning of a wff in
PL is only in terms of True or False. The wffs are classified as valid, invalid,
consistent and inconsistent.
Then tools and techniques in the form of Truth-table, logical deduction, normal forms
etc are discussed to test these properties of wffs and also to test validity of arguments.
Finally a number of applications of these concepts, tools and techniques of PL are
used to solve problems that involve logical reasoning of PL systems.
2.13 SOLUTIONS/ANSWERS
38
Ex. 1
(a) Let H: He campaigns hard ; E: He will be elected
Then the statement becomes the formula:
HE
(b) Let H: The Humidity is high, RTY: It will rain today
RTW: It will rain tomorrow.
Then
H RTY RTW
(c) Let C: Cancer will be cured
D: Cancers cause will be determined
F: A new drug for cancer will be found
Then the statement becomes the formula:
(~ C) (D F). This formula may also be written as:
CDF
(d) Let C: One has courage
S: One has skill
M: One climbs mountain
Then the statement becomes the formula:
MCS
Ex 2: (a) If he is sick then he needs a doctor, but, if he has an accident then he needs a
lawyer
(b) If One requires a doctor then one must be either sick or injured.
(c) If he needs both a doctor and a lawyer then he has an accident.
(d) One requires a doctor and also a lawyer if and only if one is sick and also
injured.
The Propositional
Logic
Ex. 3:
(i) Truth table of the formula: P: (~ A B) ( ~ (A ~ B)) is as given below.
A
T
T
F
F
B
T
F
T
F
Ex. 4:
(i)
(ii)
(iii)
(iv)
~A
F
F
T
T
~B
F
T
F
T
~A B
T
F
T
T
A~B
F
T
F
F
~ (A ~B)
T
F
T
T
P
T
F
T
T
Consistent but not valid, because, for For B as T and A as F, the formula
is T. But, for A as T and B as F the formula is F.
It can be easily that ~ B ~ A has same truth-value as (A B) for any
interpretation. Therefore, in stead of the given formula, we may consider
the formula
(A B) (A B)
which can be further written as P P, writing (A B) as P. Even P
can be written as P P P (A B), The last formula is F when F and
A is T. The formula is T when A is F and B is T. Hence, the formula is
neither valid nor inconsistent.
Therefore, the formula is consistent but not valid
For all truth assignments to A and B, L. H.S. of the formula is always T
and R. H.S. is always F. Hence the formula is inconsistent, i.e., always F
The L. H. S. of the given formula is F under all interpretations. Hence, the
formula is T under all interpretation. Therefore, the formula is valid.
39
Introduction to A.I
40
(i)
(ii)
The Propositional
Logic
R.H. S. = F
Consider L.H.S, applying associativity of , we get
= (( A B) (~ A ~ B )),
using left distributivity and commutativity of we get
= (( A B) ~ A) (( A B) ~ B)
Using associativity of and using A ~ A = F = B ~ B
= (B F) ( A F)
Using A F = F = B F
=F
Ex. 8: The following table shows that ((A B) ~ B) ~ A is true in every
interpretation. Therefore ((A B) ~ B) ~ A is valid and according to the First
theorem, ~ A is a logical consequence of (A B) and ~ B.
Truth Table of ((A B) ~ B) ~ A
A
T
T
F
F
B
T
F
T
F
AB
T
F
T
T
(AB) ~ B
F
F
F
T
~B
F
T
F
T
~A
F
F
T
T
(AB) ~ B) ~ A
T
T
T
T
Ex. 9: (i) From the following table, ((A B) ~ B A) being False for all
interpretations, is inconsistent.
Truth Table of (A B) ~ B A
A
T
T
F
F
B
T
F
T
F
AB
T
F
T
T
~B
F
T
F
T
(A B) ~ B A
F
F
F
F
41
Introduction to A.I
42
B
T
T
T
T
F
F
F
F
T
T
T
T
F
F
F
F
R
T
T
F
F
T
T
F
F
T
T
F
F
T
T
F
F
S
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
~B
F
F
F
F
T
T
T
T
F
F
F
F
T
T
T
T
~ B (R S)
T
F
F
F
T
T
T
T
T
F
F
F
T
T
T
T
E1
E2
E3
~B
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
T
T
T
T
F
F
F
F
T
T
T
T
F
F
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
F
F
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
F
F
F
T
T
T
T
F
F
F
F
T
T
T
T
~ B (R
S)
T
F
F
F
T
T
T
T
T
F
F
F
T
T
T
T
E1
T
F
F
F
T
T
T
T
T
T
T
T
T
T
T
T
(E1 E2 E3)
~B
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
The Propositional
Logic
Under all interpretations formula is True. Hence, the formula P a valid formula. ~ B is
a logical consequence of E1, E2 and E3. Hence, the The strike will not be over is a
valid conclusion.
43