This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources. Find sources: "TUTOR" – news ·newspapers ·books ·scholar ·JSTOR(April 2010) (Learn how and when to remove this message) |
Paradigm | imperative (procedural) |
---|---|
Designed by | Paul Tenczar & Richard Blomme[1] |
Developer | Paul Tenczar &University of Illinois at Urbana-Champaign |
First appeared | 1969 (1969) |
Typing discipline | none |
Majorimplementations | |
TUTOR, Micro-TUTOR | |
Influenced | |
TenCORE,USE (Regency Systems) |
TUTOR, also known asPLATO Author Language, is aprogramming language developed for use on thePLATO system at theUniversity of Illinois at Urbana-Champaign beginning in roughly 1965. TUTOR was initially designed byPaul Tenczar for use incomputer assisted instruction (CAI) andcomputer managed instruction (CMI) (in computer programs called "lessons") and has many features for that purpose. For example, TUTOR has powerful answer-parsing and answer-judging commands, graphics, and features to simplify handling student records and statistics by instructors. TUTOR's flexibility, in combination with PLATO's computational power (running on what was considered a supercomputer in 1972), also made it suitable for the creation of games — including flight simulators, war games, dungeon style multiplayer role-playing games, card games, word games, and medical lesson games such asBugs and Drugs (BND). TUTOR lives on today as the programming language for the Cyber1 PLATO System,[2] which runs most of the source code from 1980s PLATO and has roughly 5000 users as of June 2020.
TUTOR was originally developed as a special purposeauthoring language for designing instructional lessons, and its evolution into a general purpose programming language was unplanned.The name TUTOR was first applied to the authoring language of thePLATO system in the later days of Plato III.The first documentation of the language, under this name, appears to have beenAvner, Richard Allen; Tenczar, Paul (January 1969),The TUTOR Manual. CERL Report X-4
The articleTeaching the Translation of Russian by Computer[3] gives a snapshot of TUTOR from shortly before PLATO IV was operational. Core elements of the language were present, but commands were given in upper case, and instead of using a general mechanism, support for alternative character sets was through special command names such asWRUSS
for "write using the Russian character set."
Through the 1970s, the developers of TUTOR took advantage of the fact that the entire corpus of TUTOR programs were stored on-line on the same computer system. Whenever they felt a need to change the language, they ran conversion software over the corpus of TUTOR code to revise all existing code so that it conformed with the changes they had made.[4]As a result, once new versions of TUTOR were developed, maintaining compatibility with the PLATO version could be very difficult.[5]
Control Data Corporation (CDC), by 1981, had largely expunged the name TUTOR from their PLATO documentation. They referred to the language itself as thePLATO Author Language. The phraseTUTOR file or evenTUTOR lesson file survived, however, as the name of the type of file used to store text written in the PLATO Author Language.[6]
A TUTOR lesson consists of a sequence ofunits where each unit begins with the presentation of information and progress from one unit to the next is contingent on correctly answering one or more questions. As withCOBOL paragraphs, control may enter a TUTOR unit from the preceding unit and exit into the next, but units are also callable as subroutines using thedo
orjoin
commands.
Here is an example unit:[7]
unit mathat 205write Answer these problems 3 + 3 = 4 × 3 =arrow 413answer 6arrow 613answer 12
Several things should be immediately apparent from this example.
write
command above, the tag may consist of multiple lines. Continuation lines are either blank or have a leading tab.What may not be apparent is the control structure implicit in this unit. Thearrow
command marks the entrance to ajudging block This control structure is one of TUTOR's unique features.
TUTOR contained a number of unique features. The following list is not intended as a substitute for a TUTOR manual, but merely highlights the most interesting, innovative, and sometimes confusing features of the language.
Ajudging block in TUTOR is a control structure that begins with anarrow
command and ends with the nextarrow
,endarrow
orunit
command. Thearrow
command also prompts for input, with the special arrow character (resembling "▷") displayed as a prompt at the indicated screen coordinates. In effect, a judging block can be thought of as a backtracking control structure where the student may make multiple attempts to answer a question until a correct answer allows forward progress.
Each judging block consists of a sequence ofpattern matching commands, each of which introduces a (possibly empty) block of commands to be executed if that pattern matches. The two most common pattern matching commands wereanswer
andwrong
. These had identical pattern matching semantics except thatanswer
judged a student response to be correct if it matched, whilewrong
judged a student response to be incorrect.
The tag fields on theanswer
andwrong
commands consisted of lists of optional, required and alternative words. consider this example:[8]
answer <it, is,a, it's, figure, polygon> (right, rt) (triangle, triangular)
This would match answers such as "it is a right triangle" or "it's a triangular figure" or just "rt triangle". It would not match "sort of triangular" because the words "sort of" are not listed as ignored, and it would not match "triangle, right?" because theorder is wrong.
The pattern matching subsystem recognized spelling errors, so the words "triangel" or "triangl" would match the example pattern. The lesson author could use thespecs
command to set how pedantic the system was about spelling errors.
The pattern matching algorithms used by various TUTOR implementations varied in detail, but typically, each word in the input text and each word in the pattern were converted tobit vectors. To see whether a word of student input matched a word of the pattern, theHamming distance between the two bit vectors was used as a measure of the degree of difference between the words. Bit vectors were typically 60 or 64 bits long, with fields for letter presence, letter pair presence, and the first letter. As a result, the number of one bits in theexclusive or of two such bit vectors approximated the extent of the phonetic difference between the corresponding words.[9]
All early presentations of the control structure of a TUTOR judging block were confusing. In modern terms, however, a judging block can be described as aniterative control structure that exits when the student input is judged correct. The bodyof this control structure consists of a series ofcases, each introduced by apattern matching command such asanswer
orwrong
. All output produced by the body of the judging loop in theprevious cycle is erased from the screen prior to the next cycle.
Consider this example:[10]
wrong <it, is,a> squareat 1501write A square has four sides.
In the event that the student inputs "square" or "a square", the answer is judged to be incorrect, and the text "A square has four sides." is output starting at line 15 column 1 on the screen. This output remains on the screen until the student begins to entera new answer, at which point, it is erased so that the response to the new answer can be computed. The mechanism by which the display screen rolls back to its previous state varies from implementation to implementation. Early implementations operated by switching the terminal into erase mode and re-executing the entire case that had matched. Some later implementations buffered the output produced during judging so that this output could be erased.
Thejoin
command was a unique form of subroutine call. It was defined as being equivalent to textual substitution of the body of the joined unit in place of the join command itself.[11] As such, a joined unit could contain part of a judging block. Thus, while the judging block is conceptually aniterator enclosing a series ofcases, this block may be arbitrarily broken into subroutines. (An alternative subroutine call, thedo
command, conformed to the usual semantics associated with subroutine calls in other programming languages.)
The PLATO IV student terminal[12] had a 512 by 512pixelplasma display panel,with hardware support forpoint plotting, line drawing, and text display.Each pixel on the PLATO IV terminal was either orange or black. The CDC PLATO V terminal used a monochrome black and whiteCRT to emulate the plasma panel. The built-in character set had 4 sets of 63 characters, each 8 by 16 pixels, half of these were fixed, half were programmable. The Tutor language provided complete support for this terminal.
There were twocoordinate systems[13]
The following example illustrates some of Tutor's drawing commands.[14]
draw 1812;1852;skip;1844;1544circle 16,344,288draw 1837;1537;1535;1633;1833
Note the use of semicolons to separate successive coordinates on thedraw
command. This allows unambiguous use of comma-separated fine coordinates. Normally, the draw command connects consecutive points with line segments, but by puttingskip
in the tag, thedraw
command could be made to conceptually lift its pen.
The tags on thecircle
command give the radius and fine coordinates of the center. Additional tags could specify starting andending angles for partial circles.
Hand composing draw commands is difficult, so a picture editor was included in the PLATO system by 1974 to automate this work.[15] This could only deal with drawing commands with constant coordinates.
The following example illustrates some of the text rendering tools of Tutor.[16]
unit titlesize 9.5 $$ text 9.5 times normal sizerotate 45 $$ text rotated 45 degreesat 2519write Latinsize 0 $$ return to normal writingrotate 0at 3125write Lessons on Verbs
Text rendered in size zero rotation zero used the built-in character rendering hardware of the PLATO terminal, while rendering with nonzero size and rotation was done with line segments and therefore significantly slower due to the speed of the communication link to the terminal.
Aside from its unique answer judging mechanisms, TUTOR's original set ofcontrol structures was rather sparse. In the mid 1970s, this shortcoming was addressed by introducingif
,endif
blocks with optionalelseif
andelse
sections. The semantics of these control structures was routine, but the syntax inherited the mandatoryindentation of the Tutor Language, presaging that ofPython and adding a unique nonblank indent character to distinguish indenting from continuation lines.
This is illustrated in the following example:[17]
if n8<4. write first branch. calc n9⇐34elseif n8=4. write second branch. do someunitelse. write default branch. if n8>6. . write special branch. endifendif
(Theassignment arrow in thecalc
statement is not rendered correctly in some browsers. It appears similar to <= but as one character. It had a dedicated key on the PLATO IV keyboard.)
The same syntax was used forloop
,endloop
blocks with semantics comparable towhile loops in conventional programming languages. This is illustrated in the following example[18]
loop n8<10. write within loop. sub1 n8reloop n8≥5. write still within loop. do someunitoutloop n8<3. write still within loopendloopwrite outside of loop
Note that thereloop
andoutloop
commands are somewhat analogous to thecontinue
andbreak
statements of languages based onC, except that they must sit at the indenting level of the loop they modify, and they have a condition tag that indicates when the indicated control transfer is to take place. This makes the construct more powerful than in other languages, because any line of the inner loop could terminate or reloop several outer loops with one statement.
TUTOR's expression syntax did not look back to the syntax ofFORTRAN, nor was it limited by poorly designed character sets of the era. For example, the PLATO IV character set includedcontrol characters forsubscript and superscript, and TUTOR used these for exponentiation. Consider this command[19]
circle (412+72.62)1/2,100,200
The character set also included the conventional symbols for multiplication and division,×
and÷
, but in a more radical departure from the conventions established by FORTRAN, it allowed implicit multiplication, so the expressions(4+7)(3+6)
and3.4+5(23-3)/2
were valid, with the values 99 and 15.9, respectively (op cit). This feature was seen as essential. When students typed in a numeric answer to a question, they could use operators and variables and standard algebraic notation, and the program would use the TUTOR "compute" command to compile and run the formula and check that it was numerically equivalent (or within the floating point roundoff error) to the correct answer.
The language included a pre-defined constant named with the Greek letter pi (π), with the appropriate value, which could be used in calculations. Thus, the expressionπr2
could be used to calculate the area of a circle, using the built-in π constant, implicit multiplication and exponentiation indicated by a superscript.
In TUTOR, the floating-point comparisonx=y
was defined as being true ifx
andy
were approximately equal.[20] This simplified life for mathematically naïve developers of instructional lessons, but it occasionally caused headaches for developers of numerically sophisticated code because it was possible that bothx<y
andx≥y
could be true at the same time.[21]
As an authoring language, TUTOR began with only minimal memory resources and only the crudest tools for manipulating them. Each user process had a private data segment of 150 variables, and sharedcommon blocks could be attached, allowing inter-user communication through shared memory.
On the PLATO IV system, words were 60 bits, in keeping with theCDC 6600 family of computers. Some later implementations changed this to 64 bits.[22]
The private memory region of each process consisted of 150 words each, referred to as student variables; the values of these variables were persistent, following the individual user from session to session. These were addressed asn1
throughn150
when used to hold integer values, or asv1
throughv150
when used to hold floating point values.[23]
A TUTOR lesson could attach a single region of up to 1500 words of shared memory using thecommon
command. Each lesson could have an unnamed temporary common block containing variables shared by all users of that lesson. Such blocks were created when a lesson came into use and deallocated when the lesson became inactive. In contrast, named common blocks were associated with a block of a lesson (a disk file). Shared memory was addressed asnc1
throughnc1500
(for integers) orvc1
throughvc1500
(for floating point numbers).[24]
Where 150 student variables was insufficient, a lesson could use thestorage
command to create an additional private memory segment of up to 1000 words. This segment existed in swap space only, but it could be mapped to student variables or common variables. For example[25]
common 1000storage 75stoload vc1001,1,75
This example definesnc1
tonc1000
as a shared unnamed common block, whilenc1001
tonc1075
are private storage.
The Tutordefine
command was very similar to theC#define
preprocessor directive. This was the only way to associate mnemonic names with variables. It was up to the programmer to statically allocate memory and assign names to variables. Consider this example:[26]
define mynames first=v1, second =v2 result=v3
This creates a set of definitions namedmynames
defining three floating point variables. Users were advised that "there should not be any v3's or v26's anywhere in your lesson except in thedefine
statement itself. Put all your definitions at the very beginning of the lesson where you will have ready reference to which variables you are using."[27]
Functions could be defined, with macro-substitution semantics, as in this illustration:[28]
define cotan(a)=cos(a)/sin(a)
Unlike C, the originalscope rules of TUTOR were pure "definition before use" with no provisions for local definitions. Thus, the formal parametera
used above must not have any previous definition.
Later in the development of TUTOR, with the introduction of multiple named sets of definitions, the programmer was given explicit control over which sets of definitions were currently in force. For example,define purge, setname
would discard all definitions in the named set.[29]
The original TUTOR tools for text manipulation were based on commands for specific text operations, for example,pack
to place a packed character string into consecutive variables in memory,search
to search for one string within another, andmove
to move a string from memory to memory.[30] By 1975, more general tools for arrays of integers and packed arrays were added. For example:[31]
define segment, name=starting var, num bits per byte, s array, name(size)=starting var array, name (num rows, num columns)=starting var
Segmented arrays, defined with the keywordsegment
, were comparable to packed arrays inPascal. The byte size and whether or not the array elements were to be treated as signed or unsigned were entirely under user control. Arbitrary text manipulation could be done by setting the byte size to the machine byte size, 6 bits on implementations usingdisplay code, 8 bits on some laterASCII andextended ASCII implementations. Note the lack of any specification of array dimensionality for segmented arrays.
A generalparameter passing mechanism was added to TUTOR early in the PLATO IV era. For example:[32]
define radius=v1,x=v2,y=v3unit varydo halfcirc(100,150,300)do halfcirc(50)*unit halfcirc(radius, x,y)circle radius, x,y,0,180draw x-radius, y;x+radius, y
Notice that theformal parameters listed in the argument list to theunit
command are simply the defined names for statically allocated global variables. The semantics of parameter passing was given as being equivalent to assignment at the time of the control transfer to the destination unit, and ifactual parameters were omitted, as in the seconddo
command above, the effect was to leave the prior values of the corresponding formal parameters unchanged.
Local variables were added to TUTOR some time around 1980. Lesson authors wishing to use local variables were required to use thelvars
command to declare the size of the buffer used for local variables, up to 128 words.[33] Having done so, a unit using local variables could begin as follows:[34]
unit someu NAME1,NAME2,NAME3(SIZE) NAME4=CONSTANT floating:NAME5,NAME6,NAME7(SIZE) integer, NUM BITS:NAME8,NAME9 integer, NUM BITS,signed:NAME10 integer:NAME11
The continuation lines of theunit
command given above are taken to be lines of an implicitdefine
command with localscope. Conventional definitions in terms of student variables such asn150
could be used in such a localdefine
, but the forms illustrated here all automatically bind names to locations in the block of memory allocated by thelvars
command. The available TUTOR documentation does not discuss how local variables are allocated.
There has been a sizable family of TUTOR-related languages, each similar to the original TUTOR language but with differences. In particular, TUTOR was a component of a system (the PLATO computer-based education system) that ran on particular CDC mainframe hardware. For efficiency, there were some hardware-specific elements in TUTOR (e.g. variables that were 60-bit words that could be used as arrays of 60 bits or as 10 six-bit characters, etc.). Also, TUTOR was designed before the advent of the windows-oriented graphical user interface (GUI).
The microTutor language was developed in the PLATO project at UIUC to permit portions of a lesson to run in terminals that contained microcomputers, with connections to TUTOR code running on the mainframe. The microTutor dialect was also the programming language of the Cluster system developed at UIUC and licensed to TDK in Japan; the Cluster system consisted of a small group of terminals attached to a minicomputer which provided storage and compilation. The Tencore Language Authoring System is a TUTOR derivative developed by Paul Tenczar for PCs and sold by Computer Teaching Corporation. cT was a derivative of TUTOR and microTutor developed at Carnegie Mellon which allowed programs to run without change in windowed GUI environments on Windows, Mac, and Unix/Linux systems.
The Pterm terminal emulator developed by Cyber1 supports the microTutor language starting with version 6.[35][36]