1
00:00:50,460 --> 00:00:57,460
Right, so, we will now move into a completely
new topic. I think we have done a lot of search.
2
00:00:57,590 --> 00:01:03,620
Now, we will move into a chapter on knowledge
based systems: logic and deduction. This is
3
00:01:03,620 --> 00:01:04,089
a
4
00:01:04,089 --> 00:01:09,140
new thing, which we will start working at,
from this thing. And we will see, that it
5
00:01:09,140 --> 00:01:09,470
is the
6
00:01:09,470 --> 00:01:16,470
combination of search and deduction, which
will make up for almost the en the majority
7
00:01:16,960 --> 00:01:18,560
of the
8
00:01:18,560 --> 00:01:24,800
different kinds of activities or computational
requirements that we have in earth.
9
00:01:24,800 --> 00:01:31,800
So, in this, we are going to study bunch of
different techniques for representing problems
10
00:01:34,050 --> 00:01:34,179
in
11
00:01:34,179 --> 00:01:41,179
logic, and also techniques for deduction,
new facts and new rules, from existing ones.
12
00:01:42,750 --> 00:01:49,750
So, the important things are representation
of real world scenarios and reasoning with
13
00:01:54,570 --> 00:01:56,049
logic.
14
00:01:56,049 --> 00:02:01,840
We will study, firstly, to start with a logic
called propositional logic; then, we will
15
00:02:01,840 --> 00:02:03,000
see,
16
00:02:03,000 --> 00:02:10,000
add further things into the proportional logic,
namely quantifiers, to get into first order
17
00:02:11,230 --> 00:02:17,560
logic; then, we will study inference mechanisms
in proportional logic, as well as in first
18
00:02:17,560 --> 00:02:24,560
order logic. And we will see that depending
on the explicability of your logic, the cost
19
00:02:24,810 --> 00:02:25,060
that
20
00:02:25,060 --> 00:02:32,060
we have to pay is in terms of the computational
complexity of reasoning in those logics. For
21
00:02:32,160 --> 00:02:39,160
example, while finding out the satisfiability
of a proportional logic formula will be shown
22
00:02:39,380 --> 00:02:39,440
to
23
00:02:39,440 --> 00:02:46,440
be- and to complete the question of first,
the satisfiability in first order logic, or
24
00:02:48,180 --> 00:02:48,290
the
25
00:02:48,290 --> 00:02:51,959
validity of a formula in first order logic,
will be semi-decidable.
26
00:02:51,959 --> 00:02:58,430
There will be cases where the problem will
be unsolvable, like you have studied the halting
27
00:02:58,430 --> 00:03:03,680
problem of during machine; there was another
problem that you came across which is unsolvable,
28
00:03:03,680 --> 00:03:09,549
right? We will see- the inference in first
order logic is also semi-decidable, in the
29
00:03:09,549 --> 00:03:09,930
sense
30
00:03:09,930 --> 00:03:16,709
that, in one direction, we can say yes, but
the other direction- no answer can be un-
31
00:03:16,709 --> 00:03:23,139
decidable, right? So, we will look into those
things. We will study some classical techniques
32
00:03:23,139 --> 00:03:29,109
called generalized modus ponens, for reasoning
in first order logic. We will study some kind
33
00:03:29,109 --> 00:03:34,889
of forward and backward chaining mechanisms
for inferencing; these are popularly used
34
00:03:34,889 --> 00:03:35,169
in all
35
00:03:35,169 --> 00:03:42,169
the deduction systems. And we will also study
a technique called resolution, and give you
36
00:03:45,079 --> 00:03:45,150
an
37
00:03:45,150 --> 00:03:52,150
overview of logical reasoning systems that
are currently used in practice. So, there,
38
00:03:52,510 --> 00:03:52,650
we will
39
00:03:52,650 --> 00:03:59,650
start with an example- we will start with
a very well known classical example called
40
00:03:59,900 --> 00:03:59,989
the
41
00:03:59,989 --> 00:04:02,120
wumpus world environment.
42
00:04:02,120 --> 00:04:09,120
So, in that environment, we have the following
kind of thing: we have a grid representing
43
00:04:13,609 --> 00:04:14,479
a
44
00:04:14,479 --> 00:04:21,479
very dark cave; this cave has many chambers,
and in some of these chambers, we have pits;
45
00:04:26,000 --> 00:04:32,290
you fall into a pit, then that is the end
of you, right? So, these are very dark, so
46
00:04:32,290 --> 00:04:32,650
you
47
00:04:32,650 --> 00:04:39,430
cannot see from outside the chamber, whether
the chamber has a pit or not. But, you do
48
00:04:39,430 --> 00:04:39,840
have
49
00:04:39,840 --> 00:04:45,960
some information about the position of the
pits, in the sense that you sense a breeze
50
00:04:45,960 --> 00:04:46,979
when you
51
00:04:46,979 --> 00:04:53,790
are in a pit; when you are in a in a chamber
which is adjacent to a pit. So, for an example,
52
00:04:53,790 --> 00:05:00,790
we have a pit here, so you can send some breeze
here, and some breeze here, right? You have
53
00:05:00,870 --> 00:05:00,990
a
54
00:05:00,990 --> 00:05:06,689
pit here, and you have some breeze in these.
Diagonally adjacent ones are not adjacent;
55
00:05:06,689 --> 00:05:07,090
by
56
00:05:07,090 --> 00:05:14,090
adjacent, we just mean the ones which here,
common wall, with the other chamber.
57
00:05:14,870 --> 00:05:20,159
Now, these chambers also have walls, so it
is not the case, that all that, you can move
58
00:05:20,159 --> 00:05:20,409
from
59
00:05:20,409 --> 00:05:24,939
any one of this chambers; from any one of
them, there could be walls on some of them.
60
00:05:24,939 --> 00:05:25,500
For
61
00:05:25,500 --> 00:05:29,159
example, if there is a wall like this, then
if we are in this chamber, you cannot walk
62
00:05:29,159 --> 00:05:36,159
directly into this chamber, right? Also, in
one, somewhere in this cave, there is a wumpus-
63
00:05:39,150 --> 00:05:44,659
some kind of nasty creature, and if you are
in the same chamber as the wumpus, then the
64
00:05:44,659 --> 00:05:45,129
wumpus
65
00:05:45,129 --> 00:05:52,129
leaves a new door. The wumpus can be on any
of these chambers; it can also be on a chamber
66
00:05:52,870 --> 00:05:58,979
which has a pit, because the wumpus is so
large that it does not fall into the pit,
67
00:05:58,979 --> 00:06:00,650
right? In
68
00:06:00,650 --> 00:06:06,990
addition, the wumpus has a stench, so if you
are in any of this squares, which is adjacent
69
00:06:06,990 --> 00:06:07,210
to
70
00:06:07,210 --> 00:06:14,210
the wumpus, you will get a stench, and you
will also get a stench in the in this in the
71
00:06:14,349 --> 00:06:19,909
chamber in which the wumpus exists, but if
you have already entered that chamber, then
72
00:06:19,909 --> 00:06:20,110
then
73
00:06:20,110 --> 00:06:24,849
there is no point actually getting or not
getting in that stench.
74
00:06:24,849 --> 00:06:31,849
And all of this stench, breeze etc., can be
sensed only when you are in the chamber where
75
00:06:35,300 --> 00:06:35,419
you
76
00:06:35,419 --> 00:06:42,419
have the stench or where you have the breeze,
right? Now, the only reason for our being
77
00:06:43,400 --> 00:06:43,800
in
78
00:06:43,800 --> 00:06:49,069
this in this horrible cave, is that there
is goal somewhere inside it, right? And the
79
00:06:49,069 --> 00:06:54,919
objective is to find the goal without falling
into a pit, and without being consumed by
80
00:06:54,919 --> 00:06:54,990
the
81
00:06:54,990 --> 00:07:00,960
wumpus. Fortunately, in this initial formulation,
the wumpus does not move around- it does not
82
00:07:00,960 --> 00:07:07,749
change chambers. So, wherever it is, it is
going to remain there throughout the game,
83
00:07:07,749 --> 00:07:08,090
and we
84
00:07:08,090 --> 00:07:15,090
have some remedy also. We have one arrow,
and we can shoot that arrow along a straight
85
00:07:17,249 --> 00:07:17,740
line-
86
00:07:17,740 --> 00:07:23,270
say, either this way, or this way; not diagonally-
we can shoot it along a straight line, and
87
00:07:23,270 --> 00:07:30,270
if there is no wall that is blocking it, and
if you find the wumpus in line of the in the
88
00:07:31,099 --> 00:07:37,080
direction in which we are shooting the arrow,
then the wumpus will get killed.
89
00:07:37,080 --> 00:07:42,069
And you will know that it has got killed,
because it will emit terrible scream, right?
90
00:07:42,069 --> 00:07:42,919
So, you
91
00:07:42,919 --> 00:07:49,919
will know that it has got killed. So, this
is the wumpus world and our objective is to
92
00:07:53,469 --> 00:07:53,879
find
93
00:07:53,879 --> 00:08:00,879
out a mechanism of getting the gold. You can
shoot the wumpus, you can go from one cave
94
00:08:01,569 --> 00:08:01,979
to ano
95
00:08:01,979 --> 00:08:07,499
one chamber to another and you cannot see
the walls, so if you bump into a wall, you
96
00:08:07,499 --> 00:08:08,029
will feel
97
00:08:08,029 --> 00:08:13,289
a bump, so, you can backtrack and try some
other path. As you can see, it is also a kind
98
00:08:13,289 --> 00:08:13,779
of
99
00:08:13,779 --> 00:08:20,659
search that we want to do, but except, there
is some inferencing that you have to do. If
100
00:08:20,659 --> 00:08:20,800
you
101
00:08:20,800 --> 00:08:26,050
just blindly search, then you will fall into
a pit or you will go into a chamber which
102
00:08:26,050 --> 00:08:26,599
has a
103
00:08:26,599 --> 00:08:32,330
wumpus. So, as you are searching- as you are
moving from chamber to chamber- your knowledge
104
00:08:32,330 --> 00:08:32,460
is
105
00:08:32,460 --> 00:08:34,020
growing.
106
00:08:34,020 --> 00:08:40,130
So, you will be able to deduce that okay,
in this chamber, I have a breeze, so, in some
107
00:08:40,130 --> 00:08:40,469
or
108
00:08:40,469 --> 00:08:46,120
neighboring chamber, there is a pit. Say,
at this point of time, it senses a breeze
109
00:08:46,120 --> 00:08:46,930
here. Now,
110
00:08:46,930 --> 00:08:53,930
here is a problem- it knows that one of these
adjacent ones has a pit, but it does not know
111
00:08:54,279 --> 00:09:00,990
which one. For this particular kind of example,
there is no full proof- we are finding the
112
00:09:00,990 --> 00:09:07,060
goal, right, because it has to take one risk,
at least, and if it takes the wrong move,
113
00:09:07,060 --> 00:09:07,240
that
114
00:09:07,240 --> 00:09:14,240
is the end of you, right? In many cases, the
wumpus world is very unfair, but there are
115
00:09:14,240 --> 00:09:14,790
also
116
00:09:14,790 --> 00:09:19,450
certain configurations, where, as you move
from square to square, you will build up your
117
00:09:19,450 --> 00:09:24,060
knowledge and you will start deducing that
no, I found breeze there, and I found a stench
118
00:09:24,060 --> 00:09:29,510
there, so the wumpus could be in that square,
but not in this square, so, it is safe to
119
00:09:29,510 --> 00:09:29,830
move
120
00:09:29,830 --> 00:09:32,980
from this square to that square, right?
121
00:09:32,980 --> 00:09:38,090
These are the deductions that will come up,
so, we will have to see how we can formulate
122
00:09:38,090 --> 00:09:38,340
all
123
00:09:38,340 --> 00:09:45,340
these criterion, and all these possible information
that we have, just now, told in form of a
124
00:09:46,110 --> 00:09:53,110
logic, right? And how we can use deduction
to enhance our knowledge and eventually deduce
125
00:09:53,620 --> 00:10:00,620
mechanism of finding the goal? We will come
back to this example later.
126
00:10:02,970 --> 00:10:08,340
This is just what I told you just now; that
adjacent means left, right, top or bottom,
127
00:10:08,340 --> 00:10:08,430
and
128
00:10:08,430 --> 00:10:12,840
then, we have discussed what is a stench,
what is a breeze. There can be one wumpus,
129
00:10:12,840 --> 00:10:13,690
one gold
130
00:10:13,690 --> 00:10:20,690
and many pits. Agent starts from the bottom
left square of the grid. Again, I was already
131
00:10:23,010 --> 00:10:28,490
mentioned all this. Agent dies, if it enters
a square containing a pit, or the wumpus.
132
00:10:28,490 --> 00:10:28,950
Agent
133
00:10:28,950 --> 00:10:35,950
can shoot the wumpus along a straight line,
but it has only one arrow. So, let us come
134
00:10:36,790 --> 00:10:37,720
to
135
00:10:37,720 --> 00:10:44,720
logic. What is logic? It is a formal system
for describing states of affairs, and it
136
00:10:44,740 --> 00:10:50,660
typically- a logic will consist oF2 things:
one is the syntax, which describes how to
137
00:10:50,660 --> 00:10:51,020
write
138
00:10:51,020 --> 00:10:58,020
sentences in this logic, and the semantics,
which tells us what those sentences will actually
139
00:10:58,750 --> 00:11:05,750
mean. And then, we will have a proof theory
for the logic, which will be a set of rules,
140
00:11:07,650 --> 00:11:08,060
which
141
00:11:08,060 --> 00:11:14,180
will deduce wh which will help us in deducing
a set of sentences from another set of
142
00:11:14,180 --> 00:11:21,180
sentences, right? So, we will study some proof
theories. If you have an improper definition
143
00:11:21,410 --> 00:11:21,640
of
144
00:11:21,640 --> 00:11:27,820
logic or an incorrect proof theory, then,
you can actually have all kinds of absurd
145
00:11:27,820 --> 00:11:29,360
reasoning.
146
00:11:29,360 --> 00:11:36,360
For example, if you say that if if you say
that a is a cook, right ok this is this um
147
00:11:50,410 --> 00:11:50,950
this
148
00:11:50,950 --> 00:11:57,950
this thing about this thing, that in Bengali,
Tagore means a chef, so, if somebody says
149
00:12:03,910 --> 00:12:04,320
that
150
00:12:04,320 --> 00:12:11,040
Rabindranath Tagore was a Tagore and Tagore
means a chef, so Rabindranath Tagore was a
151
00:12:11,040 --> 00:12:11,360
chef,
152
00:12:11,360 --> 00:12:17,070
you know, that is the kind of reasoning which
can give you very absurd results. o their
153
00:12:17,070 --> 00:12:17,190
You
154
00:12:17,190 --> 00:12:24,190
have to actually make a difference between
the domains of what a Tagore can be and what
155
00:12:25,000 --> 00:12:25,750
a chef
156
00:12:25,750 --> 00:12:31,470
can be; there is an intersection, but it is
not that one implies the other, right? So,
157
00:12:31,470 --> 00:12:32,390
we will
158
00:12:32,390 --> 00:12:39,390
see that for every logic, there can be certain
paradoxes, and then we will see that how we
159
00:12:39,890 --> 00:12:40,980
can
160
00:12:40,980 --> 00:12:42,180
get around those paradoxes, if at all.
161
00:12:42,180 --> 00:12:49,180
We will study several different types of logic
and these logics are characterized in terms
162
00:12:51,850 --> 00:12:52,990
of
163
00:12:52,990 --> 00:12:58,580
what exists and what is the belief of the
agent. So, in proportional logic, we will
164
00:12:58,580 --> 00:13:00,870
have facts
165
00:13:00,870 --> 00:13:07,870
and the agent either knows that the fact is
true, either it knows that that it is false.
166
00:13:08,510 --> 00:13:08,940
So,
167
00:13:08,940 --> 00:13:15,940
proportion can be true, false or unknown.
In first order logic, there can be facts,
168
00:13:17,220 --> 00:13:17,290
objects
169
00:13:17,290 --> 00:13:24,290
and relations; again, we have true, false
or unknown. In temporal logic, we have notion
170
00:13:25,170 --> 00:13:25,630
of
171
00:13:25,630 --> 00:13:31,990
time, so, in addition to what we have in first
order logic, we will have a special attribute
172
00:13:31,990 --> 00:13:37,260
called time; again, we will have true, false
or unknown.
173
00:13:37,260 --> 00:13:43,420
In probability theory, we will have facts,
but we will have an associated probability
174
00:13:43,420 --> 00:13:43,570
with
175
00:13:43,570 --> 00:13:49,530
those facts. So, we will have degree of belief-
what is the probability that this proportion
176
00:13:49,530 --> 00:13:56,310
is true? What is the probability that this
proportion is false? And then, we have fuzzy
177
00:13:56,310 --> 00:13:56,850
logic,
178
00:13:56,850 --> 00:14:03,850
where we have degree of truth, right? And
the degree of belief is again, between something
179
00:14:03,980 --> 00:14:10,980
between 0 and 1. Now, there is a there is
a difference between probabilistic reasoning,
180
00:14:11,450 --> 00:14:17,430
probabilistic logic and fuzzy logic. When
we are saying that- what is the probability
181
00:14:17,430 --> 00:14:19,780
that our
182
00:14:19,780 --> 00:14:26,780
new manager will be fat?- so, that is a probability,
right?
183
00:14:27,000 --> 00:14:32,540
We do not know whether that person is fat
or not, right, we just trying to associate
184
00:14:32,540 --> 00:14:32,720
some
185
00:14:32,720 --> 00:14:39,720
probability based on the age of that person
and other criteria. But in fuzzy logic, we
186
00:14:41,640 --> 00:14:42,220
will
187
00:14:42,220 --> 00:14:48,270
the it is not a question of whether that person
is fat or not, it is the question of how fat,
188
00:14:48,270 --> 00:14:55,120
right? So, it is the degree of the fatness
that we are talking about. There is a difference
189
00:14:55,120 --> 00:15:01,350
between the probability of a person being
fat, and the and the extent to which that
190
00:15:01,350 --> 00:15:01,810
person is
191
00:15:01,810 --> 00:15:06,970
fat. So, in fuzzy logic, we will dol deal
with that kind of thing. We will say that,
192
00:15:06,970 --> 00:15:07,180
okay,
193
00:15:07,180 --> 00:15:14,180
this person is tall. How tall? So, tall is
not just a Boolean, it has a gradation, right?
194
00:15:15,300 --> 00:15:21,890
Whereas, in proportional logic, and with logic
which where we will deal with Bayesian
195
00:15:21,890 --> 00:15:26,230
probabilities, we will talk about scenarios
where we do not know about the value of the
196
00:15:26,230 --> 00:15:30,040
proposition and associate a probability of
it being true or false.
197
00:15:30,040 --> 00:15:34,660
So, it is a probability of being true and
probability of being false, whereas in fuzzy
198
00:15:34,660 --> 00:15:35,030
logic,
199
00:15:35,030 --> 00:15:42,030
it is how true and how false. This is our
first look at proportional logic. I will first
200
00:15:47,700 --> 00:15:54,700
define the syntax, and then we will workout
several examples to get the hang of the thing.
201
00:15:55,980 --> 00:16:02,980
So, what we will have is a collection of sentences.
A sentence can be oF2 types: it can be an
202
00:16:04,910 --> 00:16:11,910
atom, where an atom is either true or false,
or a member of the set of atomic propositions.
203
00:16:15,310 --> 00:16:22,310
The set of atomic propositions are the basic
propositions that will be true or false in
204
00:16:24,180 --> 00:16:24,850
our
205
00:16:24,850 --> 00:16:31,850
logic. For example, if we are talking about
a person has passed or failed; passed is a
206
00:16:32,590 --> 00:16:39,590
Boolean, so passed, yes, or passed, no, right?
That is a member of the set of the atomic
207
00:16:39,710 --> 00:16:46,710
propositions. Then, we will have sentences
which can be atoms, like this, and we can
208
00:16:49,500 --> 00:16:49,910
also have
209
00:16:49,910 --> 00:16:56,910
complex sentences. Complex sentences can be
sentences connected together with connectives,
210
00:16:57,150 --> 00:17:04,150
where connectives can be and/or, both wise
implication one side implication.
211
00:17:06,250 --> 00:17:13,250
If I say a implies b, it means if a, then
b; whenever a is true, b has to be true, right?
212
00:17:15,610 --> 00:17:22,610
Whenever a is false, the sentence a implies
b is backwardly true. Both wise connective
213
00:17:26,520 --> 00:17:27,750
means,
214
00:17:27,750 --> 00:17:34,750
if and only if, and we have the negation also,
so you have complex sentence can be negation
215
00:17:35,669 --> 00:17:36,140
of
216
00:17:36,140 --> 00:17:43,140
another sentence. Before we go in to modus
ponens, just let us look at one thing here-
217
00:17:47,760 --> 00:17:47,980
that
218
00:17:47,980 --> 00:17:54,980
when we are talking about a implies b, can
you represent this in terms of the basic Boolean
219
00:17:58,749 --> 00:18:05,749
operators? This is equivalent to not a or
b.
220
00:18:11,879 --> 00:18:18,879
Now, please try to understand the equivalents
between these 2. This is true when either
221
00:18:23,399 --> 00:18:25,090
a is
222
00:18:25,090 --> 00:18:32,090
false or a is true and b is true. What does
this say- either a is false or b is true,
223
00:18:43,649 --> 00:18:44,490
right?
224
00:18:44,490 --> 00:18:51,490
In addition, if a is true, so, if a is false,
then this parts makes it true, right, but
225
00:18:56,450 --> 00:18:56,590
if a
226
00:18:56,590 --> 00:19:03,590
is true, then, we have to depend on this,
so it is b is true. So, if you just construct
227
00:19:04,919 --> 00:19:05,080
a
228
00:19:05,080 --> 00:19:11,610
truth table of these 2 sides, you will see
that these 2 are equivalent. How do we represent
229
00:19:11,610 --> 00:19:18,610
this? Nor a is x nor of b. In other words,
it is basically writing implication on both
230
00:19:31,830 --> 00:19:34,169
sides,
231
00:19:34,169 --> 00:19:41,169
that not a or b, and not b or a, right, that
is going to give you the x not of the 2; also,
232
00:19:44,960 --> 00:19:47,259
you can write the implication in another form.
233
00:19:47,259 --> 00:19:54,259
So, this is the same as writing not b implies
not a, right? Because this says, if a, then
234
00:20:02,610 --> 00:20:03,029
b,
235
00:20:03,029 --> 00:20:10,029
so if it is b, it must be the case that it
is not a if it is not b, then it must be case
236
00:20:10,620 --> 00:20:10,980
it is
237
00:20:10,980 --> 00:20:17,980
not a, because if it is not b and it is still
a, then it will refute this, right? So, these
238
00:20:18,059 --> 00:20:22,820
are all equivalent; this is just- you know,
these are the some of the things which will
239
00:20:22,820 --> 00:20:22,980
help
240
00:20:22,980 --> 00:20:29,980
us later on in deducing different kind of
thing. Now, let us look at the basic inference
241
00:20:30,070 --> 00:20:30,919
tools
242
00:20:30,919 --> 00:20:32,980
that we have in proportional logic.
243
00:20:32,980 --> 00:20:39,980
We will then use this to consider some examples
of deduction. The first one- okay, this is
244
00:20:41,639 --> 00:20:41,999
how
245
00:20:41,999 --> 00:20:47,749
we write an inference rule. As I was saying,
that in a logic, you have the sentences, you
246
00:20:47,749 --> 00:20:48,019
have
247
00:20:48,019 --> 00:20:52,740
the syntax, semantics, and you also have certain
inference rules, which tells you how to
248
00:20:52,740 --> 00:20:59,740
deduce new things from the existing one. So
on in the What we write above this line is
249
00:21:01,320 --> 00:21:01,529
the
250
00:21:01,529 --> 00:21:08,529
premises and what we write below the line
is what we can infer from that. So, if we
251
00:21:09,169 --> 00:21:10,409
have a if
252
00:21:10,409 --> 00:21:17,200
we have alpha implies beta and we also have
alpha, then, we can deduce beta from them,
253
00:21:17,200 --> 00:21:17,820
right?
254
00:21:17,820 --> 00:21:22,789
So, alpha implies beta is a rule, and alpha
is fact; that is given to us, then we can
255
00:21:22,789 --> 00:21:23,639
deduce
256
00:21:23,639 --> 00:21:24,499
beta.
257
00:21:24,499 --> 00:21:31,499
Unit resolution rule is, if you have alpha
or beta, and you have given not beta, then
258
00:21:34,789 --> 00:21:35,049
you can
259
00:21:35,049 --> 00:21:42,049
deduce alpha. Actually, this is written as
a- please read this as alpha- it is a mistake,
260
00:21:42,850 --> 00:21:49,789
you deduce alpha. Now, this and this are actually,
you can think of them as similar, because,
261
00:21:49,789 --> 00:21:55,269
when you have alpha or beta, you can write
this, actually, as not beta implies alpha,
262
00:21:55,269 --> 00:21:55,919
right?
263
00:21:55,919 --> 00:22:02,919
If you have not beta implies alpha and not
beta, then, you can use modus ponens and actually
264
00:22:03,090 --> 00:22:08,980
arrive at alpha, right, so ir is the same
thing, but these are different rules, which
265
00:22:08,980 --> 00:22:09,740
I have
266
00:22:09,740 --> 00:22:16,740
come out through reason. These rules are really
old; these rules have come from the time when
267
00:22:18,080 --> 00:22:23,759
initial logic and deduction was proposed at
the time of Aristotle, right? So, as you can
268
00:22:23,759 --> 00:22:24,230
see,
269
00:22:24,230 --> 00:22:30,149
modus ponens does seems like a Latin word,
right, or a Greek. this thing So, these are
270
00:22:30,149 --> 00:22:30,509
really
271
00:22:30,509 --> 00:22:31,580
old model, okay?
272
00:22:31,580 --> 00:22:38,580
When you have resolution, we have alpha or
beta and not beta or gamma, then, from that,
273
00:22:39,999 --> 00:22:40,279
you
274
00:22:40,279 --> 00:22:47,279
can deduce alpha or gamma. Yes? So, given
that either alpha or beta has to be true,
275
00:22:53,230 --> 00:22:53,840
and also
276
00:22:53,840 --> 00:23:00,840
given, that either gamma or not beta is always
true, we can deduce that alpha or gamma is
277
00:23:02,690 --> 00:23:09,690
true. How? See, either beta is true or not
beta is true, right? Either beta is true or
278
00:23:19,799 --> 00:23:20,009
not
279
00:23:20,009 --> 00:23:27,009
beta is true; if not beta is true, then beta
is false, so alpha is to be true. On the other
280
00:23:29,869 --> 00:23:36,869
hand, if beta is true, then not beta is false,
so gamma is to be true. In both of these cases,
281
00:23:41,190 --> 00:23:47,850
either alpha is to be true or gamma is to
be true, right?
282
00:23:47,850 --> 00:23:52,679
And these deduction is actually easy- what
you do is, you take this premise and this
283
00:23:52,679 --> 00:23:52,999
premise,
284
00:23:52,999 --> 00:23:59,999
take the and right and then you use Boolean
algebra and you will eliminate beta and not
285
00:24:03,049 --> 00:24:03,220
beta
286
00:24:03,220 --> 00:24:10,220
and you get alpha or gamma, right? If you
take alpha or beta and not beta or gamma,
287
00:24:13,240 --> 00:24:13,830
then if
288
00:24:13,830 --> 00:24:20,830
you minimize it, you will get alpha or gamma;
beta will get eliminated. You can write also
289
00:24:21,549 --> 00:24:21,659
in
290
00:24:21,659 --> 00:24:27,190
implication forms, where you write for alpha
or beta, you write not alpha implies beta,
291
00:24:27,190 --> 00:24:27,480
and
292
00:24:27,480 --> 00:24:33,669
for not beta or gamma, you write beta implies
gamma, so that is the same by using modus
293
00:24:33,669 --> 00:24:40,669
ponens. You can actually use transitivity
here to obtain not alpha implies gamma, right?
294
00:24:41,669 --> 00:24:41,700
And
295
00:24:41,700 --> 00:24:48,700
not alpha implies gamma is the same as alpha
or gamma, right? There are many other rules
296
00:24:53,389 --> 00:24:53,669
which
297
00:24:53,669 --> 00:25:00,669
we will discover, as we go further into deduction.
Let us take an example on deduction.
298
00:25:04,429 --> 00:25:11,429
So, here is one example that we will consider-
these are the basic premises that are given
299
00:25:13,629 --> 00:25:13,769
to
300
00:25:13,769 --> 00:25:20,769
us: we are given that if the unicorn is mythical,
then it is immortal; but if it is not
301
00:25:22,529 --> 00:25:29,529
mythical, then it is a mortal mammal, right?
If the unicorn is either immortal or a mammal,
302
00:25:35,590 --> 00:25:42,590
then it is horned. The unicorn is magical
if it is horned. So, these are all the premises
303
00:25:48,559 --> 00:25:48,730
that
304
00:25:48,730 --> 00:25:55,080
are given to us. And then, can we prove that
the unicorn is mythical can we prove that
305
00:25:55,080 --> 00:25:55,429
it is
306
00:25:55,429 --> 00:26:02,429
magical and can we prove that it is horned?
The question is that, these 3 sentences that
307
00:26:02,739 --> 00:26:02,980
has
308
00:26:02,980 --> 00:26:08,580
been given to us- from that, we want to deduce
whether the unicorn is mythical, magical,
309
00:26:08,580 --> 00:26:08,690
or
310
00:26:08,690 --> 00:26:15,690
horned, right? We will formulate this in proportional
logic and show how we can deduce whether
311
00:26:16,929 --> 00:26:23,869
it is mythical, magical or horned, right?
Okay. Now, the first thing that we are going
312
00:26:23,869 --> 00:26:24,159
to do
313
00:26:24,159 --> 00:26:28,179
is, that we are going to represent each of
these as propositions. What are the set of
314
00:26:28,179 --> 00:26:32,999
proportions that we have we will come back
to this slide? we will come back to this slide.
315
00:26:32,999 --> 00:26:37,559
us look at the basic proposition that we have.
316
00:26:37,559 --> 00:26:43,999
The propositions that we have are the following:
we will say umyth is unicorn is mythical
317
00:26:43,999 --> 00:26:50,999
umort unicorn is mortal umam unicorn is mammal,
then, likewise, umag and uhorn, right? These
318
00:26:55,409 --> 00:27:02,409
are the 5 different propositions, along which
we will yield our logic. Let us go back to
319
00:27:05,710 --> 00:27:05,869
each
320
00:27:05,869 --> 00:27:12,499
of those lines. Let us start with the first
point.
321
00:27:12,499 --> 00:27:19,499
If the unicorn is mythical, then it is immortal.
We will write that as follows: if the unicorn
322
00:27:23,369 --> 00:27:30,369
is mythical, so, umyth implies, then, it is
immortal, so, it is not mortal. So, umyth
323
00:27:33,179 --> 00:27:33,600
implies
324
00:27:33,600 --> 00:27:40,600
not umort, right? This says that if a unicorn
is a mythical, then it is immortal. The second
325
00:27:43,239 --> 00:27:50,239
one says that if the unicorn is not mythical,
then it is a mortal and it is mammal. Clear?
326
00:27:57,730 --> 00:28:04,230
These 2 together is the first one- slides
please- these 2 together, gives us the first
327
00:28:04,230 --> 00:28:04,909
thing,
328
00:28:04,909 --> 00:28:08,869
that if the unicorn is mythical, then it is
immortal; if it is not mythical, then it is
329
00:28:08,869 --> 00:28:08,999
a
330
00:28:08,999 --> 00:28:09,739
mortal mammal.
331
00:28:09,739 --> 00:28:15,029
Then, when we look at the second one, it says
that the if the unicorn is either immortal
332
00:28:15,029 --> 00:28:15,330
or a
333
00:28:15,330 --> 00:28:22,330
mammal, then it is horned. Let us come here
and see if it is a mammal, and it is immortal
334
00:28:26,759 --> 00:28:26,909
or
335
00:28:26,909 --> 00:28:33,909
it is immortal; if it is either immortal or
it is a mammal, then it is horned. And the
336
00:28:36,369 --> 00:28:43,369
statement says that if it is horned, then
it is magical, so, uhorn implies umag, right?
337
00:28:45,169 --> 00:28:45,340
This
338
00:28:45,340 --> 00:28:52,340
is the formulation of the set of sentences
that we had written down in proportional logic.
339
00:28:56,279 --> 00:28:56,340
The
340
00:28:56,340 --> 00:29:00,960
key thing here is first, choosing the set
of atomic proportions and secondly, writing
341
00:29:00,960 --> 00:29:01,179
them
342
00:29:01,179 --> 00:29:08,179
down in terms of proportional logic formulas.
Then, what we do here is, we deduce new things
343
00:29:11,460 --> 00:29:12,369
from here.
344
00:29:12,369 --> 00:29:19,369
Now, let us see what we can deduce from here.
Let us look at this one first. What we get
345
00:29:21,830 --> 00:29:21,989
here
346
00:29:21,989 --> 00:29:28,989
is- from one and 2, we find that if it is
mythical, then it is immortal; if it is not
347
00:29:33,859 --> 00:29:40,249
mythical, then it is mortal mammal. Now, one
of this is always going to be true, right?
348
00:29:40,249 --> 00:29:40,899
So, I
349
00:29:40,899 --> 00:29:46,779
can say that always either this or this will
be true, so either this is going to be true,
350
00:29:46,779 --> 00:29:46,960
or
351
00:29:46,960 --> 00:29:53,960
this is going to be true, right? Here, we
can write from these 2, that it is either
352
00:29:55,379 --> 00:29:56,850
immortal
353
00:29:56,850 --> 00:30:03,850
or it is a mortal mammal, right? This is where
we use resolution. Then, when you look at
354
00:30:12,119 --> 00:30:14,739
this
355
00:30:14,739 --> 00:30:21,739
5, and if you look at 3, then, what we have
here- this is this says that if it is a mammal
356
00:30:33,320 --> 00:30:33,639
and
357
00:30:33,639 --> 00:30:35,499
immortal, then it is horned.
358
00:30:35,499 --> 00:30:42,499
Now, look at this thing: this says that it
is either immortal or it is a mammal. So,
359
00:30:43,379 --> 00:30:43,470
this
360
00:30:43,470 --> 00:30:50,470
actually also implies that it is either umort
or umam. Because we have this and we have
361
00:31:03,499 --> 00:31:03,619
this,
362
00:31:03,619 --> 00:31:10,619
so, we can deduce uhorn, right? So, we have
uhorn; we have deduced uhorn. So, we have
363
00:31:15,409 --> 00:31:16,149
deduced
364
00:31:16,149 --> 00:31:23,149
that the unicorn is horned, and then if you
apply this one, then, now that we know that
365
00:31:24,480 --> 00:31:24,739
it is
366
00:31:24,739 --> 00:31:31,739
horned, always, we can always we can say that
it is magical. We have deduced that the unicorn
367
00:31:33,149 --> 00:31:38,739
is magical, so we have been able to deduce
that the unicorn is horned and we have been
368
00:31:38,739 --> 00:31:39,210
able to
369
00:31:39,210 --> 00:31:41,809
deduce that the unicorn is magical.
370
00:31:41,809 --> 00:31:48,809
But, we have not been able to deduce whether
the unicorn is mythical or not, and as it
371
00:31:49,299 --> 00:31:49,629
turns
372
00:31:49,629 --> 00:31:56,629
out, that in this case, you will not be able
to deduce whether the unicorn is mythical.
373
00:31:57,419 --> 00:31:59,129
Now,
374
00:31:59,129 --> 00:32:04,889
this analysis that we have done, has been
done in a somewhat adhoc manner, so we have
375
00:32:04,889 --> 00:32:05,149
to bring
376
00:32:05,149 --> 00:32:11,960
some formulism into the procedure. If you
look at this- that each of these sentences
377
00:32:11,960 --> 00:32:12,309
that we
378
00:32:12,309 --> 00:32:19,309
wrote is a Boolean formula; it is nothing
but a Boolean formula over a set of Boolean
379
00:32:19,460 --> 00:32:25,629
variables- each of this propositions is a
Boolean variable, right? So, what we are trying
380
00:32:25,629 --> 00:32:25,759
to
381
00:32:25,759 --> 00:32:32,759
find out is, if you are given a set of Boolean
formulas F1 and F2 and fk.
382
00:32:39,200 --> 00:32:45,070
These are- these Boolean formulas that I have
given to us, and oF2 Boolean formulas, is
383
00:32:45,070 --> 00:32:45,279
yet
384
00:32:45,279 --> 00:32:51,109
another Boolean formula. This is one big Boolean
formula, and we are trying to deduce whether
385
00:32:51,109 --> 00:32:58,109
the goal is implied by this. We are trying
to deduce, that if all this Boolean formulas
386
00:33:02,090 --> 00:33:02,119
are
387
00:33:02,119 --> 00:33:08,529
given to us, and we are told that these Boolean
formulas are all true, they are all valid
388
00:33:08,529 --> 00:33:14,679
formulas, then can we deduce the goal which
is another Boolean formula? From this, can
389
00:33:14,679 --> 00:33:14,779
we
390
00:33:14,779 --> 00:33:21,779
deduce the goal from this? Can we show that
this is true? We are trying to see whether
391
00:33:24,359 --> 00:33:25,499
this is
392
00:33:25,499 --> 00:33:32,499
valid, right. We will reduce this to the Boolean
satisfiability problem, and how are we going
393
00:33:37,090 --> 00:33:40,080
to reduce this to the Boolean satisfiability
problem?
394
00:33:40,080 --> 00:33:47,080
If this is valid- if this whole thing has
to be valid, then the negation of this has
395
00:33:48,899 --> 00:33:52,019
to be- it
396
00:33:52,019 --> 00:33:59,019
has to be unsatisfiable, right? The negation
of that has to be unsatisfiable. Now, what
397
00:34:01,139 --> 00:34:01,489
is
398
00:34:01,489 --> 00:34:07,029
valid? It means that no matter what values
you assign to these Boolean variables, you
399
00:34:07,029 --> 00:34:07,259
will
400
00:34:07,259 --> 00:34:12,919
always get true. A valid formula is one where
whatever values you assign to the Boolean
401
00:34:12,919 --> 00:34:19,919
variables, this formula will evaluate to true.
Satisfiable means, that there exist some
402
00:34:21,100 --> 00:34:26,629
assignment to the Boolean variables, which
makes this formula true. There is a difference
403
00:34:26,629 --> 00:34:30,540
difference between satisfiability and validity.
Here, we are interested in deduction, so we
404
00:34:30,540 --> 00:34:36,609
want to know whether, always, if these holds,
then g also holds.
405
00:34:36,609 --> 00:34:43,609
We are trying to deduce the validity of this
thing. If we take the negation of this, then
406
00:34:44,389 --> 00:34:44,520
we
407
00:34:44,520 --> 00:34:50,210
will look for satisfiability. If we take the
negation of this, remember that this is going
408
00:34:50,210 --> 00:34:50,359
to
409
00:34:50,359 --> 00:34:57,359
look like not of f1 and f2, and dot dot fk
or g- this and this are the same, right? If
410
00:35:06,099 --> 00:35:06,470
you
411
00:35:06,470 --> 00:35:12,869
take the negation of this, what are we going
to have? If this whole thing is what we want
412
00:35:12,869 --> 00:35:13,119
to
413
00:35:13,119 --> 00:35:20,119
prove, so, not of varphi is going to be f1
and f2, fk, and not of g, right? And if this
414
00:35:40,380 --> 00:35:40,480
is
415
00:35:40,480 --> 00:35:47,480
valid, if varphi is valid, then not of varphi
is unsatisfiable, right? Then this is
416
00:35:55,660 --> 00:36:02,660
unsatisfiable. Now, is that clear? This is
valid implies this is unsatisfiable. Clear?
417
00:36:12,349 --> 00:36:15,960
This
418
00:36:15,960 --> 00:36:21,549
gives us a nice way of systematically doing
the deduction.
419
00:36:21,549 --> 00:36:28,549
What we are going to do is, we are going to
have a knowledge base, a knowledge base which
420
00:36:33,140 --> 00:36:40,140
going to contain all these f1, f2, etc.to
fk. These are the things that I am going to
421
00:36:41,240 --> 00:36:41,599
be
422
00:36:41,599 --> 00:36:45,690
present in this knowledge base. These are
the things which are given to us; these are
423
00:36:45,690 --> 00:36:46,099
the
424
00:36:46,099 --> 00:36:53,099
facts and rules- everything expressed in terms
of Boolean formulas- given to us, right? Now,
425
00:36:53,440 --> 00:37:00,339
you have given me a goal, and you ask that
is this goal implied from this knowledge base?
426
00:37:00,339 --> 00:37:00,650
Can
427
00:37:00,650 --> 00:37:03,700
I deduce this goal from the knowledge base?
428
00:37:03,700 --> 00:37:10,270
What I am going to do is, I am going to push
not of g into this, and check whether this
429
00:37:10,270 --> 00:37:10,410
thing
430
00:37:10,410 --> 00:37:17,410
becomes unsatisfiable. I am going to push
not of g into this; I will push not g into
431
00:37:20,789 --> 00:37:21,760
this and
432
00:37:21,760 --> 00:37:28,430
try to see whether I can prove that, then
this thing will become inconsistent or
433
00:37:28,430 --> 00:37:35,430
unsatisfiable, right? And how can I do this?
See, we have all of this in conjunctions,
434
00:37:37,069 --> 00:37:39,559
so, if,
435
00:37:39,559 --> 00:37:46,559
from any of these, by any combination, you
are able to deduce false, then false ended
436
00:37:47,940 --> 00:37:48,240
with all
437
00:37:48,240 --> 00:37:55,240
of this is going to make everything false.
What we will try to do basically- essentially,
438
00:37:55,599 --> 00:38:01,809
we are trying to do is, we are pushing not
g in and trying to arrive at a contradiction.
439
00:38:01,809 --> 00:38:07,680
We are trying to take facts and rules and
try to deduce a contradiction which will lead
440
00:38:07,680 --> 00:38:07,960
us to
441
00:38:07,960 --> 00:38:14,960
false, and the moment that we get false, we
have shown that not g along with this going
442
00:38:18,569 --> 00:38:18,720
to
443
00:38:18,720 --> 00:38:25,720
become unsatisfiable, and therefore, by this
reasoning, that we have shown here, g can
444
00:38:26,660 --> 00:38:26,819
be
445
00:38:26,819 --> 00:38:33,440
deduced from the set of fact. If this becomes
unsatisfiable, then this is valid, so g can
446
00:38:33,440 --> 00:38:33,559
be
447
00:38:33,559 --> 00:38:40,559
deduced from this, clear? Right. Now, in case
of incase of proportional logic, it is both
448
00:38:54,760 --> 00:39:01,760
ways. If you find that if you are not able
to derive false from this, that means that
449
00:39:03,730 --> 00:39:10,730
thing is satisfiable; if this is satisfiable,
then the negation of this cannot be valid.
450
00:39:13,910 --> 00:39:20,910
Now, what we have seen so far is that we can
maintain a consistent knowledge base and whenever
451
00:39:22,210 --> 00:39:28,369
we want to deduce something, we can push the
negation of that goal in, and then just call
452
00:39:28,369 --> 00:39:28,490
a
453
00:39:28,490 --> 00:39:34,309
sat solver. There are many very good sat solvers
that are available, which takes a Boolean
454
00:39:34,309 --> 00:39:41,200
formula and deduces whether the formula is
satisfiable or not. So, you can now create
455
00:39:41,200 --> 00:39:41,609
you can
456
00:39:41,609 --> 00:39:48,609
have a sat solver and you can create a complete
reasoning system which will act as a front
457
00:39:48,869 --> 00:39:53,589
end. In that front end, you will be able to
key in all your rules and facts, then you
458
00:39:53,589 --> 00:39:54,250
push the
459
00:39:54,250 --> 00:39:59,089
goal in, you translate this whole thing into
a Boolean formula, feed it to the sat solver
460
00:39:59,089 --> 00:39:59,220
at
461
00:39:59,220 --> 00:40:05,490
the back end; if it says unsatisfiable, then
you say yes, your goal has been deduced. If
462
00:40:05,490 --> 00:40:05,539
it
463
00:40:05,539 --> 00:40:11,559
says satisfiable, then you say that the goal
has not been deduced, right? Okay.
464
00:40:11,559 --> 00:40:18,000
But all this is based on what we call monotonic
reasoning. You have to ensure that at no point
465
00:40:18,000 --> 00:40:25,000
of time the truth of your propositions change.
Later on, we will see cases of non monotonic
466
00:40:27,299 --> 00:40:34,299
reasoning, where the truth of this propositions
can change with new facts being introducing,
467
00:40:35,839 --> 00:40:39,710
right? So, that is going to make things more
complex; we are not going to look at that
468
00:40:39,710 --> 00:40:39,789
right
469
00:40:39,789 --> 00:40:46,789
now. So, now, to some results.
470
00:40:46,990 --> 00:40:53,990
So, in general, the inference problem is np
complete cooks theorem- we have all studied
471
00:40:55,630 --> 00:40:55,779
that
472
00:40:55,779 --> 00:41:02,779
in algorithms, isn't it? Yes or no? So, you
are familiar with what is np complete? If
473
00:41:10,099 --> 00:41:10,799
not,
474
00:41:10,799 --> 00:41:17,799
then, please brush it up. So, Boolean satisfiability
is an np complete problem. But in some
475
00:41:21,670 --> 00:41:28,670
cases, we can have polynomial time procedures
for doing the deduction. So, if we restrict
476
00:41:28,940 --> 00:41:35,940
ourselves to horn sentences, where horn sentences
are of the form like this, then we can use
477
00:41:41,869 --> 00:41:48,869
modus ponens repeatedly, to give us a polynomial
time procedure. Now, what is missing here?
478
00:41:52,619 --> 00:41:58,119
There are 2 things that we are not allowing
in horn sentences, one of them is- we are
479
00:41:58,119 --> 00:41:58,309
not
480
00:41:58,309 --> 00:42:05,309
allowing or's is here, and we are not allowing
or's here- no or's in the left hand side,
481
00:42:08,000 --> 00:42:08,549
no
482
00:42:08,549 --> 00:42:12,420
or's in the right hand side, right?
483
00:42:12,420 --> 00:42:18,430
It is the It is the ors that will create problems.
Now, this is a- just think of this as an
484
00:42:18,430 --> 00:42:25,339
exercise to find out, that why is it the case,
that when we have horn sentences, it makes
485
00:42:25,339 --> 00:42:25,660
life
486
00:42:25,660 --> 00:42:32,660
easier for us? Pleasure is when we have sentences
where you can have ors also on the left hand
487
00:42:34,579 --> 00:42:41,579
side. If I also allow p one or p 2 implies
q, then it suddenly becomes difficult. Why
488
00:42:52,410 --> 00:42:57,079
so? Yes,
489
00:42:57,079 --> 00:43:04,079
so you will not be able to directly use modus
ponens to give you a definite answer to whether
490
00:43:04,160 --> 00:43:10,779
something is true or false. For example, if
you have this thing implies q or r; if you
491
00:43:10,779 --> 00:43:11,099
have
492
00:43:11,099 --> 00:43:16,760
something like this thing implies q or r here,
then, when you have this thing in your
493
00:43:16,760 --> 00:43:22,220
knowledge base, you still do not know q is
there or r is there, right?
494
00:43:22,220 --> 00:43:27,799
Intuitively, that is what brings in the problem.
But, note that it is not the case, that this
495
00:43:27,799 --> 00:43:33,690
thing does not have or at all in in the Boolean
sense, because if you represent this in the
496
00:43:33,690 --> 00:43:39,170
implication, if you eliminate the implication,
then this is going to be not of all this or
497
00:43:39,170 --> 00:43:40,260
q,
498
00:43:40,260 --> 00:43:46,809
so r is there, but it is there in such a way
that that you can still use modus ponens
499
00:43:46,809 --> 00:43:53,809
repeatedly to derive that. Now, there are
2 ways of broadly of doing this: one is that
500
00:43:53,839 --> 00:43:53,970
we
501
00:43:53,970 --> 00:43:59,529
start from the set of facts and rules that
we have; we start from the set of facts that
502
00:43:59,529 --> 00:43:59,700
and
503
00:43:59,700 --> 00:44:03,900
rules that we have, and suppose that all these
rules are given to us in the form of modus
504
00:44:03,900 --> 00:44:10,900
ponens. So, we can see whether the left hand
side is satisfied by the knowledge base and
505
00:44:11,220 --> 00:44:11,369
if
506
00:44:11,369 --> 00:44:15,710
so, then the right hand side is deduced in
the modus ponens.
507
00:44:15,710 --> 00:44:19,690
If an in an implication, the left hand side
is satisfied by the knowledge base, then the
508
00:44:19,690 --> 00:44:19,960
right
509
00:44:19,960 --> 00:44:25,650
hand side can be deduced. So, you add the
right hand side to the knowledge base, and
510
00:44:25,650 --> 00:44:26,220
then now
511
00:44:26,220 --> 00:44:33,220
check whether any of the other rules can be
applied, right? If a new rule now becomes
512
00:44:34,010 --> 00:44:38,339
applicable, then again, deduce the right hand
side of that, put it into the fact base and
513
00:44:38,339 --> 00:44:38,559
keep
514
00:44:38,559 --> 00:44:45,559
on doing this, until at some point of time,
you have reached the goal, right? This is
515
00:44:46,890 --> 00:44:47,220
called
516
00:44:47,220 --> 00:44:53,549
forward chaining; this is called forward chaining,
where I am starting from the existing set
517
00:44:53,549 --> 00:45:00,549
of rules and I am trying to move forward.
So, what I am I am look trying to explicitly
518
00:45:02,559 --> 00:45:02,910
deduce
519
00:45:02,910 --> 00:45:09,910
the goal. So, I have all my implicational
rules, right so which says A1 implies A2 and
520
00:45:10,839 --> 00:45:11,589
A3
521
00:45:11,589 --> 00:45:18,589
implies A4, and so on, and A1, A5, A4, implies
A7, and so on. And then, I am just using these
522
00:45:23,470 --> 00:45:27,839
to deduce newer and newer facts and putting
it in the knowledge base.
523
00:45:27,839 --> 00:45:34,839
And I am not looking that I want to deduce,
let us say, A9 and A11; I am not starting
524
00:45:36,230 --> 00:45:36,609
from
525
00:45:36,609 --> 00:45:41,319
this and working backwards; I am starting
from these and working forward, so it is forward
526
00:45:41,319 --> 00:45:48,319
chaining. The other option is to do backward
chaining, where we start from A9 and A11,
527
00:45:50,170 --> 00:45:50,380
and
528
00:45:50,380 --> 00:45:57,319
then examine the rules and see which of the
rules has A9 and A11 on the right side, which
529
00:45:57,319 --> 00:45:58,200
are
530
00:45:58,200 --> 00:46:02,020
the rules that can give us A9 and A11 on the
right side.
531
00:46:02,020 --> 00:46:09,020
So, let us say that we find, that there is
a rule which says A5, A3, gives me A9 and
532
00:46:12,500 --> 00:46:16,059
A7, and
533
00:46:16,059 --> 00:46:23,059
A9 gives me A11, right? Now, here, we try
to see whether any of these are being implied
534
00:46:27,230 --> 00:46:27,510
by
535
00:46:27,510 --> 00:46:34,510
this. So, we find that yes, A9 is coming from
here, right? So now, by backward chaining,
536
00:46:36,250 --> 00:46:36,690
I can
537
00:46:36,690 --> 00:46:43,690
replace this goal; I can replace this goal
by A7 and A5 and A3A5 and A3. My new goal
538
00:46:53,549 --> 00:46:54,150
becomes
539
00:46:54,150 --> 00:47:01,150
A5, A3, A11; then, I look at A11- okay, I
can get A11 if I have A7, a 9, right? So,
540
00:47:10,329 --> 00:47:11,779
I replace
541
00:47:11,779 --> 00:47:18,779
A11 by A7, a 9, then, again, I can apply this
rule to eliminate A9and I have A5, A3, right?
542
00:47:22,839 --> 00:47:29,839
So, I can eliminate this. Now see, this is
an extra step that I have to do. If I had
543
00:47:30,770 --> 00:47:31,490
actually
544
00:47:31,490 --> 00:47:37,349
In the initials configuration, when I when
I had a 9, A11; if I had applied this one
545
00:47:37,349 --> 00:47:39,119
first,
546
00:47:39,119 --> 00:47:46,119
then this would have got reduced to A7 and
A9 is already there, and then, by another
547
00:47:46,510 --> 00:47:53,390
application of this rule, I would have got
A7, A5, A3, right?
548
00:47:53,390 --> 00:47:58,559
And then, we can go on backwards like this,
until we arrive at the set of facts that are
549
00:47:58,559 --> 00:47:58,660
there
550
00:47:58,660 --> 00:48:03,470
in the knowledge base. And when we have the
set of facts in the knowledge base, then we
551
00:48:03,470 --> 00:48:03,559
say
552
00:48:03,559 --> 00:48:10,559
that that is solved, right? Now, do you see
some similarity, of what is happening here,
553
00:48:13,779 --> 00:48:15,049
with
554
00:48:15,049 --> 00:48:22,049
problem deduction search? This is what we
have to get, so this is actually an and of
555
00:48:25,010 --> 00:48:26,490
A7, A5,
556
00:48:26,490 --> 00:48:33,490
A3, so I have to get A7, I have to get A5,
I have to get A3. In order to get A7, some
557
00:48:33,609 --> 00:48:33,670
rule
558
00:48:33,670 --> 00:48:37,549
might tell me that you might have 2 rules
for A7.
559
00:48:37,549 --> 00:48:44,549
So, suppose I have to get A7, A5, A3- so,
this is an end of A7, A5, A3, that I have
560
00:48:49,880 --> 00:48:52,920
to get.
561
00:48:52,920 --> 00:48:59,920
And then, there are 2 rules: one which says
that A2 and A3 gives me A7, and another rule,
562
00:49:01,930 --> 00:49:08,930
which says that A4 and a fifteen gives me
A7. Now, here, I have an or node: one for
563
00:49:13,190 --> 00:49:14,240
this, one
564
00:49:14,240 --> 00:49:21,079
for this; if I am here, then I have to- if
I choose this rule, then I will have to solve
565
00:49:21,079 --> 00:49:21,849
A2,
566
00:49:21,849 --> 00:49:28,049
A3. If I choose this rule, then I will have
to solve A4, A15. What do I mean by solve?
567
00:49:28,049 --> 00:49:28,359
I have
568
00:49:28,359 --> 00:49:33,510
to see whether these can be deduced from the
knowledge base. So, again, this is an and
569
00:49:33,510 --> 00:49:35,109
of A2,
570
00:49:35,109 --> 00:49:42,109
A3, and this is an and of A4 and A15, and
this is actually a graph because you see this
571
00:49:43,859 --> 00:49:43,970
A3 and
572
00:49:43,970 --> 00:49:50,609
this A3 are the same node, right? And then,
again, we see what rules can give us A3.
573
00:49:50,609 --> 00:49:57,609
We go backwards, until we hit upon the set
of basic facts that are given to us. Suppose
574
00:49:58,039 --> 00:49:58,660
it is
575
00:49:58,660 --> 00:50:05,660
given to us, that A4 is a fact, A4 is always
true; that means that this is a node which
576
00:50:08,910 --> 00:50:10,990
is
577
00:50:10,990 --> 00:50:17,990
solved, right? So there are So, we now have-
as discussed, we have 2 strategies: one is
578
00:50:19,470 --> 00:50:24,579
forward chaining, where we start from the
beginning and start generating new facts and
579
00:50:24,579 --> 00:50:25,240
rules;
580
00:50:25,240 --> 00:50:30,549
new facts, rather, and putting it in knowledge
base and keep on applying the set of rules,
581
00:50:30,549 --> 00:50:37,420
and, we are backward chaining, which does
the thing from the goal, backwards, right?
582
00:50:37,420 --> 00:50:38,289
Now, try
583
00:50:38,289 --> 00:50:43,760
to think of the scenarios where forward chaining
will be useful and where backward chaining
584
00:50:43,760 --> 00:50:48,140
will be useful.
There are deduction systems which apply forward
585
00:50:48,140 --> 00:50:50,049
chaining; there are also the deductions
586
00:50:50,049 --> 00:50:57,049
systems which apply backward chaining. Think
in terms of the branching that is there and
587
00:50:57,410 --> 00:50:57,650
also
588
00:50:57,650 --> 00:51:04,650
the depth of the deduction that you may have
to do. Yes. So, the gain the actual search
589
00:51:10,480 --> 00:51:11,059
so you
590
00:51:11,059 --> 00:51:16,349
see, this deduction is actually- it involves
search, it involves searching in this rule
591
00:51:16,349 --> 00:51:16,869
space
592
00:51:16,869 --> 00:51:21,990
to determine which rules to apply in what
sequence, to be able to derive the thing,
593
00:51:21,990 --> 00:51:23,190
right? So,
594
00:51:23,190 --> 00:51:30,190
we are going to um we are not going to explicitly
go into the exact search procedures for the
595
00:51:30,700 --> 00:51:36,150
deduction, because you already now have some
background on search. So, you can figure out,
596
00:51:36,150 --> 00:51:40,349
that what kind of search will be able will
be able to do deduction.
597
00:51:40,349 --> 00:51:45,970
But interestingly, there are actually platforms
for programming, where this kind of backward
598
00:51:45,970 --> 00:51:52,380
chaining is built in. So, you have studied
programming languages c pl, c plus plus, etc.,
599
00:51:52,380 --> 00:51:57,510
which are procedural programming languages.
In this course, we will study a language called
600
00:51:57,510 --> 00:52:04,510
prolog, which is a logic programming language.
In this logic programming language, you are
601
00:52:05,160 --> 00:52:12,130
just specifying your facts and rules, in the
form that we mentioned in implicational form,
602
00:52:12,130 --> 00:52:19,130
right? And this mechanism of backward chaining
is build into the interpreter of the language.
603
00:52:20,369 --> 00:52:26,450
So, you will see that computation will be
viewed in an entirely different perspective,
604
00:52:26,450 --> 00:52:28,269
you talk about logic programming .
605
00:52:28,269 --> 00:52:35,269
And, from a programming point of view, it
is very interesting to see how to take program
606
00:52:35,369 --> 00:52:35,500
which
607
00:52:35,500 --> 00:52:41,240
you normally implement in procedural language,
and see how you can solve that in logic
608
00:52:41,240 --> 00:52:46,390
programming. It is not the case, that logic
programming is going to give you any additional
609
00:52:46,390 --> 00:52:53,390
computational advantage; it is only the representational
advantage. You can write the program
610
00:52:53,569 --> 00:53:00,569
for 8 queens in 5 lines; we can write the
program for TSP in 5- 6 lines. You know that
611
00:53:01,400 --> 00:53:01,510
is
612
00:53:01,510 --> 00:53:07,019
where the advantage lies- you can write it
in a very crisp form and this mechanism of
613
00:53:07,019 --> 00:53:13,210
computation in backward chaining is built
into the interpreter. When you study prolog,
614
00:53:13,210 --> 00:53:15,260
will go into that.
615
00:53:15,260 --> 00:53:22,260
So, we conclude this lecture here- we will
start off in the next lecture on first order
616
00:53:22,869 --> 00:53:24,829
logic;
617
00:53:24,829 --> 00:53:31,829
that is where we will talk about quantification
and see what are the advantages there.
618
00:53:36,980 --> 00:53:43,980
In the last class, we had seen, we have studied
propositional logic and we had seen some basic
619
00:53:46,010 --> 00:53:53,010
ways of doing reasoning with propositional
logic. Today, we will extend the logic further
620
00:53:53,670 --> 00:53:53,779
and
621
00:53:53,779 --> 00:53:58,650
move onwards to what is called first order
logic.
622
00:53:58,650 --> 00:54:05,650
So, in first order logic, the main so what
we have done so far is.
623
00:54:07,279 --> 00:54:14,279
We have seen how to represent a problem in
logic. We have seen propositional logic; we
624
00:54:14,519 --> 00:54:14,970
will
625
00:54:14,970 --> 00:54:20,690
now see first order logic, and then, we will
finally study how we can do inference in first
626
00:54:20,690 --> 00:54:24,960
order logic.
627
00:54:24,960 --> 00:54:31,960
The difference between first order logic and
propositional logic is in the existence of
628
00:54:32,880 --> 00:54:39,880
predicates. If you recollect, that in propositional
logic, we had propositions which could
629
00:54:40,390 --> 00:54:47,390
take values of either 0 or 1. So, anything
that we want to represent, is in terms of
630
00:54:47,519 --> 00:54:54,000
propositions which have a Boolean value- true
or false- right? Now, unlike that, in first
631
00:54:54,000 --> 00:54:59,109
order logic, what we are going to have is-
we will have things called predicates and
632
00:54:59,109 --> 00:55:02,140
predicates can have 1 or more arguments.
633
00:55:02,140 --> 00:55:09,140
So you can have a predicate which has arguments
x, y and z, right? There is no truth value
634
00:55:15,420 --> 00:55:22,420
that we associate with this predicate as such,
but we can always say, that for all x, for
635
00:55:26,109 --> 00:55:33,109
y, for all z, I have p(x,y,z). Then, this
whole thing has a truth value. So, this whole
636
00:55:41,089 --> 00:55:41,640
thing
637
00:55:41,640 --> 00:55:48,640
can be true or false. If it is the case, that
for all values that x can take, for all values
638
00:55:48,930 --> 00:55:49,079
y
639
00:55:49,079 --> 00:55:56,079
can take, for all values z can take, this
is true; then, this whole thing is true. In
640
00:55:58,660 --> 00:55:59,609
other
641
00:55:59,609 --> 00:56:06,609
words, when- these are like variables; x,
y, z, are variables. If you assign some value
642
00:56:08,400 --> 00:56:08,809
to
643
00:56:08,809 --> 00:56:15,809
them, now, these values need not to be numerical;
it is some instantiation that we do to this
644
00:56:16,740 --> 00:56:22,730
variables; we assign them some value from
the domain of these variables, and if we know
645
00:56:22,730 --> 00:56:24,480
or if
646
00:56:24,480 --> 00:56:29,509
the knowledge base already contains the fact,
that for those variables, this predicate is
647
00:56:29,509 --> 00:56:36,509
true, then, we say that for that value for
that value of x, for that value of y and for
648
00:56:37,849 --> 00:56:38,029
that
649
00:56:38,029 --> 00:56:42,160
value of z, p(x,y,z) is true, right?
650
00:56:42,160 --> 00:56:49,160
Similarly, you can have- there exists x, for
all y; there exists z, p(x,y,z). That means
651
00:57:02,279 --> 00:57:02,470
that
652
00:57:02,470 --> 00:57:09,470
there exists some value of x, such that no
matter how you pick your y, there will always
653
00:57:09,720 --> 00:57:10,259
be
654
00:57:10,259 --> 00:57:17,259
some z, which is able to satisfy p(x,y,z).
p(x,y,z) has a truth value, when x y and z
655
00:57:22,549 --> 00:57:22,750
are
656
00:57:22,750 --> 00:57:29,750
instantiated to some values, right? So, p
of Tom, Dick, and Harry can have a truth value.
657
00:57:34,390 --> 00:57:34,450
But
658
00:57:34,450 --> 00:57:41,450
if you just leave them as person x, y, z,
without instantiating them to any value, then,
659
00:57:41,930 --> 00:57:42,210
we
660
00:57:42,210 --> 00:57:49,099
cannot say whether that is true or not. But
we can have these quantifiers and we have
661
00:57:49,099 --> 00:57:49,660
2 types
662
00:57:49,660 --> 00:57:55,599
of quantifiers, namely, there exists and for
all, I think you are familiar with these things
663
00:57:55,599 --> 00:57:58,230
from discrete structure.
664
00:57:58,230 --> 00:58:03,410
This means that there exists some value of
x for all, such that for all values of y,
665
00:58:03,410 --> 00:58:03,789
there
666
00:58:03,789 --> 00:58:09,849
exists some value of z, which satisfies p(x,y,z).
And it is not difficult to see, that the
667
00:58:09,849 --> 00:58:16,640
positions of these for all and there exists
y, they are not commutative. So it is this
668
00:58:16,640 --> 00:58:17,539
is not
669
00:58:17,539 --> 00:58:24,539
the same as writing for all y, there exists
x, there exists z, p(x,y,z). Though it may
670
00:58:36,710 --> 00:58:37,109
be
671
00:58:37,109 --> 00:58:44,109
cases, where 1 implies the other, but these
2 are certainly not equivalent, right? So,
672
00:58:45,329 --> 00:58:45,619
we
673
00:58:45,619 --> 00:58:52,619
cannot actually move the quantifiers across
each other; they will have different meanings.
674
00:58:54,640 --> 00:58:54,950
And
675
00:58:54,950 --> 00:59:01,950
we will shortly describe a set of things that
we can do and we cannot do, on this kind of
676
00:59:02,269 --> 00:59:03,689
logic.