Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views18 pages

Lec 11

This lecture covers the fundamentals of propositional logic, defining propositions and their truth values, and introducing logical connectives such as negation, conjunction, disjunction, implication, and biconditional. It explains how to construct complex statements using these connectives, the importance of truth tables, and the rules of inference for deriving conclusions. Additionally, it discusses translating English statements into logical expressions and the equivalence relations in propositional logic.

Uploaded by

Jef Le
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views18 pages

Lec 11

This lecture covers the fundamentals of propositional logic, defining propositions and their truth values, and introducing logical connectives such as negation, conjunction, disjunction, implication, and biconditional. It explains how to construct complex statements using these connectives, the importance of truth tables, and the rules of inference for deriving conclusions. Additionally, it discusses translating English statements into logical expressions and the equivalence relations in propositional logic.

Uploaded by

Jef Le
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Fundamentals Of Artificial Intelligence

Shyamanta M.Hazarika
Department of Mechanical Engineering
Indian Institute of Technology – Guwahati

Lecture – 11
Propositional Logic

Welcome to fundamentals of artificial intelligence. Today we shall look at propositional


logic. In propositional logic, simplest statements are treated as individual units and that
makes it fundamentally different from Aristotelian logic. Propositional logic is also called
sentential logic or statement logic. Since logical relationships are involved between
statements or propositions treated as wholes. Let us start our discussion of propositional logic
by looking at the definition of proposition.
(Refer Slide Time: 01:27)

A proposition is a statement that is by itself either true or false. Statements like all humans
are mortal; Rama is married; I will pay for the meal; are propositions for they can evaluate to
either true or false. On the contrary statements like; come here, why are you crying? Are not
propositions for you cannot evaluate them to be either true or false. Come here is a command,
why are you crying is a question.
(Refer Slide Time: 02:09)

Propositional logic is a mathematical system for reasoning about propositions and looking at
how they relate to one another. Every statement in propositional logic consists of
propositional variables which are then combined via propositional connectives. Every
variable represents some proposition. Let us say I want to talk about the day I would say it is
hot I can use a variable to represent this statement then I would have to use another variable
to say something like it is human.

If I want to now construct a more complex statement like, if it is humid, it is hot then I need
to use connectives so connectives and code how propositions are related we started with two
simple propositions one saying it is hot the other saying it is humid and then using
propositional connectives I could create a more complex statement like if it is humid than it is
hot.
(Refer Slide Time: 03:42)

Propositional variable represents an arbitrary proposition. We represent propositional


variables with uppercase letter. Continuing our discussion about the weather today we could
use a variable symbol like P to represent it is hot and another variable symbol Q to say it is
humid. Each variable can take one of two values that is the variable can be either true or
false. If a proposition is true then we say that its truth value is true and if a proposition is false
we say its truth value is false.
(Refer Slide Time: 04:28)

Let us now look at the propositional connectives we will first focus on the three logical
connectives. The first one of them is the logical not read as not P; not P is true if and only if P
is false. Not P is also called logical negation the next propositional connective is the logical
end read as P and Q. P and Q is true if both P and Q are true logical and is also referred to as
logical conjunction. The third of the propositional connectives is the logical or read as P or Q.

P or Q is true if at least one of P or Q is true logical or is also referred to as logical


disjunction. The all that we are talking of here is an inclusive or that is it is true if at least one
of the operands is true.
(Refer Slide Time: 05:46)

We will now look at the propositional connective of implication and thereafter the
propositional connective of biconditional. But we will again focus on these connectives in
detail in the course of our discussion. So, let us look at implication if P then Q this is false
when P is true and Q is false M is true otherwise. Implication is also called material
conditional operator.

We have the by conditional P if and only if Q the by conditional is true if P and Q have the
same through with values and false otherwise. The by conditional connective is also called
material by conditional operator apart from these propositional connectives. We have two
more connectives which do not connect any proposition they are as if connecting zero
propositions.

They are the connectives of true and false the symbol top is a value that is always true
whereas the symbol bottom is a value that is always false.
(Refer Slide Time: 07:08)

Having introduced connectives variables, let us now look at what it means to have a sentence
or a well found formula in propositional logic. A sentence also called a well-formed formula
is defined as follows. A symbol is a sentence if s is a sentence then not s is a sentence we
have not discussed parentheses as of yet but parentheses are used to disambiguate the
precedence of the operators in a propositional logic statement.

If I have a sentence S and close within the parentheses that also is a sentence. Next we have
sentences S and T then the disjunction of S and T the conjunction of S and T if S then T and
S if and only if T are all sentences. A sentence in propositional logic can only result from a
finite number of applications of the above rules.
(Refer Slide Time: 08:30)
A truth table is a table in propositional logic showing the truth value of a propositional logic
formula as a function of its inputs. The truth table establishes relationship between the truth
values of propositions and compound proposition formed from those propositions. Let us take
a sample truth table to see what we mean here is the truth table for the disjunction operator I
have the input values P and Q and here the P or Q.

P or Q is true when one of the operands either P or Q is true. So, we have P being true Q is
true therefore P or Q is true for the next statement here P is true Q is false but then P or Q is
true. Here Q is true therefore P or Q is true. In the last row we see that P and Q both are false
and therefore the disjunction is false.
(Refer Slide Time: 10:14)

From this example we can realize that truth tables formally define what a connective means
and truth tables can be used for deciphering complex propositional formula.
(Refer Slide Time: 10:22)

Now let us focus back on the implication for proposition P and Q if P then Q the implication
or conditional statement is false when P is true and Q is false and is true otherwise. So, if we
look at this statement if P then Q, P is called the premise or hypothesis and Q is called the
conclusion. The truth table of the implication if P then Q here shows that the only way to get
this false is when P is true and Q is false we want if P then Q to mean whenever P is true Q is
true as well. And the only way this does not happen is if P is true and Q is false.
(Refer Slide Time: 11:32)

In English a sentence of the form if A than B can have different meanings typically there is a
causal relationship between A and B which is not required in logic. We are often implying
more than simply that if A holds then B holds as well in English. Let us take an example and
try to understand this. If I make a statement like if I own a bonus then I will buy a car. The
common sense interpretation of this sentence is that the inverse statement is also true.

That is, if I do not earn a bonus then I will not buy a car. Now let us use some prepositions,
now let us take a variable P to represent I had a bonus the variable Q to I will buy a car. Then
the statement if I owned a bonus then I will buy a car could be if P then Q. One needs to
realize that the common sense interpretation of the above sentence that if I do not earn a
bonus I will not buy a car is not included by if P then Q.
(Refer Slide Time: 13:08)

Let us look at now the bi-conditional of statements P and Q which is denoted as P if and only
if Q. It is true if P and Q have the same truth values and false otherwise. The bi-conditional
operator is used to represent a two directional implication. Specifically P if and only if Q
means that P implies Q and Q implies P. Conversely if both P implies Q and Q implies P are
true then P if and only if Q is true.
(Refer Slide Time: 13:57)

Let us look at the operator precedence, for propositional logic. We have five operators the
negation, the conjunction, disjunction, the implication and the bi-conditional not binds to
whatever immediately follows it. The conjunction and disjunction binds more tightly than the
implication. And all operators are right associative. Now as mentioned earlier we can use
parentheses to disambiguate the operator precedence in an propositional logic formula.

So, here is a formula where we have some connectives between x y and z. Now until we put
parentheses it is not very clear what this is. So, parentheses can disambiguate the precedence
we could have this statement actually saying negation of x implies x or z and y.
(Refer Slide Time: 15:26)
Now let us try to translate English into logic statements and look at the intricacies of the
logical connectives as well as implications and by conditionals. In order to translate English
into logic the user defines a set of propositional symbols like P and Q. And thereafter the user
needs to define the semantics for each propositional symbol coming back to our discussion of
the weather today. Let us say we use a propositional symbol P to mean it is hot, Q to say it is
humid and R to say it is raining.

Now to make a statement like if it is humid then it is hot I would simply use the implication
Q representing it is humid and P representing it is hot. So, I would write this statement as if Q
then P. Let us take a little bit more involved statement. Here is a statement which says if it is
hot and humid than it is raining. So, here before I think of putting the implication I need to
realize that I have a conjunction of two propositions one being hot the other being humid.

So, this one I would write like P that is it is hot Q representing it is humid. So, I write the
promise' as hot and humid and the conclusion as raining R. So, I would write that if P and Q
then R this would mean if it is hot and humid than it is raining.
(Refer Slide Time: 17:44)

let us now take a little bit more complex example let's use W to represent I will work hard V
to mean there are vacancies and J, I will get the job. Let us try to represent this statement I
would not get the job if I do not work hard. Now J is representing I will get the job. So, not J
would represent I would not get the job. W represents I will work hard so not W will
represent I do not want hard.
But then how do you write this statement I would not get the job if I do not work hard. So,
this statement could be written as not W then not J. This is literally saying if I do not work
hard I would not get the job. So, if I have a condition where P if Q is there then it translates to
if P then Q this is very important to realize. If you read this sentence I would not get the job if
I do not work hard.

Actually what I meant is if I do not work hard then I would not get the job which then clearly
shows where I used if I do not work hard then I would not get the job.
(Refer Slide Time: 19:23)

Let us take another example if I work hard but there are no vacancies I would not get the job.
Now in this statement I have I work hard so that is W. There are no vacancies so that is
negation of V, I will get the job is J so I would not get the job is my mistake. However one
thing to realize at this point is that because the second part of the sentence that is that there
are no vacancies is a surprise.

But is used in English instead of end but when I am converting it into a propositional logic
formula I would use an N. So, this statement would convert to I work hard W and there are
no vacancies not V, I won’t get the job not J this is something we need to focus on. And look
at that if I have a statement which says P but Q then I need to translate it to P and Q.
(Refer Slide Time: 20:48)

Let us now look at two important equivalence relations which are referred to as De Morgan's
laws and for that we will use the truth table to establish those equivalences. The first of the de
Morgan laws states that the negation of the conjunction of P and Q is equivalent to not P or
not Q. So, I have here not P and Q and for every legal value, possible for P Q, I have here not
P or not Q. As the truth values of these two propositional logic formulas are the same so these
two formulas are equivalent and I could write that the negation of P and Q is equivalent to not
P or not Q.
(Refer Slide Time: 21:56)

Similarly we have the second de Morgan's law we says the negation of the disjunction that is
not of P or Q is equivalent to not of P and not of Q. And I will leave it as an exercise for the
readers to figure this out that these two propositional logic formulas are equivalent.
(Refer Slide Time: 22:25)

Now these two formulas the not of P and Q is not P or not Q have same truth-values as we
saw. We say that they are equivalent to one another. Let us now focus a little on what we
mean by the equivalence relation. The symbol of equivalence that I have used here is not a
connective it is related to the bi-conditional but one needs to be clear that it is not the same.
The statement that not of P and Q is equivalent to not P or not Q means that the two formulas
are equivalent.

Whereas if I put the bi-conditional there then the statement is a propositional formula and if
you plug in different values of P and Q it will evaluate to a truth value. Interestingly the
formula evaluates to true every time.
(Refer Slide Time: 23:41)
One more useful equivalence is the following, P implies Q or if P then Q is equivalent to not
P or Q. Let us try to establish that by starting from the implication. So, we start with the
implication and by definition if we look at the truth table of implication we see that
implication is equivalent to not of P and not Q. We thereafter can use the de Morgan's law to
expand this out to its equivalent form which is not of P and some W is same as not of P or not
of that W and that leads us to this being not of P or Q.

Does P implies Q is equivalent to not P or Q this is a very, very useful equivalence that we
will be using when we will be working through the proofs both in propositional logic as well
as in first order logic.
(Refer Slide Time: 25:11)

Let us now focus on what we mean by rules of inference. A rule of inference is sound if it is
conclusion is true whenever the premise is true. So, here are some examples of sound rules of
inference and each can be shown to be sound using a truth table. The first one modus ponens
is like I have A implies B and I know A therefore I could conclude be a implies B, A
therefore I could draw the conclusion B.

The next is about AND introduction which is in the premise if I know both A is true B is true
then I can conclude A and B. The third of the rules of inference is the, and elimination. So, if
we have the conjunction A and B then we know that this statement is true if both of them are
true therefore we could write A or equivalently we could write B. So, A elimination is A and
B leading to the conclusion A.
We have double negation which we have used little while ago in the previous slide. The
negation of the negation of A is A itself. We have unitary solution which is A or B and not B
is A. And finally we have a very important rule of inference the resolution which is A or B
not B or C leading to A or C. So, these rules of inference that I have I will come back to this
when we will discuss proofs in first order logic in more detail.
(Refer Slide Time: 27:35)

So a proof is a sequence of sentences where each sentence is either a premise or a sentence


derived from earlier sentences in the proof by one of the rules of inference. The last statement
that I arrived at in a proof is referred to as the theorem or also called the goal or the query that
we wanted to prove. So, here is a small example from the weather that we are talking of, so Q
represents that it is humid if Q then P is the statement that if it is humid it is hot.

From 1 and 2, I could use modus ponens to arrive at that it is hot Q implies P, Q therefore P
so I can say it is hot. Next if I am told that if it is hot and humid it is raining, so that is the
premise that I know now given this scenario I can use three here and one here to do an and
interaction and get to P and Q. So, I know it is hot and humid given four and five I can now
continue that it is raining.

So, here in this example I have the propositional formulas in red as my premise and in black
the sentence that has been derived either from earlier sentences or from the premise itself.
And finally I could have a theorem that it is raining.
(Refer Slide Time: 29:38)

So, we have looked at propositional logic and we have seen that it has logical constants,
propositional symbols; we have parentheses sentences are combined by propositional
connectives of conjunction, disjunction, implication, bi-conditional and negation.
Propositional logic commits only to the existence of facts that may not be the case in the wall
being represented. It has a simple syntax and very simple semantics.

Propositional logic is sufficient to illustrate the process of inference as I have done in that
Weiser example. However propositional logic quickly becomes impractical even for very
small walls let us see what we mean by that.
(Refer Slide Time: 30:37)
So, consider the problem of representing the following information. Every person is mortal,
Socrates is a person, Socrates is mortal. How can these sentences be represented so that we
can infer the third sentence that Socrates is mortal from the first two. In order to do that in
propositional logic I would need to create propositional symbols. So, here I have P to mean
that he is a person M his mortal and S to represent Socrates.

The first statement every person is mortal roughly could translate into if P then M this is
exactly not the statement that every person is mortal what this statement is saying is if
somebody is a person than his mortal. The next one Socrates is a person could be written as S
than P. And from the first two I could derive S is mortal. Now although the third sentence is
entailed by the first two an explicit symbol to represent the individual Socrates was required.

What that means is that if I have to now represent other individuals I would need to introduce
other explicit symbols and this I have to do for each of the person that I want to talk off. And
then I must also have some way to represent the fact that all individuals who are actually
people are also mortal.
(Refer Slide Time: 32:45)

So, propositional logic is a weak language it is hard to identify individuals so we cannot talk
of things like Mary or the number three. We cannot talk of properties of individuals directly
or even relationships between them. Like all I can say in propositional logic about Ben being
fat is to have a proposition P to say man is fat. Generalization patterns regularities cannot
easily be represented it would be really difficult to write all triangles have three sides in
propositional logic.
First-order logic on the other hand is expressive enough to concisely represent the kind of
information that we are looking for. First-order logic allows us to get to the internal structure
of certain propositions in a way that is not possible with propositional logic, first-order logic
as relations variables and quantifiers. So, we could talk of things like every elephant is great
or we could say there is a white alligator.

This is what we will look at in our next lecture. We will first introduce first-order logic and
then look at proofs within first order logic, thank you.

You might also like