May 11, 2009

Summary:

That the ability to write descriptions that other people can depend on is the best test of understanding has become more or less well-established in modern teaching practice. However, this proposition raises a prior question: what is the best test of the ability to write descriptions that other people can depend on? The purpose of The <Language> Machine Prototype is to illustrate what I believe to be the simplest objective answer to that question. In what follows, the phrase "The <Language> Machine", standing by itself, refers to The <Language> Machine in the abstract.

What it does:

The <Language> Machine finds the answers that a given description supplies to a given question; the given description and the given question must be written in <Language> Machine language.

Example:



  /* On zipping lists of numbers together. */

  $topic @zipper(*$number,*$number,*$number)
  
  $para @zipper

  /* Rule 1. */
 
  $rule @zipper([],[],[]).

  /* Rule 2. */

  $rule @zipper([X|L1],[Y|L2],[X,Y|L3]) $if
    @zipper(L1,L2,L3).

  $end_para

List notation:

[X|L] represents a non-empty ordered list of which X is the first member and L is the list that remains when X is removed.

For example, if [X|L] is [1,2,3] then X is 1 and L is [2,3].

[] represents an empty list.

[X|[]] means the same thing as [X].

[X|[Y|L]] means the same thing as [X,Y|L].

For example, [a|[b|[c|[]]]] is [a|[b|[c]]] is [a|[b,c]] is [a,b,c].

Thus


  $rule @zipper([],[],[]).
says that the result of zipping two empty lists together is another empty list, and


  $rule @zipper([X|L1],[Y|L2],[X,Y|L3]) $if
    @zipper(L1,L2,L3).
says that if L3 is the result of zipping L1 and L2 together then, for any X and Y, [X,Y|L3] is the result of zipping [X|L1] and [Y|L2] together.

How you make it do what it does:

If I now ask what answers does the description given above supply to the question


  @zipper(X,Y,[1,2,3,4,5,6,7,8]).
The <Language> Machine responds as follows:


  X->[1,3,5,7], Y->[2,4,6,8]
  One <answer>.

In what sense is this an answer to the given question and in what sense is it supplied by the given description?

Whence:

If we replace each occurrence of each variable in the given question with the value assigned to it by this answer, we get


  @zipper([1,3,5,7],[2,4,6,8],[1,2,3,4,5,6,7,8]).

which is


  @zipper([1|[3,5,7]],[2|[4,6,8]],[1,2|[3,4,5,6,7,8]]).

According to the second rule in the given description,


  @zipper([1|[3,5,7]],[2|[4,6,8]],[1,2|[3,4,5,6,7,8]]) if
      @zipper([3,5,7],[4,6,8],[3,4,5,6,7,8]).

Applying the same procedure to the antecedent in this result, we get


  @zipper([3|[5,7]],[4|[6,8]],[3,4|[5,6,7,8]]) if
      @zipper([5,7],[6,8],[5,6,7,8]).

Continuing in this fashion, we get


  @zipper([5|[7]],[6|[8]],[5,6|[7,8]]) if
      @zipper([7],[8],[7,8]).
and


  @zipper([7|[]],[8|[]],[7,8|[]]) if
      @zipper([],[],[]).

But, according to the first rule in the given description, we already have


  @zipper([],[],[]).

so the sentence


  @zipper([1,3,5,7],[2,4,6,8],[1,2,3,4,5,6,7,8]).

holds as a purely logical consequence of the given description.

In other words, had the question been


  @zipper([1,3,5,7],[2,4,6,8],[1,2,3,4,5,6,7,8])
The <Language> Machine would have responded


  Yes.
  One <answer>.
— and, indeed, the result of zipping [1,3,5,7] and [2,4,6,8] together is [1,2,3,4,5,6,7,8].

Equally, however, had the question been


  @zipper([1,3,5,7],[2,4,6],[1,2,3,4,5,6,7])
The <Language> Machine would have responded


  No.
because the statement in question is not a logical consequence of the given description.

Soundness and completeness:

Let D be a given description and Q be a given question.

Let

finds(A|D&Q)
mean
The <Language> Machine finds answer A given D&Q.

Let

supplies(A|D&Q)
mean
A is a purely logical consequence of D&Q.

Then

finds(A|D&Q) => supplies(A|D&Q)
and
supplies(A|D&Q) => finds(A|D&Q).

Practically speaking, this means that if we can believe the given description then we can believe the answers that The <Language> Machine finds to the given question, and, conversely, if The <Language> Machine does not find any answers to the given question, we may conclude from this that the given description does not supply any.

So what?

The <Language> Machine finds all the answers that the given description supplies to the given question and only the answers that the given description supplies to the given question.

The reason why The <Language> Machine can do this is because it requires all of the sentences in the given description to be of the form

P if Q1, Q2, ..., Qn.
or simply
P.

When all of the sentences in the given description are of this form it becomes possible to use a computer to find the answers that the given description supplies to a given question because sentences of this form (and only sentences of this form) link together to make a distinctively treelike "road map" that is guaranteed to "take" the computer to each and every one of the possible "places" where an answer might be found.

What this means in practice, however, is that if the answers that The <Language> Machine finds are not what you think they should be then either the description you wrote or the question you asked does not say what you think it says.

In other words, successful operation of The <Language> Machine requires certain language skills; conversely, successful operation of The <Language> Machine reinforces those language skills.

But successful operation of The <Language> Machine is something that can be determined with complete objectivity, so quite aside from its applications what we have in this technology is a completely objective test of the language skills it requires for its successful operation.

How important are the language skills that The <Language> Machine requires for its successful operation? To get some insight into this question, consider for a moment what it is possible to describe using only sentences of the form required by The <Language> Machine.

Included in this class is any system (situation, structure, process, policy, etc.) that is governed by (or consists in) a finite set of well-defined rules, which in turn includes anything that a computer can be made to do and anything that any system that can be controlled by a computer can be made to do.

However, from a logical point of view, which in the present case is the literary point of view as well, there is no difference in principle between the problem of describing a computer and the problem of describing a system that is controlled by a computer.

It therefore suffices for present purposes to describe the Turing-Post computer model, using only sentences of the form required by The <Language> Machine.

Here I am following Chapter 10, Section B, "Emil Post on Computability", in Computability: Computable Functions, Logic, and the Foundations of Mathematics, by Richard L. Epstein and Walter A. Carnielli [Wadsworth & Brooks/Cole, 1989 (ISBN 0-534-10356-1)].


  /* Turing-Post Model */

  $map !tape -> { tape(!left,!box,!right) }

  $map !left -> *!box

  $map !right -> *!box

  $map !box -> { clear ; marked }

  $map !index -> { done ; loc({$number}) }

  $map !state -> { state(!index,!tape) }

  $map !instruction -> { stop ; op(!action,!index) ; test(!index,!index) }

  $map !action -> { left ; right ; mark ; erase }

  $topic @program({$number},!instruction)

  $topic @compute(!state,!state)
  $topic @change_state(!index,!tape,!state)
  $topic @apply(!instruction,!tape,!state)
  $topic @apply_op(!action,!tape,!tape)
  $topic @move_left(!tape,!tape)
  $topic @move_right(!tape,!tape)
  $topic @apply_test(!index,!index,!tape,!index)

  $para @program
    $rule @program(1,test(loc(3),loc(2))).
    $rule @program(2,stop).
    $rule @program(3,op(erase,loc(4))).
    $rule @program(4,op(right,loc(1))).
  $end_para

  $para @compute
    $rule @compute(state(INDEX,TAPE),NewSTATE) $if
      @change_state(INDEX,TAPE,NewSTATE).
   $end_para

  $para @change_state
    $rule @change_state(done,TAPE,state(done,TAPE)).
    $rule @change_state(loc(ADDRESS),TAPE,NewSTATE) $if
      @program(ADDRESS,INSTRUCTION),
      @apply(INSTRUCTION,TAPE,NextSTATE),
      @compute(NextSTATE,NewSTATE).
   $end_para

  $para @apply
    $rule @apply(stop,TAPE,state(done,TAPE)).
    $rule @apply(op(ACTION,INDEX),TAPE,state(INDEX,NewTAPE)) $if
      @apply_op(ACTION,TAPE,NewTAPE).
    $rule @apply(test(INDEX1,INDEX2),TAPE,state(NewINDEX,TAPE)) $if
      @apply_test(INDEX1,INDEX2,TAPE,NewINDEX).
  $end_para

  $para @apply_op
    $rule @apply_op(left,TAPE1,TAPE2) $if
      @move_left(TAPE1,TAPE2).
    $rule @apply_op(right,TAPE1,TAPE2) $if
      @move_right(TAPE1,TAPE2).
    $rule @apply_op(mark,tape(LEFT,#,RIGHT),tape(LEFT,marked,RIGHT)).
    $rule @apply_op(erase,tape(LEFT,#,RIGHT),tape(LEFT,clear,RIGHT)).
  $end_para

  $para @move_left
    $rule @move_left(tape([A|LEFT],X,RIGHT),tape(LEFT,A,[X|RIGHT])).
    $rule @move_left(tape([],X,RIGHT),tape([],clear,[X|RIGHT])).
  $end_para

  $para @move_right
    $rule @move_right(tape(LEFT,X,[B|RIGHT]),tape([X|LEFT],B,RIGHT)).
    $rule @move_right(tape(LEFT,X,[]),tape([X|LEFT],clear,[])).
  $end_para

  $para @apply_test
    $rule @apply_test(INDEX1,#,tape(#,marked,#),INDEX1).
    $rule @apply_test(#,INDEX2,tape(#,clear,#),INDEX2).
  $end_para

  /* The End */

If I now ask what answers does the description given above supply to the question


  @compute(state(loc(1),tape([],marked,[marked,marked,marked,clear])),Q).

The <Language> Machine responds as follows:


  Searching...
  Q->state(done,tape([clear,clear,clear,clear],clear,[]))
  One <answer>.

Again, the answer is a purely logical consequence of the given description.

The <Language> Machine thus lends itself to describing precisely the kinds of systems that are becoming more and more important in our increasingly interactive world, and to finding answers to questions about those systems. I think it follows that the importance of the skills required to construct those descriptions and to formulate those questions will increase accordingly.

For these two reasons — the importance of the language skills it requires for its successful operation, and the complete objectivity with which it can be used to test those skills — I believe the technology represented by The <Language> Machine Prototype is the best test of the ability to write descriptions that other people can depend on.

The software:

The file demo.zip contains the following:

  --------------------------------------------------------------------
  tlm_skills.html........this document
  disclaim.doc...........please note
  --------------------------------------------------------------------
  tlm.exe ...............TLM compiled on PDC Prolog 3.31a on MS-DOS
  tlm-hlp.txt ...........help file accessible from tlm.exe
  config.tlm ............startup file read by tlm.exe
  pdc-conf.tlm...........backup copy of config.tlm
  tlm.err ...............error message codes used by tlm.exe
  pdc-tlm.err............backup copy of tlm.err
  files named *.say .....sample <description>s
  files named *.ask .....sample <question>s
  --------------------------------------------------------------------
  vip/vp_tlm.exe.........TLM compiled on Visual Prolog 5.2 on Win98SE
  vip/tlm-hlp.txt .......same as tlm-hlp.txt
  vip/config.tlm.........startup file read by vp_tlm.exe
  vip/vip-conf.tlm.......backup copy of vip/config.tlm
  vip/tlm.err............error message codes used by vp_tlm.exe
  vip/vip-tlm.err........backup copy of vip/tlm.err
  --------------------------------------------------------------------

These files take up a little over 1.2MB of disk space. TLM.EXE and VP_TLM.EXE can be run on Linux in the dosemu "DOS" emulator (as can PDC Prolog). On Windows 2000, TLM works best in full-screen mode (if it does not start in full-screen mode automatically, press ALT+ENTER after it starts).

Please feel free to download anything you find in either of the following two directories:

http://www.geocities.com/logic4sure/TLM/ while the Yahoo/GeoCities site still exists, and

http://logic4sure.dyndns.org/TLM/ when my computer at home is on-line.

Thank you.

Copyright 1993-2009
<logic4sure@yahoo.com>


PDC Prolog, Visual Prolog, MS-DOS, and Windows are registered trademarks of their respective holders. 1