Language peer sets for Mad/I: United States↑ United States/1965↑ Designed 1965 ↑ 1960s languages ↑ Third generation↑ Early Cold War↑ Genus Other IAL Coeval ↑ Numerical Scientific ↑ Other IAL Coeval↑ IAL Coeval↑ Generation of Algol 58/IAL ↑ Other IAL Coeval/1965↑ IAL Coeval/1965↑ Generation of Algol 58/IAL/1965↑ Other IAL Coeval/United States↑ IAL Coeval/United States↑ Generation of Algol 58/IAL/United States↑ Numerical Scientific ↑ Numerical Scientific/1965↑ Numerical Scientific/us ↑
Mad/I(ID:2205/mad003)
Advanced algorithmic language
alternate simple view
Country: United States
Designed 1965
Published: 1968
Genus: Other IAL Coeval
Sammet category: Numerical Scientific A later, much enhanced version of MAD, for the IBM 360. Michigan's answer to PL/I: it began as a port of Mad from the 7090, but then became the basis for the Concomp conversational programming project, and needed to be extensible to new structures and operators.
"a particular procedure-oriented algebraic language [...] intended to be useful both as a general-purpose language, and also as a convenient base or "core" language for extension into various dialects."
Unclear as to ultimate fate of the language - Bolas says (in the SIGPLAN piece) "The Mad/I compiler is currently working under MTS at Michigan, but it is not in a state suitable for distribution, Further development of Mad/I has been postponed indefinately due to lack of funds and personnel" Related languages
Let us suppose that X and Y are two arbitrary vectors in a vector space of 3 dimensions, and that we want a procedure which computes the Euclidean "distance" function between X and Y. The following program does this; the line numbers at the left margin are not part of the program.
01 'PROCEDURE' DIST.(X,Y); 02 'DCL' (X,Y) 'FIXED ARRAY'(3); 03 'INTEGER' I; 04 DIST: SUM := 0. ; 05 'FOR' I := 1, 1, I > 3 , 06 SUM := SOM + t X(I) - Y(I) ) ** 2 ; 07 'RETURN' SQRT.(SUM) 08 'END PROCEDURE' The program is a procedure block; the procedure statement begins with the statement keyword 'PROCEDURE' and ends with the end keyword 'END PROCEDURE' in line 08.
Line 01 consists of the procedure prefix followed by a semicolon. The procedure prefix specifies that identifier DISI names an entry point of the procedure, and that identifiers X and Y are the formal parameters associated with that entry point. Since the prefix is followed by a semicolon, the rest of the 'PROCEDURE' statement will be a sequence of statements terminated by the end keyword 'END PROCEDURE'.
Line 02 consists of a 'DECLARE' statement followed by a semicolon. ('DECLARE' is abbreviated as 'DCL' -- many MAD/I keywords have abbreviations ) The statement specifies that X and Y are variables of 'FIXED ARRAY' mode, and that their values are arrays of 3 components, numbered from 1 to 3. 'FIXED ARRAY' means that the arrays have fixed dimensions; they cannot be re-dimensioned at run time. Since the mode of the array components is not explicitly declared, it is assumed to be the default mode; since the block contains no declaration for defau1t mode, the pre-defined default of 'FLOATING SHORT' is used. Thus, the values of X and Y are arrays of 3 floating-point numbers. The semicolon at the end of line 02 is not part of the 'DECLARE' statement, but separates it from the next statement.
Line 03 contains a declaration statement which specifies that I is a variable of 'INTEGER' mode. This is called an "inverted" declaration statement, since it begins with an attribute keyword instead of 'DECLARE'.
Line 04 contains an "expression statement" labeled by the identifier DIST; this is the entry point of the procedure. The statement is an assignment expression, which sets the value of variable SUM to the floating-paint value 0. SUM is not explicitly declared, so it has the default mode 'FLOATING SHORT'.
Line 05 [ 'FOR' I := 1, 1, I > 3, ] has the beginning of a 'FOR' statement, which specifies an iteration. The iteration variable is I; it is initialized to 1, and is incremented by 1 until the expression I > 3 is true. Since the 'FOR' statement prefix is followed by a comma, the scope of the iteration will be a single statement.
Line 06 [ SUM := SUM + ( X(I) - Y(I) ) ** 2 ; ] contains an expression statement, which is the statement repeatedly executed. The semicolon separates the 'FOR' statement and the 'RETURN' statement. The assignment expression increments the value of SUM by the square of the difference of the Ith components of the two vectors.
Line 07 [ 'RETURN' SQRT.(SUM) ] contains a 'RETURN' statement. It evaluates the expression SQRT.(SUM) and returns the resulting value as the result of the DIST procedure. The identifier SQRT is implicitly declared to be 'ENTRY POINT' mode by its appearance as a procedure name in the procedure- call expression; since SQRT is not a label in this program, it is implicitly declared 'EXTERNAL' as well. Also, a procedure call on SQRT is assumed to produce a result of default mode. This program assumes that SQRT is an entry point of a (library) subroutine that computes the square root of a 'FLOATING SHORT' value and returns a result of the same mode. MAD/I itself does not have pre-defined procedures for the elementary functions.
Line 08 [ 'END PROCEDURE' ] contains the 'END PROCEDURE' keyword which ends the procedure (and the program). We could also have used the general-purpose end keyword 'END' instead. Notice that no semicolon is needed between the 'RETURN' statement and the end keyword. Such a semicolon would do no harm, however; it would merely introduce an empty statement between the semicolon and the end keyword.
As a second example, let us generalize the previous problem so that X and Y are vectors in a space of N dimensions, and that N is supplied as an actual parameter (argument) to the procedure. We could then re-write DIST as follows: 01 'PROC' DISI.(N,X,Y); 02 'DCL' (I,N) 'I', (X,Y) 'FA'(#) 'FS'; 03 SUM := 0; 04 'FOR' I:=1,1,I>N, 05 SUM := SUM + (X(I)-Y(I))**2; 06 'RETURN' SUM ** 0.5 'END'
Line 01 is the same as before, except that 'PROCEDURE' is abbreviated as 'PROC', and N is added as a formal parameter.
Line 02 contains a single 'DECLARE' statement, which uses abbreviations. It declares that I and N have 'INTEGER LONG' mode, and that X and Y have 'FIXED ARRAY' mode with 'FLOATING SHORT' components. The special symbol # specifies that the array dimensions are to be obtained at run time from the actual parameters supplied for X and Y.
Line 03 is similar to line 04 before, except that the label DIST has been omitted, and the constant 0 has no decimal point. Since DIST is declared in the procedure prefix as an entry point, but DIST does not appear as a label, the entry point is considered to be at the first executable statement, which is "SUM := 0". The constant 0 has 'INTEGER LONG' mode, and will be converted to 'FLOATING SHORT' mode for assignment to SUM. The MAD/I compiler reserves the "right" to perform such a conversion at compile time.
Line 04 [ 'FOR' I := 1, 1, I > N, ] is the same as before, except that the iteration proceeds until the value of I exceeds the value of parameter N. If N is less than 1, then the iteration scope is never executed.
Line 05 [ SUM := SUM + (X(I)-Y(I)) ** 2 ; ] is the same as before.
Line 06 [ 'RETURN' SUM ** 0.5 'END' ] combines the functions of lines 07 and 08 before. Instead of explicitly calling a procedure SQRT, the MAD/I exponentiation operation is used. The 'END' keyword ends the program.
As a third example, we will re-write the generalized DIST procedure to use an "embedded statement": 01 'PROC' DIST.(N,X,Y); 02 'DCL' (I,N} 'I', (X,Y) 'FA'(#) 'FS'; 03 DIST: 'RETURN' ('VALUE' SUM := 0. , 'FOR' I:=1,1,I>N, 04 SUM := SUM+(X(I)-Y(I))**2)**0~5 'END'
Lines 01 and 02 are as before. Lines 03 and 04 contain a labeled 'RETURN' statement; the expression for the return value contains a parenthesized 'VALUE' statement. The 'VALUE' statement prefix specifies the variable SUM and sets it to zero; the 'VALUE' statement scope is the 'FOR' statement, which is the same as before; the result of the statement is the value of SUM after the scope is executed. The 'VALUE' statement is enclosed in parentheses and its value raised to the 0.5 power. The 'END' keyword ends the program as before.
References:
Mills, D.L. (1968) Mills, D.L. "The Syntactic Structure of MAD/I", CONCOMP Technical Report 7, June 1968.
Abstract
Westervelt, F.H. (1968) Westervelt, F.H. SEMIANNUAL PROGRESS REPORT: 1 July to 31 December 1968 CONCOMP: Research in Conversational Use of Computers
AbstractExtract:
State of the MAD/I Compiler
Bolas (1970) Bolas, Bruce J.; "Mad/I from Michigan"
Abstract in [SIGPLAN] (1970) SIGPLAN Notices 5(11) November 1970
Springer, Allen L. (1970) Springer, Allen L. "Defaults and Block Structure in the MAD/I Language", CONCOMP Memorandum 31, July 1970.
AbstractExtract:
Defaults In Mad/IExtract:
Block Structure in Mad/IExtract:
Conclusion in [SIGPLAN] (1970) SIGPLAN Notices 5(11) November 1970