Personalized Array Translator

From APL Wiki
Revision as of 21:27, 10 September 2022 by Adám Brudzewsky (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")
Jump to navigation Jump to search


The Personalized Array Translator (PAT) was an early experimental system create by Dr. Herbert Hellerman of the IBM System Research Institute. It was the first implementation of Iverson Notation as a programming language, preceding even IVSYS/7090. Ken Iverson used the PAT system in his early work with students in the local secondary school, and had a profound influence on Iverson's notation, as can be seen in his book Elementary Functions An Algorithmic Treatment.

In lieu of most proper APL glyphs, PAT used letters prefixed by the @ symbol. Comparison functions were denoted by @ followed by three digits 0 or 1, indicating whether the function would return 1 or 0 if the left argument would be less than, equal to, or greater than the right argument, respectively. The language only allowed application of one function per statement, with the result being assigned. Valid statements were:[1]

Name PAT statement Modern equivalent
Add Z = X + Y <syntaxhighlight lang=apl inline>Z ← X + Y</source>
Subtract Z = X - Y <syntaxhighlight lang=apl inline>Z ← X - Y</source>
Multiply Z = X * Y <syntaxhighlight lang=apl inline>Z ← X × Y</source>
Divide Z = X @D Y <syntaxhighlight lang=apl inline>Z ← X ÷ Y</source>
And Z = X @A Y <syntaxhighlight lang=apl inline>Z ← X ∧ Y</source>
Or Z = X @O Y <syntaxhighlight lang=apl inline>Z ← X ∨ Y</source>
Constant Zero Z = X @000 Y <syntaxhighlight lang=apl inline>Z ← X(=≠=)Y</source>
Greater than Z = X @001 Y <syntaxhighlight lang=apl inline>Z ← X > Y</source>
Equal Z = X @010 Y <syntaxhighlight lang=apl inline>Z ← X = Y</source>
Greater than or equal Z = X @011 Y <syntaxhighlight lang=apl inline>Z ← X ≥ Y</source>
Less than Z = X @100 Y <syntaxhighlight lang=apl inline>Z ← X < Y</source>
Not equal Z = X @101 Y <syntaxhighlight lang=apl inline>Z ← X ≠ Y</source>
Less than or equal Z = X @110 Y <syntaxhighlight lang=apl inline>Z ← X ≤ Y</source>
Constant One Z = X @111 Y <syntaxhighlight lang=apl inline>Z ← X(===)Y</source>
"Ceiling" (Maximum) Z = X @C Y <syntaxhighlight lang=apl inline>Z ← X ⌈ Y</source>
"Floor" (Minimum) Z = X @F Y <syntaxhighlight lang=apl inline>Z ← X ⌊ Y</source>
Exponential Z = X @E Y <syntaxhighlight lang=apl inline>Z ← X * Y</source>
Assignment Z = X <syntaxhighlight lang=apl inline>Z ← X</source>
Not Z = @N X <syntaxhighlight lang=apl inline>Z ← ~ X</source>
Absolute value Z = @A X X</source>
Sine Z = @S X <syntaxhighlight lang=apl inline>Z ← 1 ○ X</source>
Cosine Z = @C X <syntaxhighlight lang=apl inline>Z ← 2 ○ X</source>
Log (base 10) Z = @L X <syntaxhighlight lang=apl inline>Z ← 10 ⍟ X</source>
Round up Z = @U X <syntaxhighlight lang=apl inline>Z ← ⌈ X</source>
Round down Z = @D X <syntaxhighlight lang=apl inline>Z ← ⌊ X</source>
Matrix Transpose Z = @T X <syntaxhighlight lang=apl inline>Z ← ⍉ X</source>
Reduction* Z = @U X <syntaxhighlight lang=apl inline>Z ← +/ X</source>
Base Z = X @B Y <syntaxhighlight lang=apl inline>Z ← X ⊥ Y</source>
Residue Z = X @W Y Y</source>
Compression Z = U / X <syntaxhighlight lang=apl inline>Z ← U / X</source>
Post Z with X controlled by U Z = U @P X
Dimension array @D X , C , R <syntaxhighlight lang=apl inline>X ← R C ⍴ X</source> or <syntaxhighlight lang=apl inline>X ⍴⍨← R C</source>
Juxtaposition Z = X , X <syntaxhighlight lang=apl inline>Z ← X , X</source>
Left rotate Z = K @L X <syntaxhighlight lang=apl inline>Z ← K ⌽ X</source>
Right rotate Z = K @R X <syntaxhighlight lang=apl inline>Z ← (-K) ⌽ X</source>
Compare and branch X @C Y, A, B, C
Update X, compare and branch @U X , Y , A , B , C
Interval Z = @I I , J <syntaxhighlight lang=apl inline>Z ← I … J</source>
Mid-selection array Z = @M I , J
Get data (cards) @G X
Type data @T X <syntaxhighlight lang=apl inline>⎕ ← X</source>
Transform floating–alphanumeric Z = @X Y <syntaxhighlight lang=apl inline>Z ← ⎕UCS Y</source> or <syntaxhighlight lang=apl inline>Z ← ⎕AF X</source>
Accept data from typewriter @A X <syntaxhighlight lang=apl inline>X ← ⍞</source>
Type heading message and proceed @H any heading
Type message, return to monitor @M any message
  • Any scalar dyadic function may replace + in a reduction statement.

References

  1. Hellerman, H. Experimental personalized array translator system. Communications of the ACM. July 1964. [[wikipedia:doi|]]: https://doi.org/10.1145/364520.364573
APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLdzaima/APLExtended Dyalog APLGNU APLKAPNARS2000Pometo
Historical A Programming LanguageA+ (A) ∙ APL#APL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyJellyfishK (Q, KDB+) ∙ Lang5NialRAD
Overviews Timeline of array languagesTimeline of influential array languagesFamily tree of array languages