
         EDUCATION BB
TOPIC:   HOME SCHOOLING
TO:      ALL
FROM:    <xxxxx>   (<xxxxxxx>)
SUBJECT: COMPUTER HELP!
DATE:    02/22/93


Does anyone know of some good basic computer books?

I'm looking for mid or high school level, not too beginner.

Hardware, software, programming, whatever?

All suggestions welcome!

Thanks a lot. <xxxxx>

		-----*-----

         EDUCATION BB
TOPIC:   HOME SCHOOLING

TO:      <xxxxx>   (<xxxxxxx>)
FROM:    BILL HOGAN   (TWDX23A)
SUBJECT: COMPUTER HELP!?
DATE:    03/03/93

<xxxxx>-

  I think the simplest and most comprehensive formalism for controlling
computers is logic itself.

  In fact, one relatively small part of logic is all you need, namely,
sentences that look like

	this(X,Y) if that1(X,T), that2(T,U), and that3(U,Y).

  The nice thing about this approach to controlling computers is that when
you use it your mind stays focused on the problem you are trying to
understand rather than immediately getting bogged down with questions
about the computer. 

  This approach to computing is called PROLOG (PROgramming in LOGic) and
was developed in France and England in the 1970's and became available for
the PC in the middle 1980's. 

  For example, a young student recently posted a note on the Computer Club
BB in which he described a problem that had been assigned in his computer
class, to whit: write a program in Pascal that reads a list of 0's and
1's and computes the number of "runs" of successive 1's that are separated
by "runs" of successive 0's. In the list

	[0,1,0,0,1,1,0,1,0,1,1,0,0,1,0,1,1,0,1]

there are 7 such runs of 1's.

  {Notice how computer stuff is mixed in with the specification of the
problem to be solved?  What, for example, does "reads a list" mean and why
should I have to think about that when I haven't even figured out the
problem yet?}

  Suppose we simply agree that, for any list L of the sort we are talking
about (0's and 1's, that is), blocks(L,N) means that list L has N of the
"runs" we are talking about. For instance, blocks([0],0), right? A list
consisting of exactly 1 zero certainly has no "runs" of 1's. Similarly,
blocks([1],1). That covers the case of lists of 0's and 1's that contain
exactly one element and we have

	blocks([0],0).
	blocks([1],1).

  Similarly,

	blocks([0,0|L],N) if blocks([0|L],N).
	blocks([0,1|L],N) if blocks([1|L],N).
	blocks([1,1|L],N) if blocks([1|L],N).

  {Here,
              [] = empty list

              [x|[]] = [x]

              [x|[y|L]] = [x,y|L]

  This notation takes a little getting used to but the idea is extremely
simple: if L is a list and you insert x into L you get [x|L] = M, so x is
now the first thing in M; if you now REMOVE x from M = [x|L], you get L
back.}

  So, we have

	blocks([0],0).
	blocks([1],1).
	blocks([0,0|L],N) if blocks([0|L],N).
	blocks([0,1|L],N) if blocks([1|L],N).
	blocks([1,1|L],N) if blocks([1|L],N).

which leaves the case of lists that start with a 1 followed immediately
with a 0 followed by whatever; that is, we have narrowed the remaining
questions down to one:
                                      
	blocks([1,0|L],N) if ... what?
                      
  When you complete that sentence, you will have completed your first
Prolog program; to USE your program, you would ask it a question like: 

	blocks([1,0,1,1,0,0,1,0,1],N)?

and you would get back: N=4.  (bill-CA)

		-----*-----
