III. The Automated Resource-Sharing Facility
The resource-sharing facility described herein uses the most easily accessible communication path to MACSYMA, the TELNET connection to the logger service on socket 1. No modifications were made to MACSYMA, nor were any special programs created on the Mathlab computer. The entire task of resource sharing is performed by programs in MUDDLE. Let us say on the outset that we are not advocating this mode of usage for automated resource sharing. A resource-sharing protocol that allows convenient use of remote resources via programs is a far more reliable and efficient way, but that requires work on the part of server sites. The existing protocols and systems FTP, RJE, RSEXEC, and the Datacomputer cater to a limited subset of easily managed resources. We register here our desire for uniformity (which alas is lacking) in the current systems, and work along the direction of general-purpose resource sharing. In the absence of a general resource-sharing protocol and a MACSYMA server to go along with it at Mathlab, the TELNET connection is the best a user can do.
The resource sharing facility comprises of several independent but integrated parts. These are:
- Connecting to Mathlab, login, and invoking MACSYMA.
- Conversion of MUDDLE's prefix to MACSYMA's infix form.
- Generation of MACSYMA input.
- Interpreting MACSYMA's results including errors and comments.
- MACSYMA infix to MUDDLE prefix conversion.
- Plotting graphs for the functions.
- Allowing human intervention if desired.
- Disconnect from MACSYMA.
The user (assuming that he has loaded the necessary programs in MUDDLE) to integrate the function "3*X" has only to type:
<INTEGRATE '<* .X 3>>$
where '$' represents the ASCII character <ESC> (or <ALT-MODE>). MUDDLE will then return the following result:
</ <* 3 <^ .X 2>> 2>
Alternatively, if the user wishes to use the infix form, he can type:
<INTEGRATE "3*X">$
and the corresponding answer returned by MUDDLE would be
"3*X^2/2"
The following sequence of events takes place when integrate (or any other function that uses MACSYMA) is used. If the user isn't already communicating with a MACSYMA (the program keeps track of the connection), a connection is established to MIT-Mathlab, the user is logged in (automatically by program, using the user's identification), and a MACSYMA is initiated. A prefix to infix conversion is performed and the following input is sent to MACSYMA (using the above example):
STRING (INTEGRATE (3*X,X));
The program then interprets MACSYMA's output recognizing error responses and comments and extracts the result if no error is encountered. The result which is in infix form is then converted to the prefix form which is returned by the MUDDLE function INTEGRATE.
The INTEGRATE function takes an optional argument, the variable with respect to which the integration is be performed. The syntax for the function is:
<INTEGRATE {EXPR} ["{VAR}"]>
where EXPR is any expression of the type STRING or QUOTED FORM. The optional argument (in square brackets) VAR must be of the type STRING (enclosed by double-quotes). The syntax of other functions is:
<SIMPLIFY {EXPR}>
<DIFF {EXPR} ["{VAR}" "{TIMES}"]>
<EXPAND {EXPR} ["{MAXPOSEX}" "{MAXNEGEX}"]>
where TIMES is the number of times the EXPR is to be differentiated and MAXPOSEX and MAXNEGEX control the maximum positive and negative integer exponent to be used in expansion. The default value for VAR is "X", for times is "1", and for MAXPOSEX and MAXNEGEX is "6" each.
The user can use the result returned by MUDDLE in any of his computations, including drawing a graph. For example, typing:
<GRAPH <DIFF '<^ X. 3>> X -5 5>$
to MUDDLE will draw the graph "Y = 3*X^2" on the IMLAC or ARDS screen with values of X from -5 to +5 (assuming the user has the graphics package and the right IMLAC program loaded). The same graph would be drawn if the user typed:
<GRAPH <IPARSE <DIFF "X^3">> X -5 5>$
where IPARSE is the MUDDLE function that converts infix to prefix form. The corresponding function for prefix to infix conversion is UNIPARSE.
The details of using the MACSYMA resource sharing facility may be gathered from the annotated script of the example given in Section V of this paper.