home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
teach.zip
/
INDEX.ATF
next >
Wrap
Text File
|
1997-09-11
|
67KB
|
821 lines
XNÉIO 0 1 °
XNÉCT 0 9.999999999999999E²14 °
XCÉFC 1 6 .,*0_² °
XNÉRL 0 16807 °
XCÉPR 1 1 °
XCÉLX 1 2 lx °
*(1997 8 31 12 27 18 452) °
FADD ÉFX 'V ADD W;B' 'Σ Add row W to index, insert behind V=index[;1]' °
'╕(0⌠ÉNC ''V'')/L0 ╪ index╜index,[1]W ╪ ╕0' °
X 'L0:B╜Φ4,²1+index[;1]∞V+1' 'index╜(B╞index),[1]W,[1](2╞╞B)╟index' °
XNB 1 3 0 0 0 °
*(1997 9 8 13 33 16 384) °
FCODES ÉFX 'CODES' 'Σ Codes used in column 3 of array index' °
'''Array index has 4 columns. The first column has integers giving''' °
'''the workspace number. For TEACHn the value would be n. The second'' °
' °
'''column may have an integer (for function TEACHn the value is n),''' °
'''or the name of a function if other than TEACHn.'',r' °
'''Column 3 contains the APL2 symbol discussed in lesson of col. 1''' °
'''and in function of col. 2. Letter codes indicate the following''' °
'''subjects:'',r' ''' CODE CONTENTS'',r' °
''' A General APL2 subject''' °
''' G Ground rules and general non-APL subjects''' °
''' H Historic notes''' °
''' S System commands''' °
''' U User defined functions or expressions'',r' °
X '''Column 4 contains name of APL primitives or subject matter''' °
*(1997 9 9 12 43 9 396) °
FCONTENTS ÉFX 'CONTENTS;T;A;B' 'Σ Table of contents' °
'''Functions marked with * are available in all subsequent lessons'',r °
' 'æ╜''Enter the lesson numbers (from 0 through 22): '' ╪ T╜É' °
'T╜(TεA╜0,∞22)/T ╪ ╕(0=µT)/0' °
'B╜L0,L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15,L16,L17,L18,L °
19,L20,L21,L22' 'L:╕(A=╞T)/B' °
'L0:''LESSON 0 Installing APL2 and using the Session Manager °
''' ''' TEACH1 Installing APL2OS2''' °
''' TEACH2 Defining new libraries''' °
''' TEACH3 Associated Windows''' °
''' TEACH4 SESSION EDITOR''' °
''' TEACH5 Opening an APL2 object''' °
''' TEACH6 Signals pull down menu''' °
''' TEACH7 Options pull down menu''' °
''' TEACH8 Keyboards''' °
''' TEACH9 Setting up fonts''' °
''' TEACH10 The color palette''' °
''' TEACH11 Changing colors of the fields''' °
''' TEACH12 Setting up F-keys''' °
''' TEACH13 The Windows and Help pull down menus''' '╕LX' °
'L1:''LESSON 1 Simple arithmetic expressions''' °
''' TEACH1 Explain keyboard, initialize lesson''' °
''' TEACH2 Immediate execution mode''' °
''' TEACH3 Describe APL2 data types''' °
''' TEACH4 Simple arithmetic''' °
''' TEACH5 Discuss negative numbers''' °
''' TEACH6 Introduction to character manipulation''' °
''' TEACH7 Explain the assignement arrow''' °
''' TEACH8 Introduce SHAPE and RESHAPE''' °
''' TEACH9 Describe INDEX GENERATOR and INDEX OF''' °
''' GAUSS A historical footnote on the early life of Gauss °
''' °
''' TEACHER To explain this tutorial to those planning to te °
ach APL2''' '╕LX' °
'L2:''LESSON 2 Reduction, errors and parentheses''' °
''' TEACH1 Introduction to lesson 2''' °
''' TEACH2 Introduce the reduction operator''' °
''' TEACH3 Zeros and nulls''' °
''' TEACH4 IBM function DISPLAY''' °
''' TEACH5 Error messages''' °
''' TEACH6 Average of a vector of numbers''' °
''' TEACH7 Summary''' ''' TEACH8 Roll and deal''' °
''' RECIPROCAL Avoiding error message with ÷ when vector contain °
s zeros''' °
''' RULES Explain purpose in having RULES in this tutorial' °
'' ''' RULE n Additional comments on Rule n''' '╕LX' °
'L3:''LESSON 3 Primitive math functions''' °
''' TEACH1 Concept of WORKSPACE''' °
''' TEACH2 The power function''' °
''' TEACH3 Maximum, minimum, floor, ceiling''' °
''' TEACH4 Algorithm''' °
''' TEACH5 Simple direct definition''' °
''' TEACH6 Conditional direct definition''' °
''' ALGORITHM Origin of word''' °
''' DECIMAL Origin of decimal point''' °
''' DIRECT Recent developments in APL theory by Ken Iverson' °
'' ''' GAME Application of direct definition''' '╕LX' °
'L4:''LESSON 4 More APL2 primitives and APL2 syntax''' °
''' TEACH1 Catenation and quotes''' °
''' TEACH2 Compression''' °
''' TEACH3 Replication''' °
''' TEACH4 N-wise reduction''' °
''' TEACH5 Logical primitives''' °
''' TEACH6 Indexing''' °
''' TEACH7 Arabic numerals to roman''' °
''' ARABIC Evolution of Arabic numerals''' '╕LX' °
'L5:''LESSON 5 Comments; Algebra in APL2''' °
''' TEACH1 Review of lesson 4''' °
''' TEACH2 Comments, the lamp symbol''' °
''' TEACH3 Absolute value and residue''' °
''' TEACH4 Encode''' °
''' TEACH5 Decode and dual functions''' °
''' TEACH6 Decode''' ''' TEACH7 Scan operator''' °
''' CONVENTION Algebraic symbolism''' °
''' DUAL Concept of dual in math and APL2''' °
''' MORE Evaluation of polynomials in APL2''' °
''' MODULO Congruence and quadratic residue''' '╕LX' °
'L6:''LESSON 6 Rank and rank 2 objects''' °
''' TEACH1 Ravel, dimension and rank''' °
''' TEACH2 Scalar functions''' °
''' TEACH3 Empty arrays''' °
''' TEACH4 Bracket indexing of arrays''' °
''' TEACH5 Reduction of arrays''' °
''' TEACH6 Scan of arrays''' °
''' RANK Rank and dimension contrasted''' °
''' TABLES Historic origin of tables''' '╕LX' °
'L7:''LESSON 7 Nested arrays''' °
''' TEACH1 Introduction to nesting''' °
''' TEACH2 Strand notation''' °
''' TEACH3 Rank and Depth''' °
''' TEACH4 More on Depth''' °
''' TEACH5 Enclose with Axis''' °
''' TEACH6 Disclose of nested arrays''' °
''' TEACH7 Dyadic Enclose or Partition''' '╕LX' °
'L8:''LESSON 8 Processing nested arrays''' °
''' TEACH1 Processing nested data structures''' °
''' TEACH2 First, Drop, and Take with axis''' °
''' TEACH3 Pick and the Prototype''' °
''' TEACH4 The Each operator''' °
''' TEACH5 Enlist and Ravel''' °
''' TEACH6 Catenation''' °
''' TEACH7 Reverse, Rotate, and Transpose''' '╕LX' °
'L9:''LESSON9 Principles of APL2 and sorting''' °
''' TEACH1 Theory of APL2; Binding rules''' °
''' TEACH2 Binding rules in some expressions; references''' °
''' TEACH3 New primitives; grade up and grade down''' °
''' TEACH4 Dyadic grade''' °
''' TEACH5 System Functions and Variables''' °
''' TEACH6 System Commands''' '╕LX' °
'L10:''LESSON 10 Working with arrays''' °
''' TEACH1 The APL2 Inner Product''' °
''' TEACH2 Inner product with vectors and arrays''' °
''' TEACH3 Vectors and marices''' °
''' TEACH4 The inner product process''' °
''' * BIND Summary of binding rules''' °
''' LINEAR History of linear algebra''' °
''' MATRIX Examples from matrix algebra''' '╕LX' °
'L11:''LESSON 11 User defined functions''' °
''' TEACH1 Introduction to defined functions''' °
''' TEACH2 Quad Fix''' °
''' TEACH3 Branching and labels''' °
''' TEACH4 Del mode''' °
''' TEACH5 Programming style''' °
''' TEACH6 Modifying a defined function''' °
''' TEACH7 Headers''' °
''' TEACH8 Local variables''' '╕LX' °
'L12:LESSON 12 The outer product and user defined operators '' °
' ''' TEACH1 Outer product operator''' °
''' TEACH2 User defined operator''' °
''' TEACH3 Operator extensions on monadic functions''' °
''' TEACH4 Dyadic defined operator with two functions''' °
''' TEACH5 Locke functions''' '╕LX' °
'L13:''LESSON 13 User input''' °
''' TEACH1 Quad and Quote Quad input''' °
''' TEACH2 Quad utility''' °
''' TEACH3 Format, Execute and the ''''doif'''' utility''' °
''' TEACH4 Re-design GETNO''' °
''' TEACH5 The game of Blackjack''' °
''' TEACH6 Using function ''''doif'''' in function BLACKJACK °
''' ''' TEACH7 Another version of Blackjack''' '╕LX' °
'L14:''LESSON14 Controlling the execution of APL2 expressions °
''' ''' TEACH1 Execute Alternate''' °
''' TEACH2 Execute Controlled''' °
''' TEACH3 Event Type''' °
''' TEACH4 Error Messages''' °
''' TEACH5 Using ÉEC to extend the syntax of APL2''' °
''' TEACH6 Define EVAL; to evaluate conditional expressions' °
'' '╕LX' °
'L15:''LESSON15 Structural primitives and data structures''' °
''' TEACH1 Find; usage of workspace IDIOMS''' °
''' TEACH2 Dyadic primitive MATCH''' °
''' TEACH3 Dyadic primitive WITHOUT''' °
''' TEACH4 Using data structures; the Push Down Stack''' °
''' TEACH5 Rule selection''' °
''' TEACH6 FRAMES as data structures''' '╕LX' °
'L16:''LESSON16 System Commands, utilities and conventions''' °
''' TEACH1 Discuss System Commands''' °
''' TEACH2 Index origin''' °
''' TEACH3 Discuss role of global variables''' °
''' TEACH4 Using conventions''' °
''' TEACH5 Describe utility function ''''do''''''' °
''' TEACH6 Utility functions ''''show'''' and ''''showfn'''' °
''' °
''' TEACH7 System functions and System variables °
' ''' COMMANDS Summary of System Commands''' °
'╕LX' 'L17:''LESSON17 Making APL2 more efficient''' °
''' TEACH1 There are many ways to solve problems in APL2''' °
''' TEACH2 Testing function TIME''' °
''' TEACH3 Examples of computation time''' °
''' TEACH4 Strategies for efficient problem solving''' °
''' TEACH5 Dyadic format; format by specification''' °
''' TEACH6 Format by example''' °
''' ALGORITHMS A classification table of algorithms''' °
''' N TIME E Measuring evaluation time of APL2 expression''' °
'╕LX' 'L18:''LESSON18 Developing a new defined function''' °
''' TEACH1 Testing and documenting new APL2 functions''' °
''' TEACH2 Utilities useful in function documentation''' °
''' TEACH3 Describe process of defining function CtoN''' °
''' TEACH4 Another approach to CtoN''' °
''' TEACH5 Describing the algorithm in a blueprint function' °
'' ''' TEACH6 Adding test cases to blueprint function''' °
'╕LX' 'L19:''LESSON19 Logarithms and the Pascal triangle''' °
''' TEACH1 APL2 and mathematics''' °
''' TEACH2 Compound interest''' °
''' TEACH3 Invention of logarithms''' °
''' TEACH4 The log function''' °
''' TEACH5 Pascal triangle''' °
''' TEACH6 Factorial, Gamma and binomial''' '╕LX' °
'L20:''LESSON20 Some concepts from calculus and trigonometry' °
'' ''' TEACH1 Review power function and logarithm''' °
''' TEACH2 Convergence, derivatives and integrals of infinit °
e series''' ''' TEACH3 Circle functions''' °
''' TEACH4 Triangle functions''' °
''' TEACH5 More trig functions''' '╕LX' °
'L21:''LESSON21 Matrix algebra''' °
''' TEACH1 Geometrical interpretation of matrices''' °
''' TEACH2 Rotation matrix, scaling and inversion''' °
''' TEACH3 Dot product''' °
''' TEACH4 The inverse of a matrix''' °
''' TEACH5 Solving linear equations''' °
''' TEACH6 Properties of the inverse''' °
''' TEACH7 Domino with vectors''' '╕LX' °
'L22:''LESSON22 Fitting equations to data''' °
''' TEACH1 Solving linear equations with dyadic domino''' °
''' TEACH2 Least squares''' °
''' TEACH3 Fitting curves''' °
''' TEACH4 Fitting trigonomrtric functions''' °
''' TEACH5 Function minimization''' °
X 'LX:T╜1╟T ╪ endd ╪ ╕(0<µT)/L' °
*(1997 7 13 12 30 30 436) °
FDISPLAY ÉFX 'D╜S DISPLAY A;ÉIO;R;C;HL;HC;HT;HB;VL;VB;V;W;N;B' °
'Σ DISPLAY A GENERAL ARRAY IN PICTORIAL FORM' °
'Σ NORMAL CALL IS MONADIC. DYADIC CALL USED ONLY IN' °
'Σ RECURSION TO SPECIFY DISPLAY RANK, SHAPE, AND DEPTH.' 'ÉIO╜0' °
'»(0=ÉNC ''S'')/''S╜µA''' 'R╜╞µ,S Σ PSEUDO RANK.' °
'C╜''┐┌└┘'' Σ UR, UL, LL, AND LR CORNERS.' °
'HL╜''─'' Σ HORIZONTAL LINE.' °
'HC╜HL,''Θ╕'',HL,''~+ε'' Σ HORIZONTAL BORDERS.' °
'HT╜HC[(0<R)⌡1+0<╞²1╞,S]' 'ΣW╜,0╧■╞0µΓ(1⌐µA)╞A' °
'HB╜HC[3+3╛(''2⌡~A╧«A'' ÉEA ''1+╞ε0⌡(1⌐⌡/µA)╞,A'')+3⌡1<µµS]' °
'VL╜''│'' Σ VERTICAL LINE.' °
'VB╜VL,''Φ╟'' Σ VERTICAL BORDER.' °
'V╜VB[(1<R)⌡1+0<²1╞²1╟,S]' °
'»(0εµA)/''A╜(1⌐µA)µΓ╞A'' Σ SHOW PROTOTYPE OF EMPTIES.' °
'╕(1<╧A)/GEN' '╕(2<µµA)/D3' °
'D╜«A Σ SIMPLE ARRAYS.' 'W╜1╞µD╜(²2╞1 1,µD)µD' °
'N╜²1+1╟µD' '╕(0=µµA)/SS' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' '╕0' 'SS:HB╜((0 '' '')=╞0µΓA)/'' -''' °
'D╜'' '',('' '',[0]D,[0]HB,Nµ'' ''),'' ''' '╕0' °
'GEN:D╜«DISPLAY■A Σ ENCLOSED ...' 'N╜Dδ.⌠'' ''' °
'D╜(Nδ~1ΦN)≡D' 'D╜(δ≡~'' ''╤D)/D' 'D╜((1,µS)µS)DISPLAY D' °
'╕(2≥µ,S)╟D3E,0' 'D3:D╜0 ²1╟0 1╟«ΓA Σ MULT-DIMENSIONAL ...' °
'W╜1╞µD' 'N╜²1+1╟µD' °
'D╜(C[1],V,((W-1)µVL),C[2]),((HT,NµHL),[0]D,[0]HB,NµHL),C[0],(WµVL),C[ °
3]' 'D3E:N╜²2+µ,S' °
X 'V╜C[Nµ1],[0]VB[1+0<²2╟,S],[0](((²3+╞µD),N)µVL),[0]C[Nµ2]' 'D╜V,D' °
*(1997 8 26 12 58 20 564) °
FFIND ÉFX 'U╜V FIND W;B;T' 'Σ Find W in col 3 or col 4 of index' °
'W╜upper W ╪ ╕((1=µ,W),^/''R ''=2╞W)/L1,L2' °
'U╜(T╜index[;4]find W)≡index' '╕L3' 'L1:U╜(T╜W=╞■index[;3])≡index' °
'╕L3' 'L2:U╜1 RULE»1╟W ╪ ╕0' 'L3:U[;1]╜(Γ''TEACH''),■«■U[;1]' °
'B╜0=εµ■µ■U[;2] ╪ B╜B/∞µB ╪ U[B;2]╜(Γ''TEACH''),■«■U[B;2]' °
'U╜(T/∞µT),U ╪ U╜''ROW'' ''WORKSPACE'' ''FUNCTION'' ''CONTENTS'',[1]U[ °
X;1 2 3 5]' '╕(2=ÉNC ''V'')/0' 'U╜0 1╟U' °
*(1997 9 9 12 18 31 384) °
FGET ÉFX 'U╜GET W' °
'Σ List all subjects described in workspace W[1] and function W[2]' °
X 'U╜(index[;1]=╞W)≡index ╪ ╕(0=µW╜1╟W)/0' 'U╜(δ/U[;2]°.╧W)≡U' °
*(1997 9 8 13 39 44 520) °
FRULES ÉFX 'RULES;L;R;T' 'Σ List requested rules' °
X '''Enter the rule numbers to be displayed''' '1 rule É' °
XCd 0 ½ °
*(1997 7 13 12 30 34 452) °
Fdo ÉFX 'do;T;E' 'Σ Expression driver' 'E╜''''' 'æ╜'' ''' 'T╜æ' °
'╕(^/'' ''=T)/0' °
'╕(('':''εT)doif ''B╜evaldd (+/^\'''' ''''=T)╟T'')/2' °
'''E╜ÉEM'' ÉEA T' '╕(0=µ,E)/2' °
'''This is not a valid APL2 expression''' 'æ╜''*''' '╕(''?''⌠╞1╟æ)/2' °
X 'E' '╕2' °
*(1997 7 13 12 30 35 456) °
Fdoif ÉFX 'U╢╜V╢ doif W╢;t╢' 'Σ Rule' '╕(^/~U╢╜V╢)/0' °
X '''t╢╜V╢ doif■ W╢'' ÉEA ''»V╢/W╢''' °
*(1997 9 9 12 44 57 592) °
XFendd ÉFX 'endd' 'Σ end of special feature' '20µ''²''' 'do' °
*(1997 7 13 12 30 35 456) °
Ffind ÉFX 'U╜V find W' 'Σ Return boolean vector of matching patterns' °
X '╕((1<╧V)doif ''U╜V find■ ΓW'')/0' 'U╜δ/^/(²1+∞µW)ΘV°.=W' °
*(1997 8 22 13 15 17 368) °
Fget ÉFX 'u╜v get w' 'Σ List all items of w with v in first µv columns' °
X 'u╜(v^.╧φw[;∞µv])≡w' °
*(1997 7 28 13 33 8 424) °
Fglobals ÉFX 'globals' 'Σ Initialize useful global variables' °
'uc╜''ABCDEFGHIJKLMNOPQRSTUVWXYZ''' °
'lc╜''abcdefghijklmnopqrstuvwxyz''' 'dig╜''1234567890''' °
X 'r╜ÉAV[13+ÉIO]' 'q╜''''''''' °
Aindex╜374 4µ(0)(1)('G')('INSTALLING APL2OS2')(0)(1)('G')('APL2OS2 ICON °
S')(0)(1)('G')('APL2OS2 COMMAND FILE')(0)(2)('G')('DEFINING APL2 LIBRAR °
IES')(0)(2)('G')('APL2 INVOCATION')(0)(2)('G')('APL2 ENVIRONMENT VARIAB °
LES')(0)(3)('G')('SESSION MANAGER')(0)(3)('G')('SESSION LOG')(0)(4)('G' °
)('SESSION EDITOR')(0)(4)('G')('MOVE MARK FIND DELETE TEXT')(0)(5)('G') °
('APL2 KEYBOARD')(0)(8)('G')('CUSTOMIZING APL2 KEYBOARD')(0)(9)('G')('S °
ELECTING FONTS')(0)(10)('G')('CHANGING COLORS')(0)(11)('G')('CHANGING C °
OLORS OF APL2 FIELDS')(0)(12)('G')('SETTING F-KEYS')(0)(13)('G')('SCROL °
LING OPTIONS')(1)(2)('A')('APL2 EXPRESSIONS')(1)(2)('A')('IMMEDIATE EXE °
CUTION')(1)(3)('A')('NUMBERS, CHARACTERS, SCALARS')(1)(4)('A')('VECTORS °
')(1)(4)('A')('APL2 PRIMITIVE FUNCTIONS')(1)(4)('A')('APL2 SYMBOLS')(1) °
(4)('A')('USER DEFINED FUNCTIONS')(1)(4)('-')('NEGATION (MINUS)')(1)(5) °
('²')('HIGH MINUS')(1)(5)('A')('MONADIC, DYADIC FUNCTIONS')(1)(6)('=')( °
'EQUAL')(1)(6)('⌠')('NOT EQUAL')(1)(6)('ε')('MEMBERSHIP FUNCTION')(1)(6 °
)('A')('RELATIONAL FUNCTIONS')(1)(7)('╜')('ASSIGNEMENT ARROW')(1)(7)('G °
')('RE-EXECUTION')(1)(7)('A')('VARIABLE SPECIFICATION')(1)(8)('µ')('SHA °
PE')(1)(8)('µ')('RESHAPE')(1)(8)('A')('ARRAYS')(1)(9)('∞')('INDEX GENER °
ATOR')(1)(9)('∞')('INDEX OF')(1)('GAUSS')('H')('AN ANECDOTE ABOUT GAUSS °
')(1)('KEYBOARD')('G')('SELECT KEYBOARD')(1)('KEYBOARD')('G')('FIND APL °
2 SYMBOL KEYS')(1)('TEACHER')('G')('TUTORIAL EXPLANATION')(1)('TEACHER' °
)('G')('MAIL, E-MAIL ADDRESS')(1)(2)('+')('PLUS')(1)(2)('-')('MINUS')(1 °
)(2)('⌡')('TIMES')(1)(2)('÷')('DIVIDE')(2)(1)('A')('EVALUATING VECTORS' °
)(2)(2)('A')('REDUCTION OPERATOR')(2)(3)('A')('ZERO AND NULL')(2)(3)('A °
')('RANK')(2)(3)('A')('IDIOM')(2)(4)('U')('DISPLAY FUNCTION')(2)(4)('G' °
)('KEYBOARD')(2)(5)('S')('ERROR MESSAGES')(2)(5)('S')('INTERRUPTS')(2)( °
6)('A')('APL2 ALGORITHMS, AVERAGE')(2)(6)('A')('PARENTHESES')(2)(7)('A' °
)('ZERO DIVIDE')(2)(7)('⌡')('SIGNUM')(2)(7)('÷')('RECIPROCAL')(2)(7)('+ °
')('COMPLEX CONJUGATE')(2)(8)('?')('ROLL, DEAL')(2)('COMPLEX')('H')('PY °
THAGORAS')(2)('COMPLEX')('A')('COMPLEX NUMBERS')(2)('COMPLEX')('A')('IM °
AGINARY COMPONENT')(2)('RECIPROCAL')('U')('AVOIDING ZERO DIVIDE INTERRU °
PT')(2)('COMPLEX')('J')('COMPLEX NUMBER NOTATION')(3)(1)('(')('PARENTHE °
SES')(3)(1)(')')('PARENTHESES')(3)(1)('''')('QUOTE')(3)(1)('²')('HIGH M °
INUS')(3)(1)('A')('WORKSPACE')(3)(2)('*')('POWER FUNCTION')(3)(3)('⌐')( °
'MAXIMUM')(3)(3)('╛')('MINIMUM')(3)(3)('⌐')('CEILING')(3)(3)('╛')('FLOO °
R')(3)(3)('=')('EQUAL')(3)(3)('⌠')('NOT EQUAL')(3)(3)('<')('LESS THAN') °
(3)(3)('>')('GREATER THAN')(3)(3)('≤')('LESS THAN OR EQUAL')(3)(3)('≥') °
('GREATER THAN OR EQUAL')(3)(4)('A')('USER DEFINED FUNCTION')(3)(4)('A' °
)('ALGORITHM')(3)(5)('U')('DIRECT DEFINITION')(3)(6)('U')('CONDITIONAL °
DIRECT DEFINITION')(3)(7)('U')('AVERAGE, RANGE, MIDRANGE')(3)('ALGORITH °
M')('H')('ORIGIN OF THE WORD ALGORITHM')(3)('COMPLEX 1')('A')('CUBE ROO °
TS OF NEGATIVE NUMBERS')(3)('COMPLEX 2')('⌐')('CEILING OF COMPLEX NUMBE °
RS')(3)('COMPLEX 2')('╛')('FLOOR OF COMPLEX NUMBERS')(3)('DECIMAL')('H' °
)('ORIGIN OF DECIMAL NOTATION')(3)('DIRECT')('H')('RECENT DEVELOPMENTS °
IN APL THEORY, KEN IVERSON')(3)('GAME')('U')('A GAME TO GUESS A NUMBER' °
)(3)('DIRECT')('H')('TACIT PROGRAMMING')(3)('DIRECT')('H')('DIRECT DEFI °
NITION')(3)('POWER')('*')('EXPONENTIAL POWER FUNCTION (MONADIC)')(3)('P °
OWER')('*')('POWER OF COMPLEX NUMBERS')(3)('POWER')('*')('EULER FORMULA °
')(3)('DECIMAL')('.')('DECIMAL POINT')(4)(1)(',')('CATENATION, RAVEL')( °
4)(2)('/')('COMPRESSION')(4)(3)('/')('REPLICATION')(4)(4)('/')('N-WISE °
REDUCTION')(4)(5)('~')('NOT')(4)(5)('δ')('OR')(4)(5)('^')('AND')(4)(5)( °
'τ')('NOR')(4)(5)('σ')('NAND')(4)(6)('╙')('INDEXING FUNCTION')(4)(6)('[ °
')('BRACKET INDEXING')(4)(6)(']')('BRACKET INDEXING')(4)(7)('╜')('VECTO °
R SPECIFICATION')(4)(7)('╜')('SELECTIVE SPECIFICATION')(4)(8)('U')('CON °
VERTING ROMAN NUMERALS TO ARABIC')(4)('ARABIC')('H')('ORIGIN OF ARABIC °
NOTATION')(5)(2)('Σ')('LAMP, COMMENTS')(5)(2)('U')('RUNNING AVERAGE')(5 °
)(3)('|')('ABSOLUTE VALUE')(5)(3)('|')('RESIDUE')(5)(4)('ÿ')('ENCODE')( °
5)(5)('¥')('DECODE')(5)(6)('U')('CONVERTING ROMAN NUMERALS TO ARABIC')( °
5)(7)('\')('THE SCAN OPERATOR')(5)('COMPLEX')('G')('ABSOLUTE VALUE OF C °
OMPLEX NUMBERS')(5)('CONVENTION')('H')('EVOLUTION OF ALGEBRAIC NOTATION °
')(5)('DUAL')('G')('THE CONCEPT OF A DUAL')(5)('DUAL')('U')('HALF ADJUS °
T ALGORITHM')(5)('MODULO')('G')('MODULO ARITHMETIC')(5)('MODULO')('G')( °
'LAW OF QUADRATIC RECIPROCITY, K GAUSS')(5)('RESIDUE')('|')('RESIDUE OF °
NON-INTEGER AND NEGATIVE NUMBERS')(6)(1)('A')('APL ARRAYS')(6)(1)('A') °
('RANK 0 ARRAYS')(6)(2)('A')('ARRAYS AND SCALAR FUNCTIONS')(6)(3)('A')( °
'EMPTY ARRAYS')(6)(3)('U')('THE DISPLAY FUNCTION')(6)(4)('A')('ARRAYS A °
ND NON SCALAR PRIMITIVE FUNCTIONS')(6)(4)('[')('BRACKET INDEXING')(6)(4 °
)(']')('BRACKET INDEXING')(6)(5)('/')('ARRAYS AND REDUCTION OPERATOR')( °
6)(6)('\')('ARRAYS AND SCAN OPERATOR')(6)('TABLES')('H')('INVENTION AND °
USAGE OF TABLES')(6)('RANK')('G')('DISTINCTION BETWEEN APL AND MARHEMA °
TICAL RANK')(6)('RANK')('G')('GEOMETRICAL INTERPRETATION OF APL ARRAYS' °
)(6)('RANK')('G')('BASIS')(6)('RANK')('G')('LINEAR ALGEBRA')(6)(5)('≡') °
('REDUCTION ALONG FIRST AXIS')(7)(1)('A')('NESTED ARRAYS AND DEPTH')(7) °
(1)('╧')('DEPTH')(7)(1)('Γ')('ENCLOSE')(7)(2)(' ')('BLANK IN APL SYNTAX °
')(7)(2)('A')('STRAND NOTATION')(7)(3)('A')('RANK AND DEPTH')(7)(3)('A' °
)('NESTED VECTORS')(7)(3)('A')('INDEXING OF NESTED VECTORS')(7)(3)('π') °
('PICK FUNCTION')(7)(3)('π')('ACCESS VECTOR')(7)(4)('π')('USING PICK ON °
NESTED ARRAYS')(7)(5)('Γ')('ENCLOSE WITH AXIS')(7)(5)('φ')('TRANSPOSE' °
)(7)(6)('A')('RANK TRANSFORMATIONS')(7)(6)('A')('FILL ELEMENT')(7)(6)(' °
A')('EQUIVALENT (HOMOGENEOUS) FORMS')(7)(7)('Γ')('PARTITION FUNCTION')( °
8)(1)('╞')('TAKE')(8)(1)('╟')('DROP')(8)(1)('A')('FILL ELEMENTS AND PRO °
TOTYPES')(8)(2)('╞')('TAKE WITH AXIS')(8)(2)('╟')('DROP WITH AXIS')(8)( °
2)('A')('DEPTH AFTER TAKE OR DROP')(8)(3)('╞')('FIRST')(8)(4)('■')('EAC °
H')(8)(4)('ε')('ENLIST')(8)(5)('A')('RAVEL, CATENATE AND ENLIST ON NEST °
ED ARRAYS')(8)(6)(',')('CATENATION OF ARRAYS')(8)(6)('A')('LAMINATION') °
(8)(7)('Φ')('REVERSE AND ROTATE')(8)(7)('Θ')('REVERSE AND ROTATE')(8)(7 °
)('φ')('TRANSPOSE')(9)(1)('A')('BINDING RULES')(9)(1)('A')('CHANGES FRO °
M APL TO APL2')(9)(2)('A')('APPLYING BINDING RULES TO APL2 EXPRESSIONS' °
)(9)(3)('√')('GRADE UP ON NUMERIC ARRAYS')(9)(3)('ⁿ')('GRADE DOWN ON NU °
MERIC ARRAYS')(9)(4)('√')('GRADE UP ON CHARACTER ARRAYS')(9)(4)('ⁿ')('G °
RADE DOWN ON CHARACTER ARRAYS')(9)(4)('S')('ATOMIC VECTOR')(9)(4)('S')( °
'QUAD AS DEFINING SYSTEM FUNCTIONS AND VARIABLES')(9)(5)('S')('TERMINAL °
CONTROL CHARACTERS')(9)(5)('S')('NEW LINE CHARACTER')(9)(5)('S')('ATOM °
IC FUNCTION')(9)(5)('A')('ZERO INDEX ORIGIN OF ATOMIC FUNCTION')(9)(6)( °
')')('SYSTEM COMMANDS: LIB LOAD OFF WSID')(9)('BIND')('A')('BINDING RUL °
ES')(10)(1)('A')('INNER PRODUCT')(10)(1)('.')('DOT PRODUCT')(10)(1)('A' °
)('ARRAY PRODUCT')(10)(2)('A')('USING ARRAY PRODUCT ON CHARACTER AND NU °
MERIC ARRAYS')(10)(3)('A')('ARRAYS AND MATRIX ALGEBRA')(10)(3)('G')('ID °
ENTITY MATRIX')(10)(3)('U')('FUNCTION UNIT')(10)(3)('G')('NON COMMUTATI °
VE PRODUCT')(10)(4)('G')('MATRIX MULTIPLICATION')(10)(4)('A')('BINDING °
RULE 3')(10)('LINEAR')('H')('DEVELOPMENT OF ALGEBRAIC CONCEPTS')(10)('M °
ATRIX')('U')('EXAMPLES FROM MATRIX ALGEBRA')(11)(1)('A')('USER DEFINED °
FUNCTIONS')(11)(1)('╖')('DEL EDITOR')(11)(1)('S')('QUAD FIX')(11)(1)('A °
')('APL EDITOR')(11)(2)('A')('HEADER')(11)(2)('A')('CANONICAL REPRESENT °
ATION')(11)(3)('U')('CONVERTING ROMAN NUMERALS TO ARABIC')(11)(3)('╕')( °
'RIGHT POINTING ARROW BRANCH')(11)(3)('╕')('BRANCH TO ZERO = EXIT FUNCT °
ION')(11)(3)('A')('LABELS IN USER DEFINED FUNCTIONS')(11)(3)('S')('NAME °
CLASSIFICATION')(11)(3)('A')('EXPUNGING (ERASING) APL2 OBJECTS')(11)(3 °
)('╪')('DIAMOND SEPARATOR')(11)(4)('╖')('USING THE DEL EDITOR')(11)(4)( °
'U')('MOVING AVERAGE')(11)(5)('G')('PROGRAMMING STYLES')(11)(5)('G')('U °
TILITY FUNCTIONS')(11)(5)('G')('SUBROUTINES')(11)(5)('G')('EDGE EFFECTS °
, DEFAULTS AND ABORTS')(11)(6)('A')('MODIFYING A USER DEFINED FUNCTION' °
)(11)(6)('A')('FUNCTION DEFINITION MODE')(11)(6)('A')('AMBIVALENT FUNCT °
ION')(11)(6)('A')('LISTING A USER DEFINED FUNCTION')(11)(7)('A')('SESSI °
ON MANAGER EDITOR')(11)(8)('A')('USER DEFINED FUNCTION HEADERS')(11)(9) °
('A')('LOCAL AND GLOBAL NAMES')(11)(9)('A')('REPEAT LABELS IN HEADERS') °
(11)(2)('S')('CHARACTER REPRESENTATION')(11)(8)('S')('ATTRIBUTES')(12)( °
1)('.')('OUTER PRODUCT')(12)(1)('U')('PRIME NUMBERS')(12)(2)('A')('HEAD °
ERS OF USER DEFINED OPERATORS')(12)(2)('A')('EXTENSION OF REDUCTION TO °
NESTED ARRAYS')(12)(3)('U')('APPLY OPERATOR TO EACH LEAF AT DEPTH V')( °
12)(3)('U')('ROY SYKES')(12)(3)('U')('DELAYED BINDING')(12)(3)('U')('RA °
Y POLIVKA')(12)(3)('U')('CONVERTING TO AND FROM HEXADECIMAL NOTATION')( °
12)(4)('U')('BINDING RULES AND DEFINING NEW OPERATORS')(12)(5)('·')('LO °
CKED FUNCTIONS')(12)(5)('A')('USING QUAD FX TO LOCK FUNCTIONS')(13)(1)( °
'É')('QUAD; NUMERIC INPUT')(13)(1)('æ')('QUAD; CHARACTER INPUT')(13)(1) °
('S')('PROMPT REPLACEMENT')(13)(1)('æ')('ENTERING TEXT ON SAME LINE AS °
PROMPT')(13)(2)('U')('GETNO: PROMPT, THEN OBTAIN NUMERIC DATA')(13)(3)( °
'»')('EXECUTE PRIMITIVE')(13)(3)('«')('MONADIC FORMAT')(13)(3)('U')('"d °
oif" FUNCTION')(13)(4)('S')('RANDOM LINK')(13)(4)('S')('TIME STAMP')(13 °
)(5)('A')('CARD GAMES; SHUFFLING A DECK')(13)(5)('U')('SHOW: DISPLAY CA °
RDS')(13)(5)('U')('DEAL: DEAL FROM A SHUFFLED CARD DECK')(13)(5)('U')(' °
THE GAME OF BLACKJACK')(13)(5)('U')('EVAL: EVALUATE A BLACKJACK HAND')( °
13)(5)('U')('ISIN: EVALUATE A BLACKJACK HAND')(13)(6)('G')('PROGRAMMING °
STYLES')(13)(6)('G')('BLACKJACK AS A PRODUCTION SYSTEM')(13)(7)('G')(' °
BLACKJACK AS A RULE BASED SYSTEM')(14)(1)('S')('THE EXECUTE ALTERNATE S °
YSTEM FUNCTION')(14)(1)('S')('NAME ASSOCIATION')(14)(1)('S')('SHARED VA °
RIABLES')(14)(2)('S')('THE EXECUTE CONTROLLED SYSTEM FUNCTION')(14)(3)( °
'S')('THE EVENT TYPE SYSTEM VARIABLE')(14)(3)('A')('ERRORS: DEFAULT, RE °
SOURCE, SYNTAX, VALUE')(14)(3)('A')('ERRORS: IMPLICIT ARGUMENT, EXPLICI °
T ARGUMENT')(14)(4)('A')('ERROR MESSAGES: AXIS, DOMAIN, LENGTH, VALUE') °
(14)(5)('U')('NEW: USING EXECUTE CONTROLLED TO EXTEND SYNTAX OF APL2')( °
14)(6)('U')('EVAL: EVALUATE NON-APL2 EXPRESSIONS')(14)(4)('S')('EVENT M °
ESSAGE')(15)(1)('G')('KNOWLEDGE BASE')(15)(1)('╤')('FIND')(15)(1)('U')( °
'IBM WORKSPACE IDIOMS')(15)(2)('╧')('MATCH')(15)(2)('A')('COMPARING TWO °
APL2 ARRAYS')(15)(3)('~')('WITHOUT')(15)(4)('G')('USING DATA STRUCTURE °
S')(15)(4)('U')('PUSH: PLACE APL2 ARRAY ON PUSH DOWN STACK')(15)(4)('U' °
)('POP: REMOVE APL2 ARRAY FROM PUSH DOWN STACK')(15)(5)('U')('A MORE GE °
NERAL INFERENCE ENGINE')(15)(6)('G')('HIERARCHICAL NETWORKS; FRAMES')( °
16)(1)('S')('SYSTEM COMMANDS')(16)(1)('S')('LOAD, IN, PIN, OFF, WSID, C °
OPY, PCOPY, LIB')(16)(1)('S')('SAVE, OUT, ERASE, DROP, CLEAR, VARS, FNS °
, OPS')(16)(1)('S')('NMS, SI, SINL, SIS, RESET, MORE, HOST, CHECK, SYMB °
OLS')(16)(2)('S')('INDEX ORIGIN')(16)(3)('A')('GLOBAL VARIABLES')(16)(4 °
)('G')('ADOPTING CONVENTIONS')(16)(4)('S')('NAME LIST')(16)(4)('G')('HA °
RRY BERTUCCELLI')(16)(5)('G')('SAMPLE UTILITY FUNCTIONS')(16)(5)('U')(' °
"do" PAUSE TO ALLOW ENTERING SAMPLE APL2 EXPRESSION')(16)(6)('U')('"sho °
w" DISPLAY APL2 EXPRESSION AND EVALUATE IT')(16)(6)('U')('"showfn" DISP °
LAY A USER DEFINED FUNCTION')(16)('COMMANDS')('S')('DISPLAY SYSTEM COMM °
ANDS AVAILABLE TO APL2OS2')(16)(7)('S')('LATENT EXPRESSION')(16)(7)('S' °
)('ACCOUNT INFORMATION')(16)(7)('S')('COMPARISON TOLERANCE')(16)(7)('S' °
)('DELAY')(16)(7)('S')('PRINT PRECISION')(16)(7)('S')('PRINTING WIDTH') °
(16)(7)('S')('WORKSPACE AVAILABLE')(17)(1)('G')('SOLVING PROBLEMS WITH °
APL2')(17)(1)('U')('TIME: TIMING OF APL2 EXPRESSIONS')(17)(1)('S')('TIM °
E STAMP')(17)(1)('G')('ROY A SYKES')(17)(2)('U')('TEST: TEST TIMING OF °
APL2 EXPRESSIONS')(17)(3)('G')('CLASSIFICATION OF ALGORITHMS ON BASIS O °
F COST')(17)(3)('G')('TIME: CONSTANT, LOGARITHMIC, LINEAR, N LOG N, QUA °
DRATIC')(17)(4)('G')('STRATEGIES FOR EFFICIENT PROBLEM SOLVING')(17)(4) °
('U')('SAMPLE FUNCTIONS: ACC1 AND ACC2')(17)(5)('«')('DYADIC FORMAT')( °
17)(5)('«')('FORMAT BY SPECIFICATION')(17)(6)('«')('FORMAT BY EXAMPLE') °
(17)(6)('S')('FORMAT CONTROL')(17)('ALGORITHM')('G')('CLASSIFICATION OF °
ALGORITHMS ON BASIS OF COST')(18)(1)('G')('DEVELOPING, TESTING AND DOC °
UMENTING USER DEFINED FUNCTIONS')(18)(1)('U')('BLUEPRINT FUNCTIONS')(18 °
)(2)('U')('UTILITY FUNCTIONS USEFUL IN DOCUMENTATION')(18)(3)('U')('BUI °
LDING A BLUEPRINT FUNCTION')(18)(4)('U')('WHAT TO DO IF FIRST ALGORITHM °
FAILS')(18)(5)('U')('STARTING ALL OVER')(19)(1)('G')('APL2 AND MATHEMA °
TICAL NOTATION')(19)(2)('G')('SIMPLE AND COMPOUND INTEREST')(19)(3)('H' °
)('ABACUS')(19)(3)('H')('ARCHIMEDES, BLAISE PASCAL, JOHN NAPIER')(19)(3 °
)('H')('LOGARITHM')(19)(4)('╡')('THE LOG FUNCTION')(19)(4)('G')('COMPOU °
ND INTEREST')(19)(4)('G')('TRANSCENDENTAL FUNCTIONS')(19)(5)('G')('PASC °
AL''S TRIANGLE')(19)(5)('G')('SETS AND SUBSETS')(19)(6)('!')('FACTORIAL °
, GAMMA FUNCTION')(19)(6)('!')('BINOMIAL COEFFICIENTS')(20)(1)('H')('IS °
AAC NEWTON')(20)(1)('G')('BINOMIAL EXPANSION, ANALYSIS, INFINITE SERIES °
')(20)(2)('G')('CONVERGENCE OF INFINITE SERIES')(20)(2)('G')('DERIVATIV °
E, INTEGRAL')(20)(3)('G')('MEASURING ANGLES: DEGREES, RADIANS, PI')(20) °
(3)('H')('GREEK MATHEMATICS, ARCHIMEDES')(20)(3)('Ω')('CIRCLE FUNCTIONS °
')(20)(4)('H')('THALES OF MILETUS, PYTHAGORAS')(20)(4)('Ω')('CIRCULAR F °
UNCTIONS: SINE')(20)(5)('Ω')('COSINE, ARC SINE, ARC COSINE, TANGENT, CO °
TANGENT')(20)(5)('Ω')('SECANT, COSECANT, HYPERBOLIC FUNCTIONS')(20)(5)( °
'Ω')('COMPLEX NUMBER FUNCTIONS')(20)('CALCULUS')('G')('CALCULUS: ABSCIS °
SA, ORDINATE, DERIVATIVE, INTEGRAL')(20)(3)('Ω')('PI, DEGREES, RADIANS' °
)(21)(1)('G')('MATRIX ALGEBRA')(21)(2)('G')('UNITARY MATRICES, ROTATION °
OF AXES')(21)(2)('G')('WORKING WITH (MATHEMATICAL) VECTORS')(21)(3)('G °
')('DOT PRODUCT AMD ITS GEOMETRIC MEANING')(21)(4)('G')('MATRIX INVERSE °
, DIAGONAL MATRIX')(21)(4)('Æ')('DOMINO (QUAD DIVIDE)')(21)(5)('G')('SO °
LVING LINEAR EQUATIONS (GROCERY EXAMPLE)')(21)(5)('G')('INVERTING A MAT °
RIX')(21)(6)('G')('PROPERTIES OF THE MATRIX INVERSE')(21)(6)('G')('UNIT °
ARY MATRICES, POSITIVE DEFINITE MATRICES')(21)(7)('Æ')('DOMINO APPLIED °
TO NUMERIC VECTORS')(22)(1)('A')('MATRIX DIVIDE')(22)(2)('G')('LEAST SQ °
UARES (GROCERY EXAMPLE)')(22)(3)('G')('CURVE FITTING, SUM OF SQUARES')( °
22)(4)('G')('FITTING DATA TO EQUATIONS OTHER THAN POLYNOMIALS')(22)(5)( °
X'G')('FUNCTION MINIMIZATION, GRADIENT') °
XClc 1 26 abcdefghijklmnopqrstuvwxyz °
*(1997 9 9 12 24 7 312) °
Flx ÉFX 'lx' 'Σ Latent variable' °
'''This workspace is an index of the TEACH workspaces.'',r' °
'''To find where a subject is discussed, enter FIND subject. (Dyadic'' °
' °
'''version of FIND will also list the row numbers of array index.)'',r °
' '''To add new subject in a TEACH workspace, enter ADD w f c cm''' °
''' [n] ADD w f c cm''' ''' where w is workspace (integer)''' °
''' f is function (integer if TEACHx) or name''' °
''' c is code''' °
''' cm is subject described in the named function''' °
''' n is the workspace number''' °
'''If the left argument "n" is given, the right argument vector will b °
e''' °
'''inserted in front of the first reference in "index" to workspace n+ °
1.'',r' '''To find codes, enter CODES'',r' °
'''To list RULES, enter RULES'',r' °
'''To list all subjects discussed in workspace TEACHn [and function''' °
'''TEACHm (or an indexed function "m" such as "GAUSS"), enter:''' °
''' GET n,m'',r' °
X '''Enter CONTENTS to list main headings of lessons''' °
XCp 1 2 " °
XCq 0 ' °
XCr 0 °
*(1997 6 5 13 40 14 380) °
Frule ÉFX 'V rule W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' 'L:╕(~(╞W)ε∞8)/LA ╪ V rulea╞W ╪ ╕L0' °
'LA:╕(~(╞W)ε9 10 11)/LB ╪ V ruleb╞W ╪ ╕L0' °
'LB:╕(~(╞W)ε11+∞8)/LC ╪ V rulec╞W ╪ ╕L0' °
'LC:╕(~(╞W)ε19+∞10)/LD ╪ V ruled╞W ╪ ╕L0' °
'LD:╕(30 31 32 33 34 35=╞W)/L30,L31,L32,L33,L34,L35' °
'''This rule number is undefined'' ╪ ╕' '╕(0=V)/L0' 'L30:╕(V>1)/L30X' °
''' RULE 30. The length of left argument to both TAKE and DROP must °
''' °
''' equal the rank of the right argument. The exception: a' °
'' °
''' scalar left argument can be applied to a right argument °
''' ''' vector.'',2µr' '╕(0=V)/L0' °
'L30X:''A zero is permissible on both take and drop. A null vector is °
not.''' '╕L0' 'L31:╕(V>1)/L31X' °
''' RULE 31. For TAKE and DROP with axis specification, every''' °
''' integer in the left argument must be matched with''' °
''' a valid axis in brackets. Axes may not be duplicated.'' °
' °
''' The length of the left argument may be less than the''' °
''' rank of the right argument with axis specification.'',2 °
µr' '╕(0=V)/L0' 'L31X:''Any axes not specified are left unchanged.''' °
'╕L0' 'L32:╕(V>1)/L32X' °
''' RULE 32. Monadic Take extracts the contents of the first scalar' °
'' °
''' (rank 0 array) in an array, regardless of its rank.''' °
''' It is called FIRST.'',2µr' '╕(0=V)/L0' °
'L32X:''The FIRST of an empty array returns the prototype.''' '╕L0' °
'L33:╕(V>1)/L33X' °
''' RULE 33. The each operator can be placed to the right of a''' °
''' function, or to the right of an operator. When used,''' °
''' it applies the combined function separately to every''' °
''' element of the argument.'',2µr' '╕(0=V)/L0' °
'L33X:''This operator is so powerful that it is tempting to over-use i °
t.''' °
'''As you excercise your APL2 skills, try to solve problems without''' °
'''the EACH operator as much as possible.''' '╕L0' 'L34:╕(V>1)/L34X' °
''' RULE 34. A rank 0 array, or another array can be catenated to an °
''' °
''' array. When two arrays are catenated, the matching dime °
nsion''' ''' of the two arrays must be the same.'',2µr' °
'╕(0=V)/L0' °
'L34X:''Catenation does not increase depth. The result will have the d °
epth''' '''of the component of greatest depth.'',r' °
'show ''╧3 3µ∞9'' ''╧Γ∞5'' ''╧(3 3µ∞9),Γ∞5''' '╕L0' 'L35:╕(V>1)/L35X' °
''' RULE 35. Two arrays can be catenated if their rank differs by 1. °
''' °
''' The shapes of dimensions not catenated MUST MATCH!'',2µ °
r' '╕(0=V)/L0' °
'L35X:''Naturally, to catenate along other than the last dimension, an °
axis''' '''specification can also be used here.''' 'L0:do' °
X '╕(0=µW╜1╟W)/0' '╕L' °
*(1997 6 1 12 42 53 524) °
Frulea ÉFX 'V rulea W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' 'L:╕(W=∞8)/L1,L2,L3,L4,L5,L6,L7,L8' °
'''For rules not described in this lesson, see workspace INDEX''' °
'╕0' 'L1:╕(V>1)/L1X' °
'''RULE 1. For arithmetic operations a vector must be matched with a'' °
' ''' scalar, or another vector of the same length.'',2µr' °
'╕(0=V)/0' °
'L1X:''This is the first of many rules dealing with the concept of''' °
'''CONFORMABILITY. This means that elements to be processed by APL2''' °
'''must in some ways match.''' '╕0' 'L2:╕(V>1)/L1X' °
'''RULE 2. The reduction operator places the function, (specified to'' °
' °
''' its left), between all pairs of the vector. It then evaluat °
es''' ''' the resulting expression.'',2µr' '╕(0=V)/0' °
'L2X:''There is more to this, but at this stage the rule is essentiall °
y''' '''correct.''' '╕0' 'L3:╕(V>1)/L1X' °
'''RULE 3. All APL2 expressions are evaluated from right to left'',2µr °
' '╕(0=V)/0' °
'L3X:''This rule is valid in APL, which is the earlier version of APL2 °
.''' °
'''For APL2, the rule has been restated in a totally different way.''' °
'''However until we introduce some concepts that are new to APL2, the' °
'' '''newer form reduces to RULE 3 as stated.''' '╕0' 'L4:╕(V>1)/L1X' °
'''RULE 4. Vectors in APL2 can have lengths of zero and one.'',2µr' °
'╕(0=V)/0' °
'L4X:''This is the first concept that begins to introduce the idea tha °
t no''' °
'''matter what the APL expression, if it is valid, it must produce a'' °
' °
'''valid APL2 object. (Shades of which came first, the chicken or the °
egg)''' '╕0' 'L5:╕(V>1)/L1X' °
'''RULE 5. The shape of a variable is a vector. The shape of a vector' °
'' ''' is a vector of length 1. The shape of a scalar is a''' °
''' vector of length zero.'',2µr' '╕(0=V)/0' °
'L5X:''The left argument of RESHAPE is by definition a vector. If APL2 °
is''' °
'''to be internally consistent, the inverse operation to RESHAPE (whic °
h''' '''is indeed SHAPE) MUST return the same type of object.''' '╕0' °
'L6:╕(V>1)/L1X' °
'''RULE 6. Reduction of a scalar returns that scalar REGARDLESS of''' °
''' the function to the left of the reduction operator.'',2µr' °
'╕(0=V)/0' °
'L6X:''Reduction BY DEFINITION reduces the RANK by one. The exception °
is''' °
'''for objects whose rank is zero. Since there is no such thing as''' °
'''negative rank, reduction is undefined for scalars, and therefore''' °
'''the result is to leave the APL2 object unchanged.''' '╕0' °
'L7:╕(V>1)/L1X' °
'''RULE 7. The reduction of a null vector produces the identity''' °
''' element of the function.'',2µr' '╕(0=V)/0' °
'L7X:''A null vector may be empty, but it still has rank equal to one. °
''' °
'''Therefore its reduction MUST be a scalar. Since there is no data''' °
'''in a null vector, the scalar must be such that it has no effect''' °
'''on the operation performed by the function: Zero added to anything' °
'' °
'''has no effect in addition; one multiplied by anything has no effect °
''' '''in multiplication; and so on.''' '╕0' 'L8:╕(V>1)/L1X' °
'''RULE 8. Parentheses can (and should) be used to modify the right''' °
''' to left rule to improve efficiency'',2µr' '╕(0=V)/0' °
'L8X:''Parentheses are used in APL2 for other purposes as well, but fo °
r''' °
'''now, we will use them just to modify the right to left rule (RULE 3 °
).''' °
'''If you place parentheses where they are not needed, APL2 will ignor °
Xe''' '''them.''' °
*(1997 6 1 12 49 37 488) °
Fruleb ÉFX 'V ruleb W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' 'L:╕(9 10 11=╞W)/L9,L10,L11 ╪ ╕0' °
'L9:╕(V>1)/L9X' °
''' RULE 9: To produce a quote inside a character string, enter''' °
''' the quote twice.'',2µr' '╕(0=V)/0' °
'L9X:''This is used in most other programming languages.''' '╕0' °
'L10:╕(V>1)/L10X' °
''' RULE 10: In replication the left argument must contain only''' °
''' integers. The length of the left argument must be''' °
''' the same as the length of the right argument.'',2µr' °
'╕(0=V)/0' °
'L10X:''The left argument may also have negative integers. Only the nu °
mber''' °
'''of positive integers and zeros must add up to the length of the rig °
ht''' °
'''argument. Replicate with negative integers is not discussed here be °
cause''' °
'''the explanation requires concepts that have not yet been mentioned. °
'',r' 'show ''1 1 2 ²1 0 1 1 1 ²1 1 0 1 1/''''CALIFORNIAN''''''' '╕0' °
'L11:╕(V>1)/L11X' °
''' RULE 11: The expression inside square brackets must return''' °
''' positive integers in the range of the length of''' °
''' the indexed vector. If the expression is MISSING,''' °
''' the result is as if the brackets were missing.'',2µr' °
'╕(0=V)/0' °
'L11X:''The expression in brackets need not be a vector. It could be a °
n''' '''array as in the next example'',r' °
X 'show ''''''CALIFORNIA''''[3 3µ?9µ10]'' ''(∞4)[3 3µ∞4]''' °
*(1997 6 2 12 11 17 260) °
Frulec ÉFX 'V rulec W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' °
'L:╕((11+∞8)=╞W)/L12,L13,L14,L15,L16,L17,L18,L19' 'L12:╕(V>1)/L12X' °
''' RULE 12. A scalar function is one that will produce a result on' °
'' °
''' every scalar element of a vector or array. EXAMPLES:''' °
''' + - ⌡ ÷ * are numeric scalar functions. , µ ∞ are NOT'' °
' ''' scalar functions.'',r' '╕(0=V)/0' °
'L12X:''This distinction will become clearer when we study more genera °
lized''' '''arrays.''' '╕0' 'L13:╕(V>1)/L13X' °
''' RULE 13. Scalars that work with vectors also work with arrays.'' °
,r' '╕(0=V)/0' °
'L13X:''No problem with simple scalars, but this rule may need modific °
ation''' °
'''when we deal with "rank zero arrays" that are not simple scalars.'' °
' '╕0' 'L14:╕(V>1)/L14X' °
''' RULE 14. Arrays with the same shape can be processed with scalar °
''' '''functions.'',r' '╕(0=V)/0' °
'L14X:''Arrays with distinct shapes can be processed as we shall see, °
but''' °
'''there will be restrictions, and we will use new operators.''' '╕0' °
'L15:╕(V>1)/L15X' °
''' RULE 15. The number of semicolons inside brackets must equal the °
''' ''' rank of the array MINUS 1.'',r' '╕(0=V)/0' °
'L15X:''There is no further generalization to this rule.''' '╕0' °
'L16:╕(V>1)/L16X' °
''' RULE 16. An axis specification can be a scalar, a vector or a''' °
''' null vector.'',r' '╕(0=V)/0' °
'L16X:''Recall that null array is the ONLY bracket specification that' °
'' °
'''makes sense for a scalar. We will use that property when dealing wi °
th''' '''rank 0 arrays.''' '╕0' 'L17:╕(V>1)/L17X' °
''' RULE 17. An axis specification can be any array containing''' °
''' valid integers.'',r' '╕(0=V)/0' °
'L17X:''With this rule, you can generate an APL2 object of arbitrary'' °
' '''rank.''' '╕0' 'L18:╕(V>1)/L18X' °
''' RULE 18. The shape of the result of axis specification is the''' °
''' catenation of the shapes of expressions inside brackets °
.''' °
''' If the expression for an axis is missing, the shape for °
''' ''' that axis is unchanged.'',r' '╕(0=V)/0' °
'L18X:''This is merely the rule for implementation of rule 17.''' °
'╕0' 'L19:╕(V>1)/L19X' °
''' RULE 19. Simple reduction of arrays removes its last dimension.' °
X',r' '╕(0=V)/0' 'L19X:''This is a generalization of rule 2.''' '╕0' °
*(1997 6 3 12 4 29 284) °
Fruled ÉFX 'V ruled W' 'Σ Additional remarks on rules' °
'╕(2=ÉNC ''V'')/L ╪ V╜0' °
'L:╕(W=19+∞10)/L20,L21,L22,L23,L24,L25,L26,L27,L28,L29' °
'''This rule number is undefined'' ╪ ╕' 'L20:╕(V>1)/L20X' °
''' RULE 20. The depth of an APL array is defined as the maximum''' °
''' depth to reach a simple scalar.'',2µr' '╕(0=V)/0' °
'L20X:''The concept of depth provides the means of building complex da °
ta''' °
'''structures. This is the first of several rules dealing with depth.' °
'' '╕0' 'L21:╕(V>1)/L21X' °
''' RULE 21. No APL2 expression can generate a depth 1 object contai °
ning''' °
''' ONLY a scalar. (Or, a scalar can not have depth 1.)'',2 °
µr' '╕(0=V)/0' °
'L21X:''This rule can be treated as an axiom of APL2. In theory it is' °
'' °
'''possible to enclose a scalar, but that would lead to a significantl °
y''' °
'''different language. EXAMPLE: The reduction of a vector must return' °
'' °
'''a scalar. Doing repeated reduction could produce enclosed scalars'' °
' °
'''that would require removal of such depths before allowing compariso °
ns.''' '╕0' 'L22:╕(V>1)/L22X' °
''' RULE 22. The depth of an array is given by the maximum length of °
''' °
''' the access vector associated with that array.'',2µr' °
'╕(0=V)/0' °
'L22X:''When you use function DISPLAY, depth can be obtained by counti °
ng''' °
'''the number of boxes you must cross from outside to reach the innerm °
ost''' '''scalar.''' '╕0' 'L23:╕(V>1)/L23X' °
''' RULE 23. Null elements of an access vector must be included to'' °
' ''' match corresponding rank zero arrays.'',2µr' °
'╕(0=V)/0' °
'L23X:''The access vector works from left to right. The leftmost eleme °
nt''' °
'''removes the outermost box, and the rightmost element removes the''' °
'''innermost box.''' '╕0' 'L24:╕(V>1)/L24X' °
''' RULE 24. The monadic disclose of a rank 0 array reveals the cont °
ents''' ''' of that array.'',2µr' '╕(0=V)/0' °
'L24X:''This is a consequence of rule 21. A simple scalar is immune to °
''' '''to the process of enclosure or disclosure.''' '╕0' °
'L25:╕(V>1)/L25X' °
''' RULE 25. The monadic disclose (without axis specification) reduc °
es''' °
''' depth by one, by adding a new last axis to the disclose °
d''' °
''' elements. FILL elements are used to complete the array. °
'',2µr' '╕(0=V)/0' °
'L25X:''The fill element for numberic arrays is zero. The fill element °
for''' °
'''character arrays is a blank. The fill element for mixed arrays in'' °
' '''APL2 will be discussed in later sessions.''' '╕0' °
'L26:╕(V>1)/L26X' °
''' RULE 26. Simple disclose requires that all components of a neste °
d''' °
''' array have the same rank (or be rank 0 arrays).'',2µr' °
'╕(0=V)/0' °
'L26X:''We use the phrase ''''simple disclose'''' because, as we will °
learn''' °
'''later, you can define your own rules on how to disclose nested''' °
'''arrays.''' '╕0' 'L27:╕(V>1)/L27X' °
''' RULE 27. Forms can be equivalent only if all rank 0 arrays conta °
in''' °
''' the same rank and shape (or rank 0 arrays)--recursively °
--'',2µr' '╕(0=V)/0' °
'L27X:''Earlier we discussed functions that are dual. These are one to °
''' °
'''one transformations of data. Equivalent forms can be thought of as' °
'' '''a kind of dual representation of data structures.''' '╕0' °
'L28:╕(V>1)/L28X' °
''' RULE 28. A zero in a partition vector will remove the associated °
''' ''' element.'',2µr' '╕(0=V)/0' °
'L28X:''The components of a partition vector must be positive integers °
or''' °
'''zero. The presence of a zero is treated much the same as in boolean °
''' '''reduction.''' '╕0' 'L29:╕(V>1)/L29X' °
''' RULE 29. Each place in the partition vector, where the value''' °
''' INCREASES marks a partition.'',2µr' '╕(0=V)/0' °
'L29X:''A partition must ocurr BETWEEN two consecutive elements. These °
''' '''need not be simple scalars'',r' °
X 'show ''DISPLAY (1 1 2 2)Γ(1 2) ''''AB'''' (3 4) ''''C''''''' '╕0' °
XCs 1 2 " °
*(1997 7 13 12 30 36 460) °
Fshow ÉFX '╢V show ╢W;╢T;╢B' 'Σ Display and execute ╢W' °
'╢T╜(0=ÉNC ''╢V'')doif ''╢V╜0''' °
'╕((0=╧╢W)doif ''show ╢W,'''' '''''')/0' °
'╕((1<╧╢W)doif ''╢V show ■╢W'')/0' ''' '',╢W' °
X '╕((╢V^'':''ε╢W)doif ''╢T╜evaldd ╢W'')/L0' ''''' ÉEA ╢W' 'L0:do' °
XCuc 1 26 ABCDEFGHIJKLMNOPQRSTUVWXYZ °
*(1997 8 26 12 41 31 540) °
Fupper ÉFX 'U╜upper U;T' 'Σ Convert lower case to upper case' °
'╕(0=µµU)/0 ╪ ╕(1=╧U)/L0 ╪ U╜upper■U ╪ ╕0' °
X 'L0:T╜lc∞U ╪ B╜T⌠27 ╪ (B/U)╜uc[B/T]' °
XCx 0 ! °