Workshop 2 - LOGIC and LANGUAGE. (Revised Sept 2012).

In this session, we shall investigate how normal language is governed by logic rules, which although may not be apparent to us, nevertheless govern our language, and hence perhaps the way we think. You have seen some examples of sentences which we shall not consider, due to bad grammar, ambiguity and so on which we will not consider. We also throw out sentences of the type which are opinions or desires, such as

I think that music is great!

I would like to learn to program in Python.

so we are left with sentences like

If you come home early, you can watch TV.

Steve is cheerful and brave.

These sentences are declarative sentences and can be enclosed in special brackets like this

Holmes and Watson were on the case.

1. Logic Connectives

1.1 The AND Connective

Sentences refer to other sentences, and are therefore connected to other sentences. Think of the complex sentence;

<Henry was a king and he had six wives>

This can be written as two simpler sentences

<Henry was a King> <Henry had six wives>

where the symbol refers to “and”. While this symbol replaces the word “and”, it also refers to the “and” component of Logic which we shall investigate a little later.

We can make life a little easier by writing a symbol for each sentence, like this;

P = <Henry was a king>

Q = <Henry has six wives>

so the sentence may be written, in symbols, like this P Q

You see that the symbol " " means AND. It’s the AND Connective.

The behaviour of all connectives is studied and summarized using TRUTH TABLES. In these tables

0 represents FALSE

1 represents TRUE

Now, if we have one sentence, it can have a logical value of 0 or 1, in other words it can be false or true. In this example we have two sentences, P and Q. Each sentence can be either true or false. So there are 4 possible combinations;

P false / Q false
P false / Q true
P true / Q false
P true / Q true

This is what the truth table summarizes, on its left side.

P / Q
0 / 0
0 / 1
1 / 0
1 / 1

What goes in the right hand column? You must decide. Look at the second line, (0 1). P is false and Q is true, so what about P Q … is that true or false? Well, if Henry was a king is false AND Henry had six wives is true, then Henry was a king and had six wives is false. So you must write a 0 there. Thinking like this, fill in the above truth table for the AND connective.

Now you've done that, let's do it again, but this time using the electronic AND – Gate. Remember that a light ON is 1 is true and a light OFF is 0 is false. Make up this circuit; (using Multimedia Logic)

and using it, fill in the truth table for the AND connective again,

P / Q / P Q
0 / 0 / 0
0 / 1
1 / 0
1 / 1

and hopefully it will agree with the table you produced above.

1.2 The OR Connective.

In an advertisement for a job as entertainments manager at a well-known holiday camp in Worcester, the following sentence appeared;

"The applicant must be either a sportsman or a bishop".

So we have two atomic sentences;

P = The applicant is a sportsman

Q = The applicant is a bishop.

Now, think out the truth table for the OR (P v Q) connective and try to fill this in by thinking about the sentences.

P / Q / P Q
0 / 0
0 / 1
1 / 0
1 / 1

The last line might give you some trouble; it's a well-known problem, and we'll discuss it soon.

Now investigate the behavior of the electronic OR - gate by building this circuit;

and finding the truth table;

P / Q / P Q
0 / 0
0 / 1
1 / 0
1 / 1

And check out that this agrees with the truth table you suggested above.

1.3 The NOT Connective.

Here we need only one sentence, e.g., P = Cows can fly. When preceded by the symbol ~ the sentence is negated. So ~P means ‘it's not true that cows can fly’ or more simply stated, 'Cows cannot fly'. Work out by thinking the truth table for NOT;

P / ~P
0
1

and investigate the electronic NOT- Gate using this wiring;

and get the truth table

P / ~P
0
1

1.4 So can Cows Fly ?

Consider the sentence P = <Cows can fly

write down, in English, the meaning of the sentence P ~ P

Now work out the truth table for it;

P / P ~ P
0
1

and check it by building up this circuit

and from this find the truth table

P / P ~P
0
1

I hope you found that these two sentences together had no meaning.

Now, using the cows example, write down the meaning of the sentence <P ~P> and construct its truth table. You should recognize this as the tautology mentioned in class.

P / P ~P
0
1

Summary so far...You should have found that for each connective AND, OR, NOT, the truth tables you got by thinking about the meaning of the English sentences are identical to the tables got from the corresponding electronic chips. That's quite fantastic, it indicates a close correspondence between digital logic and logic in language.

1.5 The Conditional - IF

One of the most fundamental truth functors in our daily language is the “IF”. Just think how many times in a day we say or think this “IF”. How on earth can we get this “IF” into digital electronics and formal logic? Well, let’s see.

Let’s take for example, the sentence set “If Fred is at home, then he is asleep”. We may divide it into two atomic sentences;

P = <Fred is at home

Q = Fred is asleep

and we shall represent the IF functor by the arrow; P ® Q. The truth table corresponding to the IF functor is shown below

P / Q / P ® Q
0 / 0 / 1
0 / 1 / 1
1 / 0 / 0
1 / 1 / 1

Let’s take this line by line.

Line 4. No problem. Here Fred is at home and Fred is asleep. This is clearly true.

Line 3. OK but vital. Fred is at home and Fred is not asleep. This is clearly false.

Lines 1 and 2. In both, Fred is not at home. In one case he is asleep (perhaps on a park bench) and on the other day he is not asleep. The point is, could P ® Q be true here? Well yes, it could be true since we know that P is false, Fred is not at home, so he could be either asleep or not asleep. So lines 1 and 2 have to be correct (together). Linguists agree with this definition. It is false only in one case, and the definition leads to some interesting language paradoxes as you will see if there is time.

Is it is possible to find a combination of AND, OR, NOT gates which will do the job? The answer is yes and the result is shown in the circuit below

Let’s test this out. We can easily build ~P Q>, Wire it up as shown below.

Now get its truth table and verify this is the same as the Philonian Conditional, as given in the table above.

P / Q / P ® Q
0 / 0
0 / 1
1 / 0
1 / 1

Yep! The truth tables are identical. The equality does sound reasonable, the sentences "If I am a boy, then I am male" is the same as "I am not a boy or else I am male"

2. CONSISTENCY Material in this section good for the portfolio

2.1 The method of Consistency Checks.

A set of declarative sentences is said to be “consistent” if one or more combinations can be found which is true. Think about this set of two sentences;

a) Holmes and Watson are on the case

b) Either Holmes was not on the case, or else Watson was.

They could be consistent if a combination can be found which is true. Can you think it out? You must say who was on the case, if possible.

It’s easy to see how to check consistency of two sentences, they must both be true, that is sentence one is true AND sentence two is true. Note the AND connective.

We can split the two sentences above into the following “atomic” sentences

P = Holmes was on the case

Q = Watson was on the case

Your first job is always to extract these atomic sentences from the complex set of sentences given in any problem.

Secondly, you must transcribe the original sentences and in terms of your found atomic sentences P and Q. In this case the two sentences become.

a)  <P Q>

b) <~P Q>

Thirdly, to test for consistency, we AND these sentences, to look for any case where both a) and b) are true together. So we form

<P Q> ~P Q>

Fourthly, we make the electronic wire-up. The circuit is given below, but it is built up as follows;

1. build <P Q >

2.  build < ~P Q>

3.  AND the outputs of 1 and 2 and connect to a light

Finally, make up the truth table by trying the various P’s and Q’s (0 and 1) and look for any

true combination of P and Q.

P / Q
0 / 0
0 / 1
1 / 0
1 / 1

If your circuit was correct, there should be a single true combination, P = 1, Q = 1. What does this mean? The only consistent combination of P and Q is

a)  Holmes is on the case

b)  Watson is on the case

So we have proved that the original set of sentences (a) and (b) is consistent and we know exactly who was on the case.

2.2 Watson and Holmes in Confusion

Test the consistency of this set of sentences using the method above.

a) Holmes and Watson were on the case.

b) If Holmes was on the case, then Watson was not.

First find the atomic sentences P and Q;

P =

Q =

Now transcribe the set of sentences a) and b) in terms of P and Q using the logic notation

a)

b)

Now AND these sentences using the logic notation

c)

Now build the circuit (generate the terms for a) and then for b) and then AND the outputs, and then get the truth table. Draw your circuit and the truth table.

Did you expect this result? Look at the starting sentences and think out the answer.

2.3 Smiley's People.

Test the consistency of this set of sentences;

"Smiley is an English spy. Smiley is not both a Russian and an English spy. If Smiley is a Cad, then he is a Russian spy".

P =

Q =

R =

Transcription;

Truth Table:

P / Q / R
0 / 0 / 0
0 / 0 / 1
0 / 1 / 0
0 / 1 / 1
1 / 0 / 0
1 / 0 / 1
1 / 1 / 0
1 / 1 / 1

And build a circuit to verify your solution. If all has gone well, you should find only one consistent solution. Write this out in English

2.4 Too many Detectives.

Test the consistency of these sentences;

"If Holmes. solved the crime, then Lestrade took the criminal. Of course, if the criminal escaped, then Lestrade did not take him. On this particular day, Holmes solved the crime, but the criminal escaped"

P =

Q =

R =

Transcription

Circuit

Write out in English any consistent solutions;

2.5 Who does what and where they live.

Here's a test where there are four sentences in the starting set. Your task, should you choose to accept it, is to find out who does what and who lives where.

“Either David or Warren live in Bromsgrove. Either Warren or Fozzy is a Muppet. Warren is not a Muppet and doesn't live in Bromsgrove!

P =

Q =

R =

S =

Transcribe, build the Circuit and complete the truth table ,and write out in English any consistent solutions. You will need to use a 4-input AND gate to combine your sentences

2.6 Gunmen and Hostages.

Again, we have a set of four sentences, and we wish to find if there is/are any consistent solution(s) to this set.

"If the gunmen are tired, then they are on edge. If they are armed and on edge, then the hostages are in danger. The gunmen are armed but the hostages are not in danger."

P =

Q =

R =

S =

Transcription;

Circuit;

and write out in English any consistent solutions;

3. TESTING THE VALIDITY OF ARGUMENTS material good for Portfolio

Here is an example of an ARGUMENT:

"Worcester Uni. students who are take Computing may use Room 113"

"I am in a Worc. Uni. Student and I take Computing"

"Therefore I may use the Room 113"

The first two lines are called the PREMISES of the argument, and the final line is the CONCLUSION.

How to proceed? Well, via a somewhat vicious route. We take the premises as given, but then we take the conclusion and negate (invert) it. Then we do a consistency check (as above). If we find any single consistent solution (with true premises and false conclusion) then clearly the argument is incorrect! Only is there is no consistent solution to this set of sentences (true premises and negated conclusion) do we conclude that the argument is correct. The method's called REDUCTIO AD ABSURDUM.