This shows you the differences between two versions of the page.
aid [2013/07/16 17:36] howellp created |
aid [2013/07/17 11:53] (current) howellp |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | === Using AID on TWENEX.ORG === | ||
+ | |||
+ | |||
+ | == Introduction == | ||
+ | |||
+ | "AID (for Algebraic Interpretive Dialog) is a PDP-10 adaptation of language elements of JOSS". Like JOSS (JOHNNIAC Open Shop System), AID was designed to be an easy-to-learn language to help scientists and engineers with solving complex numerical problems. " | ||
+ | |||
+ | Like JOSS, AID is restricted to numeric calculations and has little provision for symbolic manipulation. In this regard, AID may be considered akin to the //bc// calculator language. Charles L. Baker (one of the creators of JOSS) wrote that "JOSS is __not__ a programming language..." | ||
+ | |||
+ | Whether AID is a ' | ||
+ | |||
+ | |||
+ | == Running AID == | ||
+ | |||
+ | AID is started on TWENEX.ORG by typing " | ||
+ | |||
+ | < | ||
+ | @AID | ||
+ | |||
+ | AID (14-MAR-69) AT YOUR SERVICE ... | ||
+ | |||
+ | * | ||
+ | </ | ||
+ | |||
+ | According to the DEC Timsharing Manual (TOPS-10), AID is terminated and control is returned to Monitor [EXEC] level by sending a CTRL-C. This, however, throws an error on TWENEX.ORG---which appears harmless. | ||
+ | |||
+ | < | ||
+ | *↑C | ||
+ | ?PA1050: Illegal instruction 6,,0 at user 0 | ||
+ | @ | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Interacting with AID == | ||
+ | |||
+ | A user interacts with AID by typing single-line commands called " | ||
+ | |||
+ | A direct step is interpreted and executed by AID immediately following a carriage return. | ||
+ | |||
+ | < | ||
+ | *Type 2+2. | ||
+ | 2+2 = 4 | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | An indirect step is entered by preceding the step with a numeric label containing both an integer and decimal portion (e.g., 1.1, 2.53). Preceding a step with a numeric label signals AID that the step is to be stored for later execution. | ||
+ | |||
+ | Steps can be grouped into " | ||
+ | |||
+ | < | ||
+ | *1.1 Type "X VALUES" | ||
+ | *1.2 Type x. | ||
+ | *1.3 Type x*2, x/2, x^2. | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | Individual steps or parts are executed with the DO command. Only the step or part specified by DO is executed; AID does not continue to other steps or parts unless specifically instructed to. Here we will use the SET command directly to assign the value of 3 to x, and the DO command to execute the indirect steps of part 1. | ||
+ | |||
+ | < | ||
+ | *1.1 Type "X VALUES" | ||
+ | *1.2 Type x. | ||
+ | *1.3 Type x*2, x/2, x^2. | ||
+ | *Set x = 3. | ||
+ | *Do part 1. | ||
+ | X VALUES | ||
+ | x = 3 | ||
+ | x*2 = 6 | ||
+ | x/2 = 1.5 | ||
+ | x^2 = 9 | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Variables == | ||
+ | |||
+ | The SET command in the previous example assigned a value of 3 to X which is evaluated only once. In contrast, had the LET command been used, X would have been re-evaluated each time it is referenced (see Appendix 3). In AID, " | ||
+ | |||
+ | < | ||
+ | *Set b = 2.0. | ||
+ | *Set c(1,2) = 6. | ||
+ | *Set d(-4,0,8) = 3.14 | ||
+ | *Type b + c(1,2) + d(-4,0,8). | ||
+ | b + c(1,2) + d(-4,0,8) = 11.14 | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Propositions == | ||
+ | |||
+ | Propositions in AID are Boolean expressions composed of arithmetic or logical statements using: | ||
+ | |||
+ | * Relational operators | ||
+ | * = (equal) | ||
+ | * # (not equal) | ||
+ | * > (greater than) | ||
+ | * < (less than) | ||
+ | * >= (greater than or equal to) | ||
+ | * < | ||
+ | * Negation | ||
+ | * not | ||
+ | * Logical operators | ||
+ | * and | ||
+ | * or | ||
+ | |||
+ | A proposition has either of two possible states: //true// or //false//. For example | ||
+ | |||
+ | < | ||
+ | *Set x = true. | ||
+ | *Set y = false. | ||
+ | *Let z = (x) and (y) or (x) and (100 > sqrt(959)). | ||
+ | *Type z. | ||
+ | z = true | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | Commands can be made conditional by appending IF clauses and propositions; | ||
+ | |||
+ | < | ||
+ | *1.1 Set b = 50 if a > 100. | ||
+ | *1.2 To part 2 if c <= 0. | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | |||
+ | == User-defined Functions == | ||
+ | |||
+ | User-defined functions take the form f(a, | ||
+ | |||
+ | * f is the function identifier, | ||
+ | * (a,b,c,...) are dummy arguments (up to ten), | ||
+ | * expression is the arithmetic expression representing the user function. | ||
+ | |||
+ | While the number of dummy arguments is limited to ten, you can also pass subscripted identifiers to user-defined functions. | ||
+ | |||
+ | User-defined functions can also contain conditional expressions. A conditional expression allows a function to return different values depending upon which of a number of conditions is true. It is composed of a series of clauses separated by semicolons, with each clause made up of a proposition followed by a colon followed by an expression. The last proposition may be omitted if the last expression is to be the default for all cases that do not satisfy any of the previous propositions. The entire expression must be enclosed by parentheses or brackets. For instance: | ||
+ | |||
+ | < | ||
+ | *Let f(x) = (x<0: 0; 0< | ||
+ | *Type f(-3), f(0.25), f(0.5), f(0.75), f(3). | ||
+ | f(-3) = 0 | ||
+ | | ||
+ | f(0.5) = .25 | ||
+ | | ||
+ | f(3) = 1 | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Formatting Output == | ||
+ | |||
+ | AID provides for greater control over output format with " | ||
+ | |||
+ | < | ||
+ | *Delete all. | ||
+ | *1.1 Type "X VALUES" | ||
+ | *1.2 Type form 1. | ||
+ | *1.3 Type x, x*2, x/2, x^2 in form 2. | ||
+ | Form 1: | ||
+ | * X X*2 X/2 X^2 | ||
+ | *Form 2: | ||
+ | * ___.__ | ||
+ | *Set x = 3. | ||
+ | *Do part 1. | ||
+ | X VALUES | ||
+ | X X*2 X/2 X^2 | ||
+ | | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | Combined with iterative clauses, using forms is a convenient way to make tables. Let's take the previous example a bit further by asking the user for a range of values for x (with the DEMAND command) and making a table with a row for each value of x. (See Appendix 2 for more information on iterative clauses.) | ||
+ | |||
+ | < | ||
+ | *Delete all. | ||
+ | * | ||
+ | *1.1 Demand m as "Lower limit" | ||
+ | *1.2 Demand n as "Upper limit" | ||
+ | *1.3 Do part 2. | ||
+ | * | ||
+ | *2.1 Type "X VALUES" | ||
+ | *2.2 Type form 1. | ||
+ | *2.3 Do step 2.5 for I = m(1)n. | ||
+ | *2.4 Done. | ||
+ | *2.5 Type I, f(I), g(I), h(I) in form 2. | ||
+ | * | ||
+ | *Form 1: | ||
+ | * X X*2 X/2 X^2 | ||
+ | *Form 2: | ||
+ | * ___.__ | ||
+ | * | ||
+ | *Let f(x) = x*2. | ||
+ | *Let g(x) = x/2. | ||
+ | *Let h(x) = x^2. | ||
+ | * | ||
+ | *Do part 1. | ||
+ | Lower limit = *-5 | ||
+ | Upper limit = *5 | ||
+ | X VALUES | ||
+ | X X*2 X/2 X^2 | ||
+ | -5.00 -10.00 | ||
+ | -4.00 | ||
+ | -3.00 | ||
+ | -2.00 | ||
+ | -1.00 | ||
+ | .00 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | |||
+ | == File Operations == | ||
+ | |||
+ | File I/O in AID appears to be limited to the storage and retrieval of AID items in specially formatted files akin to a workspace file. | ||
+ | |||
+ | The four commands most used for file I/O in AID are: | ||
+ | |||
+ | * USE: makes an external storage file available for use. | ||
+ | * FILE: stores an item in the external storage file currently in use. | ||
+ | * RECALL: reads an item previously stored by a FILE command. | ||
+ | * DISCARD: deletes an item from the external storage file currently in use. | ||
+ | |||
+ | These commands are described in Appendix 3. | ||
+ | |||
+ | In what seems to be an attempt to be faithful to its JOSS roots, AID file-names are restricted to positive integers (ranging from 0 to 2750). However, on TOPS-20, AID will prefix the file-name on the physical device with " | ||
+ | |||
+ | Let's create a file, and save the parts, formulas, and forms from the previous example. | ||
+ | |||
+ | < | ||
+ | *Use file 100. | ||
+ | Roger. | ||
+ | *File all parts as item 1. | ||
+ | Done. | ||
+ | *File all formulas as item 2. | ||
+ | Done. | ||
+ | *File all forms as item 3. | ||
+ | Done. | ||
+ | * | ||
+ | </ | ||
+ | |||
+ | To retrieve items, you use the USE and RECALL commands. Here we will USE file 100, TYPE its ITEM-LIST, and RECALL the three previously saved items. To make sure we got everything, we will TYPE ALL that is in immediate storage. | ||
+ | |||
+ | < | ||
+ | *Delete all. | ||
+ | *Use file 100. | ||
+ | Roger. | ||
+ | *Type item-list. | ||
+ | ITEM-LIST | ||
+ | ITEM DATE | ||
+ | | ||
+ | | ||
+ | | ||
+ | *Recall item 1. | ||
+ | Done. | ||
+ | *Recall item 2. | ||
+ | Done. | ||
+ | *Recall item 3. | ||
+ | Done. | ||
+ | *Type all. | ||
+ | |||
+ | 1.1 Demand m as "Lower limit" | ||
+ | 1.2 Demand n as "Upper limit" | ||
+ | 1.3 Do part 2. | ||
+ | |||
+ | 2.1 Type "X VALUES" | ||
+ | 2.2 Type form 1. | ||
+ | 2.3 Do step 2.5 for I = m(1)n. | ||
+ | 2.4 Done. | ||
+ | 2.5 Type I, f(I), g(I), h(I) in form 2. | ||
+ | |||
+ | Form 1: | ||
+ | X X*2 X/2 X^2 | ||
+ | |||
+ | Form 2: | ||
+ | | ||
+ | |||
+ | f(x): x*2 | ||
+ | g(x): x/2 | ||
+ | h(x): x^2 | ||
+ | |||
+ | * | ||
+ | </ | ||
+ | |||
+ | (Hmmm, it looks like AID has a Y2K issue.) | ||
+ | |||
+ | It does not appear that AID reads from or writes to plain-text files---at least not directly. For smaller amounts of text, copy-and-paste is one option to transfer text to/from AID. Session logging is another option for saving output from AID. On TOPS-20, you can use batch processing to run AID and redirect I/O from and to other files (see" | ||
+ | |||
+ | == Bibliography & Resources == | ||
+ | |||
+ | |||
+ | Baker, C. L. 1966. JOSS: Introduction to a Helpful Assistant. RAND Corporation. Santa Monica, California.\\ | ||
+ | http:// | ||
+ | |||
+ | Gimple, E. P. 1967. JOSS: Problem Solving For Engineers. RAND Corporation. Santa Monica, California.\\ | ||
+ | http:// | ||
+ | |||
+ | Marks, S. L. and G. W. Armerding. 1967. The JOSS Primer. RAND Corporation. Santa Monica, California.\\ | ||
+ | http:// | ||
+ | |||
+ | PDP-10 timesharing handbook. Book 4: Conversational Programming with AID. Digital Equipment Corporation. Maynard, Mass. [c1970] \\ | ||
+ | http:// | ||
+ | |||
+ | TOPS-10/ | ||
+ | http:// | ||
+ | |||
+ | -------- | ||
+ | |||
+ | == Appendix 1. AID Character Set == | ||
+ | |||
+ | |||
+ | ^ Standard Math Symbol ^ AID Symbol ^ JOSS Symbol ^ | ||
+ | |A-Z |A-Z |A-Z | | ||
+ | |a-z |a-z |a-z | | ||
+ | |0,1-9 |0,1-9 |0,1-9 | | ||
+ | | Operators | ||
+ | |%%| |%% (absolute) |! ! |%%| |%% | | ||
+ | |[ ] (brackets) |[ ]|[ ]| | ||
+ | |( ) (parentheses) |( ) |( ) | | ||
+ | |x< | ||
+ | |/ (divide) |/ |/ | | ||
+ | |⋅ (multiplication) |* |⋅ | | ||
+ | |+ (addition) |+ |+ | | ||
+ | |- (subtraction) |- |- | | ||
+ | |Boolean Expressions|| | ||
+ | |= (equal) |= |=| | ||
+ | |≠ |# |≠ | | ||
+ | |≤ |< | ||
+ | |≥ |>= (2 characters) |≥ | | ||
+ | | Misc. ||| | ||
+ | |(null item) |← or _ (underscore) |_ (underscore) | | ||
+ | |(current line number) |$ |$ | | ||
+ | |(cancel entire line) |* |* | | ||
+ | |||
+ | |||
+ | -------- | ||
+ | |||
+ | == Appendix 2. AID Functions == | ||
+ | |||
+ | **arg(x, | ||
+ | |||
+ | The ARGUMENT function takes two arguments (x,y) and computes the angle between the +x axis of the x,y plane and the line joining point 0,0 and point x,y. | ||
+ | |||
+ | The result is in radians. | ||
+ | |||
+ | < | ||
+ | <pre> | ||
+ | +Y | ||
+ | | | ||
+ | |-------------. X,Y | ||
+ | | . : | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | . )arg(x,y) : | ||
+ | |________________ +X | ||
+ | 0,0 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The value of arg(0,0) is 0. The range of arg is 0 through 2pi or -pi through pi. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **cos(x)** | ||
+ | |||
+ | The COSINE function requires one argument, assumed to be in radians. | ||
+ | |||
+ | < | ||
+ | |||
+ | --- | ||
+ | |||
+ | **dp(x)** | ||
+ | |||
+ | The DIGIT PART function. | ||
+ | |||
+ | dp(13456.5432) = 1.34565432 | ||
+ | |||
+ | --- | ||
+ | |||
+ | **exp(x)** | ||
+ | |||
+ | The EXPONENTIAL function: | ||
+ | |||
+ | e^x, where e is Euler' | ||
+ | |||
+ | The argument (x) must fulfill the requirements that | ||
+ | e^x < 10^100 (i.e., must be less than 230.25851). | ||
+ | |||
+ | If e^x < 10^-99, the result is 0. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **first(i=range...: | ||
+ | |||
+ | The FIRST function requires two arguments: | ||
+ | |||
+ | (a) an iterative clause (see note A2.1 below) and\\ | ||
+ | (b) a proposition containing i as an index. | ||
+ | |||
+ | The result is the first value of index i to satisfy the proposition. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **fp(x)** | ||
+ | |||
+ | The FRACTION PART function. | ||
+ | |||
+ | E.g., fp(13456.5432) = .5432 | ||
+ | |||
+ | --- | ||
+ | |||
+ | **ip(x)** | ||
+ | |||
+ | The INTEGER PART function. | ||
+ | |||
+ | E.g., ip(13456.5432) = 13456 | ||
+ | |||
+ | --- | ||
+ | |||
+ | **log(x)** | ||
+ | |||
+ | The NATURAL LOG function. | ||
+ | |||
+ | The argument (x) must be greater than 0. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **max(i=range...: | ||
+ | |||
+ | The MAXIMUM function requires two arguments: | ||
+ | |||
+ | (a) an iterative clause (see note A2.1 below) and\\ | ||
+ | (b) a proposition containing a function of i. | ||
+ | |||
+ | The expression is computed iteratively for each value of i, and the result (largest value) is typed out. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **min(i=range...: | ||
+ | |||
+ | The MINIMUM function requires two arguments: | ||
+ | |||
+ | (a) an iterative clause (see note A2.1 below) and\\ | ||
+ | (b) a proposition containing a function of i. | ||
+ | |||
+ | The expression is computed iteratively for each value of i, and the result (smallest value) is typed out. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **prod(i=range...: | ||
+ | |||
+ | The PRODUCT function requires two arguments: | ||
+ | |||
+ | (a) an iterative clause (see note A2.1 below) and\\ | ||
+ | (b) a proposition containing a function of i. | ||
+ | |||
+ | The expression is computed iteratively for each value of i, and the result (product of all the iterations) is typed out. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **sgn(x)** | ||
+ | |||
+ | The SIGNUM function. | ||
+ | |||
+ | The value of a signum function of an argument greater than zero is +1, of an argument equal to zero is 0, and of an argument less than zero is -1. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **sin(X)** | ||
+ | |||
+ | The SINE function requires one argument, assumed to be in radians. | ||
+ | |||
+ | < | ||
+ | |||
+ | --- | ||
+ | |||
+ | **sqrt(x)** | ||
+ | |||
+ | The SQUARE ROOT function. The argument (x) must be greater than or equal to zero. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **sum(i=range...: | ||
+ | |||
+ | The SUM function requires two arguments: | ||
+ | |||
+ | (a) an iterative clause (see note A2.1 below) and\\ | ||
+ | (b) a proposition containing a function of i. | ||
+ | |||
+ | The expression is computed iteratively for each value of i, and the result (sum of all the iterations) is typed out. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **tv(proposition)** | ||
+ | |||
+ | The TRUTH VALUE function requires one argument, a proposition, | ||
+ | |||
+ | --- | ||
+ | |||
+ | **xp(x)** | ||
+ | |||
+ | The EXPONENT PART function. | ||
+ | |||
+ | E.g., xp(13456.5432) = 4\\ | ||
+ | (i.e., 13456.5432 = 1.34565432*10^4) | ||
+ | |||
+ | --- | ||
+ | |||
+ | |||
+ | //Note A2.1.// Iterative clauses (ranges) are used with the DO command and with the functions FIRST, MAX, MIN, PROD, and SUM. An iterative clause specifies a range of values to be acted upon by the DO command or function, and may be in the form of (1) a series of values, (2) an incrementation, | ||
+ | |||
+ | 1. //Series of values:// | ||
+ | |||
+ | A series of values lists the individual values that make up the range; such as,\\ | ||
+ | | ||
+ | |||
+ | 2. // | ||
+ | |||
+ | The range of values for a variable can also be expressed as a first value, an incremental value, and an ending value. The variable values range from the first value upward in steps of the specified increment value until the ending value is reached. The ending value is always taken as the last value of the range, even though the incremental steps may not hit it exactly. The general form of an incremental iterative clause is: | ||
+ | |||
+ | x = first-value(increment)ending-value | ||
+ | |||
+ | For example: | ||
+ | |||
+ | < | ||
+ | *Do step 2.3 for A = 1(2)12. | ||
+ | *Type sum(A = -50(B)C). | ||
+ | </ | ||
+ | |||
+ | 3. // | ||
+ | |||
+ | A range can be expressed as a combination of value series and increments. | ||
+ | |||
+ | For example: | ||
+ | |||
+ | < | ||
+ | *Do part 3 for W = 20(Y)50(5)500, | ||
+ | </ | ||
+ | |||
+ | (Part 3 will be performed for all values of W, beginning with 20, continuing in increments of Y though 50, then continuing in increments of 50 through 500, and then from 1000 in increments of 100 through Z.) | ||
+ | |||
+ | < | ||
+ | *Type sum(W = A(3)B, C, 800(D)1500). | ||
+ | </ | ||
+ | |||
+ | (The SUM function will be applied to all values of W, beginning with A and continuing in increments of 30 through B, then C, followed by 800 through 1500 in increments of D.) | ||
+ | |||
+ | --- | ||
+ | -------- | ||
+ | |||
+ | == Appendix 3. AID Command Summary == | ||
+ | |||
+ | **CANCEL:** Cancels a currently stopped process when the user does not desire to resume execution. | ||
+ | |||
+ | Type: D,O. | ||
+ | |||
+ | |||
+ | **(CANCEL): | ||
+ | |||
+ | Type: D,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **DELETE:** Erases the specified item from immediate storage and frees the space by it for some other use. Several DELETE commands can be combined into one. | ||
+ | |||
+ | Format: DELETE { | ||
+ | * L | ||
+ | * S | ||
+ | * S(m,n) | ||
+ | * form m | ||
+ | * step m.n | ||
+ | * part m | ||
+ | * formula f | ||
+ | * all steps | ||
+ | * all parts | ||
+ | * all formulas | ||
+ | * all forms | ||
+ | * all values | ||
+ | * all | ||
+ | }. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **DEMAND:** Causes AID to type out a message requesting the user to supply a value for the specified item. Only one variable can be specified in each DEMAND | ||
+ | |||
+ | command. | ||
+ | |||
+ | Format: DEMAND { | ||
+ | * L | ||
+ | * S(m,n) | ||
+ | * L as "any text" | ||
+ | * S(m,n) as "any text" | ||
+ | }. | ||
+ | |||
+ | Type: I,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **DISCARD ITEM m (code):** Delete item #m from the external storage file currently in use. (Code) is optional. | ||
+ | |||
+ | Type: F. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **DO:** Executes an indirect step or part. If the DO command is a direct step, control returns to the user at the completion of the DO; if an indirect step, control returns to the step following the DO. | ||
+ | |||
+ | Format: DO { | ||
+ | * step m.n | ||
+ | * step m.n, p times | ||
+ | * step m.n for L=range | ||
+ | * part m | ||
+ | * part m, p times | ||
+ | * part m for L=range | ||
+ | }. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | **(DO ...):** Initiates a new execution without canceling the currently stopped process. | ||
+ | |||
+ | Format: (same as above). | ||
+ | |||
+ | Type: (same as above). | ||
+ | |||
+ | --- | ||
+ | |||
+ | **DONE:** Skips execution of the remaining steps of a part during the current iteration. | ||
+ | |||
+ | Type: I,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **FILE:** Stores the specified item in the external storage file currently open. Immediate storage in not affected in any way. (code) is optional. (NB. use of the code option may cause a run-time error on the version of AID in the Panda Distribution.) | ||
+ | |||
+ | Format: FILE { | ||
+ | * L | ||
+ | * S | ||
+ | * S(m,n) | ||
+ | * from m | ||
+ | * step m.n | ||
+ | * part m | ||
+ | * formula f | ||
+ | * all steps | ||
+ | * all parts | ||
+ | * all formulas | ||
+ | * all forms | ||
+ | * all values | ||
+ | * all | ||
+ | } AS ITEM n (code)\\ | ||
+ | where //n// is an item number in the range of 1 through 25. | ||
+ | |||
+ | Type: F. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **FORM:** Defines a format to be used in presenting typeouts for purposes of readability. The FORM command is followed by a form number, a colon, a new-line, and the format specification. | ||
+ | |||
+ | Fixed point notation (up to nine digit positions plus the decimal point) is specified by a series of 'null item' characters (← or underscore), | ||
+ | |||
+ | Scientific notation (minimum of seven positions and maximum of fourteen) are specified by a series of decimal points; e.g., < | ||
+ | |||
+ | Any text to be included in the line; __not__ enclosed in quotation marks unless they are are part of the text; e.g., The result is < | ||
+ | |||
+ | Format:\\ | ||
+ | FORM m:\\ | ||
+ | < | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **GO:** Continues execution of a currently stopped process; opposite of the CANCEL command. | ||
+ | |||
+ | Type: D,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **IF Clause:** Can be appended to any command (except the abbreviated SET command) to make the command conditional; | ||
+ | |||
+ | Format: Verb....IF proposition. | ||
+ | |||
+ | Type: M. [sic] | ||
+ | |||
+ | --- | ||
+ | |||
+ | **LET:** Defines arithmetic formulas, Boolean expressions (propositions), | ||
+ | |||
+ | Format: LET { | ||
+ | * L = m | ||
+ | * L = formula | ||
+ | * F(L) = m | ||
+ | * F(L) = proposition | ||
+ | }. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **LET S be sparse:** Set undefined array elements to zero. | ||
+ | |||
+ | Type: S. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **LINE:** Advances the Teletype paper form one line. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **PAGE:** Advances the Teletype paper form to the top of the next page. | ||
+ | |||
+ | TYPE: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **QUIT:** Skips execution of the remaining steps of a part __and__ satisfies the DO command for that part by canceling any further iterations. Usually given conditionally. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **RECALL ITEM m (code):** Reads an item, previously stored by a FILE command, from the currently open external storage file into immediate storage. (code) is optional and is for documentation only. (NB. use of the code option may cause a run-time error on the version of AID in the Panda Distribution.) | ||
+ | |||
+ | Format: RECALL ITEM m (code)\\ | ||
+ | where //m// is an item number in the range of 1 through 25. | ||
+ | |||
+ | Type: F. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **RESET TIMER:** Resets TIMER to zero. (TIMER is a counter used by AID to keep track of the amount of central processor time spent by the user in running AID. The cumulative running time can be obtained at any point by typing the request Type timer.) | ||
+ | |||
+ | Type: S. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **SET:** Defines an identifier as equivalent to a __fixed__ value, which is calculated once and then used whenever the identifier appears. A short form of the SET command, where the word SET is omitted, can be used if the command is __direct__. | ||
+ | |||
+ | Format: SET { | ||
+ | * L=m | ||
+ | * L=proposition | ||
+ | * s(m,n)=m | ||
+ | * S(m.n)=proposition | ||
+ | }. | ||
+ | |||
+ | Type: O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **STOP:** Temporarily halts the current process at the point where the STOP command appears and returns control to the user. The stopped process can be resumed by typing GO. | ||
+ | |||
+ | Type: I,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **TO:** Discontinues the sequential execution of the part currently being executed and transfers control to another step or part; when a new part is finished, the direct command which initiated the execution is satisfied. | ||
+ | |||
+ | Format: TO { | ||
+ | * part m | ||
+ | * step m.n | ||
+ | }. | ||
+ | |||
+ | Type: I,O. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **TYPE:** Types out the specified information on the user's console. Several individual TYPE commands my be combined into one (except for TYPE "any text" or TYPE ITEM-LIST). | ||
+ | |||
+ | The Command //TYPE ... in form n// causes the listed items to be typed out in the format specified by form n. n can be a numeric value (for example, form 3) or it can be a numeric formula (for example, form(2*x-y)). | ||
+ | |||
+ | Format: TYPE { | ||
+ | * m | ||
+ | * S | ||
+ | * S(m,n) | ||
+ | * proposition | ||
+ | * "any text" | ||
+ | * null-item | ||
+ | * form m | ||
+ | * step m.n | ||
+ | * part m | ||
+ | * formula f | ||
+ | * F(x) | ||
+ | * F(proposition) | ||
+ | * all steps | ||
+ | * all parts | ||
+ | * all formulas | ||
+ | * all forms | ||
+ | * all values | ||
+ | * all | ||
+ | * time | ||
+ | * timer | ||
+ | * size | ||
+ | * item-list | ||
+ | }. | ||
+ | |||
+ | Type: O,S(time, timer, size), | ||
+ | |||
+ | --- | ||
+ | |||
+ | **USE:** Makes an external storage file available for use. The external file thus addressed remains open for use (by DISCARD, FILE, RECALL, and TYPE ITEM-LIST commands) until another USE command is given or the AID program is terminated. | ||
+ | |||
+ | The USE command may have some idiosyncrasies on TOPS-20, especially with file names and JOSS compatibility. | ||
+ | |||
+ | FORMAT: USE FILE filename (device).\\ | ||
+ | where // | ||
+ | |||
+ | Type: F. | ||
+ | |||
+ | --- | ||
+ | |||
+ | **Key:** | ||
+ | |||
+ | __Command Format Symbology__\\ | ||
+ | L = letter.\\ | ||
+ | S = subscripted letter.\\ | ||
+ | m, n, p = numeric values.\\ | ||
+ | f = formula.\\ | ||
+ | F = function.\\ | ||
+ | range = an iterative sequence or series of values. | ||
+ | |||
+ | __Type Symbology__\\ | ||
+ | D = Can be given directly only.\\ | ||
+ | I = Can be given indirectly only.\\ | ||
+ | O = Operational command.\\ | ||
+ | F = File command.\\ | ||
+ | S = Special command. | ||
+ | |||
+ | -------- | ||
+ | |||
+ | == Appendix 4. Running AID under Batch == | ||
+ | |||
+ | In this brief example, we will see how to submit a batch job under TOPS-20 to run AID, provide user input, and save the results in a log file. This appendix provides only an elementary example. Interested readers should consult relevant TOPS-20 documentation, | ||
+ | |||
+ | Before submitting a batch job, we need to create a control file. Our simple control file will tell the batch system which program to run (in this case, AID), as well as provide input to that program as if we had typed it at the console. There are a few special characters that we will use to tell the batch processor which lines of our control file are intended for EXEC and which are intended for user input to AID (or any non-EXEC program), as well as to indicate control characters and comments. These are: | ||
+ | |||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | |||
+ | First, create a control file (e.g., // | ||
+ | |||
+ | < | ||
+ | ; Run AID. | ||
+ | @R AID | ||
+ | ; Load our previously saved program parts and forms. | ||
+ | *Use file 100. | ||
+ | *Recall item 1. | ||
+ | *Recall item 2. | ||
+ | ; Run the program. | ||
+ | *Do part 1. | ||
+ | ; Supply user input to the program. | ||
+ | *-10 | ||
+ | *10 | ||
+ | ; Terminate AID with a CTRL-C. | ||
+ | *^c | ||
+ | </ | ||
+ | |||
+ | Next, //submit// the job; e.g., | ||
+ | |||
+ | < | ||
+ | @submit my_job.ctl | ||
+ | </ | ||
+ | |||
+ | Wait for TOPS-20 to tell you that your job is ready. | ||
+ | |||
+ | < | ||
+ | [Batch job MY_JOB queued, request #32, limit 0:05:00] | ||
+ | @ | ||
+ | [From SYSTEM: Job MY_JOB request #32 finished executing at 16:51:10] | ||
+ | </ | ||
+ | |||
+ | |||
+ | Review the log file. Your output, if any, is there. (If you were expecting output, but didn't receive any, there was likely an error. Review the log file for clues.) | ||
+ | |||
+ | < | ||
+ | @type my_job.log | ||
+ | |||
+ | 15-Jul-2013 16:51:09 | ||
+ | |||
+ | BATCON Version | ||
+ | |||
+ | Job MY_JOB Req #32 for GLOVAL in Stream 0 | ||
+ | |||
+ | OUTPUT: | ||
+ | UNIQUE: | ||
+ | RESTART: No | ||
+ | ACCOUNT: | ||
+ | |||
+ | Input from => TOPS20:< | ||
+ | Output to => TOPS20:< | ||
+ | |||
+ | |||
+ | |||
+ | 16:51:09 MONTR Panda Distribution, | ||
+ | 16:51:09 MONTR Job 10 on TTY22 15-Jul-2013 16:51:09 | ||
+ | 16:51:09 MONTR Last interactive login 15-Jul-2013 13:20:47 | ||
+ | 16:51:09 MONTR Last non-interactive login 15-Jul-2013 16:47:50 | ||
+ | 16:51:09 MONTR @ | ||
+ | 16:51:09 MONTR [Connected to TOPS20:< | ||
+ | ; Run AID. | ||
+ | 16:51:09 MONTR @R AID | ||
+ | 16:51:09 USER | ||
+ | 16:51:09 USER AID (14-MAR-69) AT YOUR SERVICE ... | ||
+ | 16:51:09 USER | ||
+ | 16:51:09 USER * | ||
+ | ; Load our previously saved program parts, formulas, and forms. | ||
+ | 16:51:09 USER *Use file 100. | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER Done. | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER Done. | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER Done. | ||
+ | 16:51:10 USER * | ||
+ | ; Run the program. | ||
+ | 16:51:10 USER *Do part 1. | ||
+ | 16:51:10 USER Lower limit = * | ||
+ | ; Supply user input to the program. | ||
+ | 16:51:10 USER *-10 | ||
+ | 16:51:10 USER Upper limit = **10 | ||
+ | 16:51:10 USER X VALUES | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER -10.00 | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER 1.00 2.00 .500 1.00 | ||
+ | 16:51:10 USER 2.00 4.00 | ||
+ | 16:51:10 USER 3.00 6.00 | ||
+ | 16:51:10 USER 4.00 8.00 | ||
+ | 16:51:10 USER 5.00 | ||
+ | 16:51:10 USER 6.00 | ||
+ | 16:51:10 USER 7.00 | ||
+ | 16:51:10 USER 8.00 | ||
+ | 16:51:10 USER 9.00 | ||
+ | 16:51:10 USER | ||
+ | 16:51:10 USER * | ||
+ | ; Terminate AID with a CTRL-C. | ||
+ | 16:51:10 USER *^C | ||
+ | 16:51:10 USER ^C | ||
+ | 16:51:10 MONTR @ | ||
+ | 16:51:10 MONTR @ | ||
+ | 16:51:10 MONTR Killed by OPERATOR, Detached | ||
+ | 16:51:10 MONTR Killed Job 10, User GLOVAL, TTY22, at 15-Jul-2013 16:51:10 | ||
+ | 16:51:10 MONTR Used 0:00:00 in 0:00:00 | ||
+ | @ | ||
+ | </ | ||
+ | |||