LOGIC                                           Aaron Sloman April 1987


            A PROGRAM TO TEACH PROPOSITIONAL LOGIC
            ======================================

These programs assume that you are already acquainted with the basic
concepts of propositional logic, e.g. as explained in chapter 8 of

    I.M. Copi Introduction to Logic.

The program will give you practice to improve your facility with
truth-tables, and increase your understanding of boolean logic.
It offers opportunities for various kinds of practice with truth-
tables including checking inferences for validity and seeing the
equivalence between different formulas.

After you have logged in there are two ways of playing with
the programs. The first makes use of a saved image, and will get
you started faster, namely type:

    pop11 +boole

If the saved images have not been created then these will not work. You
can do the following instead. First run POP11 thus:

    pop11

Then when you get the colon prompt, type

    lib logic;

There will be a delay while the program is being compiled. When it is
ready, as indicated by the colon prompt ":", type

    logic;


you'll be asked if this is your first time? If you type "yes", or "y",
in response, the machine will print out a dictionary of known logical
operators, and other information.

When the program is ready it will print out
        Type a command or formula :


The program always operates on a "current formula". To give it a
current formula you can type in a formula, e.g.
        p and q
        p or q
        p and q or r
        if p then not q
        p & q v r
        p -> -q
(Don't use capital letters. Always end by pressing 'RETURN', etc.)
It is possible to use the program in VED with the <ENTER> lmr command.

You can then give a command to do something with this formula, such as
print it out, or print a truth-table. You can ask for practice in
constructing truth-tables, by means of the HT or EV commands.

The program knows how to read in logical expressions in a variety of
forms, e.g.
        a and b
        a & b
        p -> q
        p and not not q
        p & --q
        not p implies p or q
        -p -> p v q
        -p -> (p v q)
        if not p then p or q

It treats the last four of these as equivalent.
Note that this involves following conventions about where brackets
should be understood.

By typing in a formula and then giving the P (print) command, you can
get the computer to show you where it assumes there are brackets.

If you type in a formula which is not well-formed, the program will
complain, and ask you to begin again. In this way, you can get practice
at telling the difference between well-formed and ill-formed formulas.

The program also knows how to print formulas out. If, instead of typing
in a formula, you give the command:
        p       (abbreviation for PRINT)

the "current formula" is printed out in a symbolic form,
using symbols like:
        ->      -       <->     &       v

Try typing in some of the above formulas, following them with the
        p
command.

If the formula you type in has something wrong with it you'll get a
complaint from the computer, otherwise it says the formula is OK.

You can ask the computer to print out a truth-table for the current
formula (e.g. the last formula you typed in), by giving
the command
        tb              (abbreviation for TABLE)

If instead, you use the command HT (help-table) the computer will not
print out the complete table. Instead it asks you to type the final
entry in each row, and tells you if you've got it wrong.

Closely related to this is the command EV, which says you want to
practice evaluating the current formula, for various combinations of
truth-values of its variables. E.g. if the formula is
        -p -> q v r

(i.e. if not p then q or r) then the EV command says you want to give
values for p q and r, and then work out whether the whole formula is
true or false. The computer will check your answer and give a brief
explanation if it disagrees with your answer.

When you are tired of a particular 'game' you can type 'stop', and then
try another. To turn off the whole logic program type 'bye'. You can
then leave POP-11 in the usual way, either by typing "bye", or by typing
he "end of file" character (usually CTRL-D on Unix machines; CTRL-Z on
VMS).

The LOGIC program can also generate its own formulas. By giving the
command:
        nf              (abbrevation for NEWFORMULA)

you ask the computer to create a formula (at random) and make that the
current formula. You can then print it out, using P. Or you can use the
TB, or EV commands, as above. The formulas start simple, but grow
increasingly complex.

Alternatively you can try to guess what the new formula is is, using the
G (for guess) command (see below).

The formulas generated by the computer grow gradually more complex. The
command RS (restart) makes them return to the initial degree of
complexity. So if you find the formulas produced are too complex, then
type RS, in response to:
        type a command or formula:

Some of the commands cause the computer to print out instructions and
questions. If you are asked to type in truth-values use "t" or "1" for
TRUE and "f" or "0" for FALSE. Separate them with spaces. If you type
something different you will be asked to correct it.

Each of the commands is exactly one word. If you type more than one word
when a command is expected, it will be assumed that you are trying to
type in a new formula, not a command.

Please note that although commands, etc. have been shown in UPPER case
here, you need not type them in upper case. In fact, you should not.


        SUMMARY OF COMMANDS (Don't type them in capitals)
        -------------------

P               (Print)
 Print out current formula using symbols.

NF              (New Formula)
 Create a new formula, and make it the current formula.

RS              (ReStart)
 Make NF go back to producing simpler formulas.

TB              (TaBle)
 Print out a truthtable for the current formula.

HT              (Help Table)
 Asks the computer to help you build a truth-table
for the current formula. The computer will print out the
heading and start each row of the table. You complete the row.
If you make a mistake it will tell you, and explain why the
truth-value you typed in was wrong.

G               (Guess)
 Asks the computer to generate a formula at random which you try to
guess on the basis of partial information about the truth table.
(It is not possible to work out the formula from an incomplete
truth-table, but it can still be instructive and fun guessing.)

TA              (TAutology?)
 Asks computer if current formula is a tautology.

In              (INconsistent?)
 Asks computer if current formula is inconsistent.

CO              (COntingent?)
 Asks computer if current formula is contingent.

EV              (EValuate)
 Tells the computer you want to evaluate the current
formula. It will ask you to type in truth-values for the
variables, then it will ask you to say what you think the
value for the whole formula is. If you get it wrong, you'll
get an explanation. The process is repeated until you type STOP.

EQ              (EQivalent formulas)
 The computer will generate a formula, print it out, and ask you to
construct an equilvalent one. It may be quite complex, but will never
contain more than two different variables.

VAL             (VALidity testing)
 This asks the computer to construct an example of an inference, which
you can then check for validity. The computer asks you how many premisses
you'd like it to have, and it gives you the option of printing out their
individual truth-tables before you try to work out whether the inference
is valid.

BYE             (Log out)
 Type this when you've finished. It will log you out. Alternatively hold down
the CTRL button, and press D at the same time.

STOP
 Stop the current 'game'. You'll then be asked again to type in a formula or
a command. Pressing the button marked CTRL and then typing C has the same
effect.

Pressing the "?" symbol will print out a short summary of commands.

H       (Help)
 Prints out a summary help file.

HH      (More help)
 Prints out a longer file of examples.

Reading:
-------

        I.M. Copi: INTRODUCTION TO LOGIC, chapter 1 and chapter 8

--- C.all/help/logic ---------------------------------------------------
--- Copyright University of Sussex 1992. All rights reserved. ----------
