The Information on this Page is
Preliminary!
Topics
The first six lectures of this course have been devoted to an
introduction to basic and fundamental topics in the theory of
computation, namely two important classes of languages and the
simplest computational devices that accepted/generated them. We have
seen key instances of a natural trichotomy in the theory of
computation - languages,
- automata,
- grammars
that has characterized the study of this scientific discipline from
the beginning.
We shall now take what may appear as a detour by looking at some very
basic, but also very useful, topics in elementary logic. In the
remainder of this course, I hope that you'll appreciate that what
looks like a detour is, in fact, not so! Logic is an important working
tool for Computer Science --- as Moshe Vardi often says, logic
is the "calculus" of our discipline.
The two lectures that we'll have today will serve as an introduction
to propositional (aka Boolean) logic and its uses as a problem solving
and modelling tool in Computer Science.
Time and Location
Friday, 24 September, 2004 at 10:15 and 14:30 in A4-106.
Reading Material
All the reading material for the lectures devoted to logic is
available on line in the Base Logic module
of the TeachLogic
project. In particular, for these lectures you should read up to the sectin entitled "Reasoning with equivalences" (soundness and completeness excluded).
Exercises
Below you will find a large number of exercises. How many of those you
decide to do, and which ones, depends on your interests and confidence
with the material. I strongly suggest, however, that you attempt some
of the basic ones to test your understanding of the notions.
- Problems 3 and 4 on this page.
-
Problems 1-5 on this page. More
seriously, classify these formulae as tautologies, contingencies or
contradictions:
- P --> P
- P and (not P)
- P and (Q or P)
- P --> (Q --> P)
- P <--> (not P and Q)
- (P and Q) --> P
-
Problems 1-2 on this page.
- Exercises 7 and 15 on this page. (You
may wish to try several of the other exercises there too!)
- Per, Kristian, Ole and Jens are to hold an
Xmas-party. Unfortunately, they are almost out of money which severely
limits the amount of beer at the party. In fact, they have to make do
with one Tuborg, one Carlsberg, one Xmas , and one Carl's
Special. However, the four guys have individual requirements which
must be fulfilled at all costs. In particular, Per only drinks Tuborg
and Carlsberg; Kristian only drinks Carlsberg and Xmas; Ole
essentially drinks everything except Xmas, and Jens can only drink
Carlsberg and Carl's Special. Is it possible to plan the party
drinking so that they all get something to drink? Model this situation
using propositional logic, and help these guys!
- [This exercise is due to Stanley Burris. Do it, it's
fun!] The island of Tufa has two tribes, the Tu's who always tell the
truth, and the Fa's who always lie.
A traveller encountered three residents A, B and
C of Tufa, and each made a statement to the traveller:
- A said, "A or B tells the truth if C lies."
- B said, "If A or C tells the truth, then it is not the case that exactly one of us is telling the truth."
- C said, "A or B is lying if, and only if, A or C is telling the truth."
Determine, as best as possible, which tribes A, B and
C belong to. Of course, using propositional logic helps!
- [New Exercises]
- Given a DFA
A and a string w, can you write a propositional formula
FA,w that is satisfiable iff A accepts
w?
- You are given a graph G = (V,E). Write a propositional formula
FG that is satisfiable iff G has a
Hamiltonian path.
- [This exercise is due to Nimal Nissanke.] Is the
following argument valid? Provide a reason why it is/isn't.
If a misalignment of the clocks of the robot implies a shortage of its power, then there will be a delay in the descent of the buggy to the Martian surface.
Misalignment of the clocks of the robot prevents commands from Mission Control reaching the robot, and delays the descent of the buggy to the Martian surface.
If the solar batteries are fully drained during the Martian night or there is a delay in the descent of the buggy to the Martian surface, then there is a power shortage in the robot.
I can therefore conclude that there is a power shortage in the robot.
Luca Aceto,
Department of
Computer Science,
Aalborg University.
Last modified: