Contents. 6.1 Conditional statements 6.2 Iteration 6.3 Procedures and flow control

Size: px
Start display at page:

Download "Contents. 6.1 Conditional statements 6.2 Iteration 6.3 Procedures and flow control"

Transcription

1

2 Introduction This reference manual gives an essentially complete description of the standard facilities available in SMP. Extensive illustrative examples are included. The same text is given without these examples, and slightly shortened, in the "SMP Summary". The "SMP Primer" offers a more pedagogical but incomplete treatment. The information facility [1.2] in SMP provides on-line keyword-driven access to the contents of this document. This manual describes all standard system-defined projections [2.3] in SMP. Many enhancements and additional facilities are provided in the "SMP Library". Contents of the library may be located and perused through the information facility. Complete documentation on the SMP Library is available separately. The procedure for initiating an SMP job is described in the "Implementation Notes", together with other implementation-dependent features.

3 Contents 0. Conventions 1. Basic system operation 1.1 Input and output 1.2 Information 1.3 Global objects 1.4 External files and job recording 1.5 Termination and real-time interrupts 1.6 Monitor escapes 1.7 Edit mode 2. Syntax 2.1 Numbers 2.2 Symbols 2.3 Projections 2.4 Lists 2.5 Expressions 2.6 Patterns 2.7 Templates 2.8 Chameleonic expressions 2.9 Commentary input 2.10 Input forms 2.11 Syntax modification 2.12 Output forms 3. Fundamental operations 3.1 Automatic simplification 3.2 Assignment and deassignment 3.3 Replacements and substitutions 3.4 Numerical evaluation 3.5 Deferred simplification 3.6 Pre-simplification 3.7 Partial simplification 4. Properties 5. Relational and logical operations 6. Control structures 6.1 Conditional statements 6.2 Iteration 6.3 Procedures and flow control

4 SMP REFERENCE MANUAL / Contents 7. Structural operations 7.1 Projection and list generation 7.2 Template application 7.3 Part extraction and removal 7.4 Structure determination 7.5 Content determination 7.6 Character determination 7.7 List and projection manipulation 7.8 Distribution and expansion 7.9 Rational expression manipulation and simplification 7.10 Statistical expression generation and analysis 8. Mathematical functions 8.1 Introduction 8.2 Elementary arithmetic operations 8.3 Numerical functions 8.4 Mathematical constants 8.5 Elementary transcendental functions 8.6 Combinatorial functions 8.7 Gamma, zeta and related functions 8.8 Confluent hypergeometric and related functions 8.9 Hypergeometric and related functions 8.10 Elliptic functions 8.11 Number theoretical functions 9. Mathematical operations 9.1 Polynomial manipulation 9.2 Evaluation of sums and products 9.3 Solution of equations 9.4 Differentiation and integration 9.5 Series approximations and limits 9.6 Matrix and explicit tensor manipulation 1 0. Non-computational operations 10.1 Input and output operations 10.2 Graphical output 10.3 File input and output 10.4 Display operations 10.5 Textual operations 10.6 External operations 10.7 Code file input and generation 10.8 Resource management and analysis 10.9 Asynchronous and parallel operations

5 SMP REFERENCE MANUAL / Contents Development aids A p p e n d i x External interface A.1 Introduction A.2 External files A.3 External operations A.4 Code and program files A.5 Character codes A.6 Output characteristics A.7 Terminal characteristics A.8 System characteristics A.9 Initialization and termination I n d e x

6 0. Conventions Te xt printed in this font represents literal SMP input or output, to be typed as it appears. Te xt in italics stands for SMP input or output expressions. Arbitrary characters or textual forms are given as textual form. The actual characters corresponding to these textual forms in particular implementations are given in the "Implementation Notes". In descriptions of system-defined projections [2.3], the following notations for filters [2.3] are used: filt filt Compulsory filter. Filter used in an unsimplified or partially simplified form. [3.1, 3.6] Smp [4] (filt : val) Optional filter assumed to have value val if omitted or given as Null (a blank [2.10]). An optional filter may be omitted entirely only when it would appear after the last filter explicitly specified in a projection. f1,f2,... {f1,f2,...} filt f1,f2,... Sequence containing any number of similar filters. Filter to be given asalist of expressions. Properties carried by projections are indicated by <prop1, prop2,...>. Filter to be given either as a single expression or as a list of expressions. Filter or sequence of filters to be given either as single expressions or as lists of expressions. References to sections in the text of this reference manual are given as[ number ]. References to additional or related material are indicated by.

7 1. Basic system operation 1.1 Input and output 1.2 Information 1.3 Global objects 1.4 External files and job recording 1.5 Termination and real-time interrupts 1.6 Monitor escapes 1.7 Edit mode

8 1.1 SMP REFERENCE MANUAL / Basic system operation Input and output In standard mode the prompt for the ith input line is #I[i]::. Input is terminated by a newline. delete character may be used in unfinished input lines. All tab and unnecessary [2.10] spaces are ignored, unless they appear in quoted strings [2.2]. Input may be continued for several lines by placing \ (backslash) at the end of each intermediate line. If no text is entered before the terminating newline, the input is considered null, and the prompt is reissued. The result generated by processing an input line is usually printed. No output is printed if ; (semicolon) is placed at the end of the input expression [6.3], or in general if the output expression is Null [2.2]. Input of expressions with ambiguous syntax [2] yields a message on the nature of the ambiguity, and causes edit mode [1.7] to be entered. The input text is placed in the edit buffer, with the cursor positioned under the point at which the ambiguity was detected. [2.10] In display input mode [10.4] a pointer may be used to locate and select parts of displayed expressions. Printed output is given in a two-dimensional format based on standard mathematical notation. Specification of certain output characteristics [A.6] will cause printing of large expressions to pause periodically, issuing <pause> as a prompt. Printing will resume on entry of newline. [2.12] Lpr [10.1] Graphical output may also be obtained [10.2]. #I[1]:: #O[1]: #I[2]:: #O[2]: -x+2x+a*y x + a y -x + 2 x+a * y x + a y #I[3]:: "-x + 2 x+a * y" #O[3]: "-x + 2 x+a * y" #I[4]:: #O[4]: x+y+z\ +y+z\ +z x + 2y + 3z #I[5]:: 8/9-1/7 #O[5]: 47/63 #I[6]:: 8/9-1/7 ; #I[7]:: Pr[8/9-1/7] ; 47/63 #I[8]:: (a+b+)*q ) unexpected (a+b+)*q <edit> ˆc (a+b+c)*q <edit> #O[8]: q (a + b + c)

9 1.1 SMP REFERENCE MANUAL / Basic system operation 1.1 #I[9]:: (xˆ2+yˆ2)/(xˆ(a+1)+zˆ3)ˆ4 2 2 x + y #O[9]: a 3 4 (x + z )

10 1.2 SMP REFERENCE MANUAL / Basic system operation Information (Implementation dependent)? k e y w o r ds enters information mode and retrieves available information associated with keywords. keywords may be a single word or a phrase of several words specifying the topic on which information is sought. Typographical case is ignored, and some words may be stripped to canonical roots.?? p a t t e r n enters information mode and retrieves available information associated with the symbols, projectors or external files whose names match pattern. pattern is a single "word" possibly containing the characters *, which matches an arbitrary sequence of characters, and., which matches an arbitrary single character. A literal * is entered by ˆ*,aliteral. by ˆ.. Dsp [10.6]? enters information mode and prompts for further input. When information has been retrieved, a menu of items related to keyword or pattern is displayed; the user is prompted for a command to select an item or to initiate further searching. In information mode, the command? displays a summary of the commands available. Information is provided on external files in the SMP Library as well as on all standard facilities in SMP. Facilities enabling users to add information on their own external files to the information mode database are described in the Implementation Notes. Init [10.6]

11 1.3 SMP REFERENCE MANUAL / Basic system operation Global objects % The last expression (other than N u l l [2.2]) generated. # I [ i ] The i th (unsimplified) input expression. (Assigned after the corresponding output expression is generated.) < L d i s t > # O [ i ] The i th output expression. < L d i s t > # T [ i ] The approximate time (in seconds [A.8]) required to generate # O [ i ]. < L d i s t > Time [10.8] Clock i Equivalent to # O [ i]. <L d i s t > % %, % I, % O, % T [6.3] # I [ 1 ] : : t : ( a + b ) # O [ 1 ] : a + b # I [ 2 ] : : % ˆ 2-2 % 2 # O [ 2 ] : - 2 a - 2 b + ( a + b ) # I [ 3 ] : : 3 t - 4 ; # I [ 4 ] : : 2 / % 2 # O [ 4 ] : a + 3 b # I [ 5 ] : : # O 2 # O [ 5 ] : { [ 4 ] : , [ 3 ] : a + 3 b, a + 3 b # I [ 6 ] : : P r [ t ] a + b # O [ 6 ] : a + b # I [ 7 ] : : # O [ 6 ] # O [ 7 ] : a + b # I [ 8 ] : : # I [ 6 ] a + b # O [ 8 ] : a + b 2 [ 2 ] : - 2 a - 2 b + ( a + b ), [ 1 ] : a + b, [ 0 ] : { " / h o m e / c m c / m k / s m p. i n i t " } }

12 1.3 SMP REFERENCE MANUAL / Basic system operation 1.3 # I [ 9 ] : : E v [ # I [ 6 ] ] # O [ 9 ] : P r [ t ] # I [ 1 0 ] : : # T # O [ 1 0 ] : { [ 9 ] : 1 / 6 0, [ 8 ] : 1 / 6 0, [ 7 ] : 0, [ 6 ] : 0, [ 5 ] : 0, [ 4 ] : 0, # I [ 1 1 ] : : b 2 # O [ 1 1 ] : - b a + b # I [ 1 2 ] : { 1, 2, 3, 2 0 } [ 3 ] : 1 / 6 0, [ 2 ] : 0, [ 1 ] : 0, [ 0 ] : 0 } 2 # O [ 1 2 ] : { a + b, - 2 a - 2 b + ( a + b ), a + 3 b, # O [ 2 0 ] } P r e P o s t Symbol whose value (if any) is taken as a template [2.7] and applied as a "preprocessor" on each input expression. Symbol whose value (if any) is taken as a template and applied as a "postprocessor" on each output expression. # I [ 1 ] : : / 6 # O [ 1 ] : 7 / 6 # I [ 2 ] : : P o s t : : N # O [ 2 ] : N # I [ 3 ] : : / 6 # O [ 3 ] : # I [ 4 ] : : P o s t : # I [ 5 ] : : / 6 # O [ 5 ] : 7 / 6

13 1.4 SMP REFERENCE MANUAL / Basic system operation External files and job recording External files are input by < fi l e. [10.3] Dsp, Dir [10.6] Load [10.7] All input and output expressions are entered into a record file usually named s m p. o u t. (Implementation dependent) Open, Put [10.3] Hard, Save [10.6]

14 1.5 SMP REFERENCE MANUAL / Basic system operation Termination and real-time interrupts (Implementation dependent) i n p u t t e r m i n a t i o n character signifies termination of the current procedure. In standard and edit modes, it causes termination of the present job; in subsidiary mode, it results in return to the previous mode. R e t [6.3] Exit [10.6] q u i t i n t e r r u p t attempts to terminate current processing or printing. Subsequent references to incompletely processed expressions cause their simplification to be completed. b r eakinterrupt causes any processing to be suspended and initiates an interactive subsidiary procedure. G e t [10.3] s t a t u s interrupt prints the status of processing, including a stack of the last few projections simplified. M e m [10.8] T r a c e [4] # I [ 1 ] : : D [ x ˆ x ˆ x, { x, 2 } ] q u i t i n t e r r u p t < q u i t > # I [ 2 ] : : D [ x ˆ x, x ] x x # O [ 2 ] : x L o g [ x ] + x # I [ 3 ] : 1 x x x x x x + x x # O [ 3 ] : x ( x L o g [ x ] + x ) + x ( x + x ) q u i t i n t e r r u p t < q u i t > # I [ 4 ] : : F o r [ i : 0 ; d [ 0 ] : x ˆ x ; s [ 0 ] : 1, i < = 6, I n c [ i ], d [ i + 1 ] : E x [ D [ d [ i ], x ] ] ; \ s [ i + 1 ] : S [ d [ i + 1 ], x - > 1 ] ] ; s s t a t u s interrupt < s t a t u s > < P l u s P l u s P l u s P l u s P o w M u l t L o g P o w P l u s > < s i m p l i f i e r e n t r i e s ; B l o c k s u s e d > s t a t u s interrupt < s t a t u s > < R e p P l u s P o w P l u s P o w L o g P o w M u l t > < s i m p l i f i e r e n t r i e s ; B l o c k s u s e d > b r eak interrupt < b r e a k > % I [ 1 ] : : i % O [ 1 ] : 5 % I [ 2 ] : : s % O [ 2 ] : { [ 4 ] : 8, [ 3 ] : 3, [ 2 ] : 2, [ 1 ] : 1, [ 0 ] : 1 }

15 1.5 SMP REFERENCE MANUAL / Basic system operation 1.5 % I [ 3 ] : : S i z e [ d [ 4 ] ] % O [ 3 ] : { 1 6 0, } % I [ 3 ] : : i n p u t t e r m i n a t i o n character < e n d > # O [ 4 ] : { [ 6 ] : 5 4, [ 5 ] : 1 0, [ 4 ] : 8, [ 3 ] : 3, [ 2 ] : 2, [ 1 ] : 1, [ 0 ] : 1 } s t a t u s interrupt < s t a t u s > < r e c l a i m i n g m e m o r y > # I [ 5 ] : :

16 1.6 SMP REFERENCE MANUAL / Basic system operation Monitor escapes (Implementation dependent)! m o n i t o r command given directly (with no prior characters typed) at an input prompt executes the specified monitor (shell) command; the original input prompt is then reissued. R u n [10.6] # I [ 1 ] : :! d a t e F r i M a y : 5 9 : 5 9 P D T # I [ 1 ] : :

17 1.7 SMP REFERENCE MANUAL / Basic system operation Edit mode In edit mode, one line of text is treated at a time. The editing of each line proceeds by a repetition of two steps: 1. The present form of the line is printed. 2. Following the prompt <edit> any editing commands for the line are entered. The commands are terminated by n e wline. s p a c e t a b and c haracterdelete may be used for positioning in local editing. If no editing commands are given instep 2 (the terminating newline is entered directly after the < e d i t > prompt), then the present line is left unchanged. If further lines of text exist, the editor moves to the next line; otherwise, edit mode is exited, and the edited text is returned as an input expression. If at the exit from edit mode, no editing has actually been performed, the text is discarded, leaving a null line. Tw o types of editing may be performed: Local editing, in which individual characters in the edit command affect the characters appearing directly above them in the present line. Global editing, in which an edit command prefaced by \ affects the whole present line or the entire edit buffer. Local editing # Delete character above. \ d Delete the remainder of the present line. s p a c e or t a b ˆ t e x t o t h e r character Leave character(s) above unchanged. Insert t e x t terminated by a space or tab (not appearing between " ") into the present line before the character above. Replace character above by character given. Note that a character may be replaced with # by the command # ˆ #. Global editing \ p Print the text in the edit buffer and return to the present line. \ w fi l e Append the text in the edit buffer to the specified file. \ q Exit from edit mode, discarding the edited expression. \ n Move to the nth line of the edit buffer, leaving the present line unchanged. \ + n and \ - n move n lines forward and backward respectively; \ + and \ - move one line. \ u Undo the most recent edit command which effected changes in the edit buffer. \ r Undo all changes made during the current editing session, restoring the original contents of the edit buffer. \ m Display levels of parentheses, braces and brackets in the present line. \ m g Display levels of parentheses, braces and brackets throughout the text. \ s / e 1 / e 2 Te xtually substitute e 2 for the character string e 1 throughout the present line. (The delimiter here given as / may be replaced by any character.) \ s n / e 1 / e 2 Te xtually substitute e 2 for the n th occurrence of character string e 1 in the present line. \ g / e 1 / e 2 Te xtually substitute for e 1 throughout the text. \ e Invoke external editor [A.9] on the text in the edit buffer and return the modified text. (Implementation dependent) \! m o n i t o r command Execute the specified monitor command [2.7].

18 1.7 SMP REFERENCE MANUAL / Basic system operation 1.7 The typographical case of the commands d, p, q, e t c.isignored. Ed, Edh [10.5] # I [ 1 ] : : a ˆ ˆ b * * c + + d ˆ u n e x p e c t e d a ˆ ˆ b * * c + + d < e d i t > # # # ˆ ˆ a ˆ b ˆ c + + d < e d i t > a ˆ b ˆ c < e d i t > ˆ " " a ˆ b ˆ c < e d i t > \ d a < e d i t > \ u a ˆ b ˆ c < e d i t > \ u a < e d i t > # O [ 1 ] : a # I [ 2 ] : : f [ f [ f [ f [ f [ x ] ] ] ] + \ ( a + 1 ) ( b + 1 ) ( c + 1 ) / a b c + \ c a t c a t c a t n e w l i n e u n e x p e c t e d c a t c a t c a t < e d i t > \ m g f [ f [ f [ f [ f [ x ] ] ] ] + \ \ ( a + 1 ) ( b + 1 ) ( c + 1 ) / a b c + \ \ c a t c a t c a t c a t c a t c a t < e d i t > \ 1 f [ f [ f [ f [ f [ x ] ] ] ] + \ < e d i t > ˆ ] f [ f [ f [ f [ f [ x ] ] ] ] ] + \ < e d i t > \ m f [ f [ f [ f [ f [ x ] ] ] ] ] + \ f [ f [ f [ f [ f [ x ] ] ] ] ] + \ < e d i t > \ + 2 c a t c a t c a t < e d i t > \ s / c / f f a t f a t f a t < e d i t > \ s 3 / f / c f a t f a t c a t < e d i t > \ g / f / c c a t c a t c a t < e d i t > \ p c [ c [ c [ c [ c [ x ] ] ] ] ] + \ ( a + 1 ) ( b + 1 ) ( c + 1 ) / a b c + \ c a t c a t c a t c a t c a t c a t < e d i t > \ r c a t c a t c a t < e d i t > \ p f [ f [ f [ f [ f [ x ] ] ] ] + \ ( a + 1 ) ( b + 1 ) ( c + 1 ) / a b c + \ c a t c a t c a t c a t c a t c a t < e d i t > ] c a t c a t c a t ] < e d i t > ( 1 + a ) ( 1 + b ) ( 1 + c ) # O [ 2 ] : f [ c a t c a t c a t + f [ f [ f [ f [ x ] ] ] ] ] a b c

19 1.7 SMP REFERENCE MANUAL / Basic system operation Syntax 2.1 Numbers 2.2 Symbols 2.3 Projections 2.4 Lists 2.5 Expressions 2.6 Patterns 2.7 Templates 2.8 Chameleonic expressions 2.9 Commentary input 2.10 Input forms 2.11 Syntax modification 2.12 Output forms

20 2.1 SMP REFERENCE MANUAL / Syntax Numbers Numbers input with no decimal point are taken as exact integers. Floating point numbers may be entered in the form x * ˆ p representing x 10 p. Numbers are output if possible in integer or rational form, except when the corresponding input expression contains explicit floating point numbers or N projections [3.4]. Output floating point numbers are given to the precision specified in input N projections, or, bydefault, to 6 significant figures. Numbers are by default treated to a finite precision (fractional accuracy oforder ). # I [ 1 ] : : 1 7 / / 5 # O [ 1 ] : / 3 5 # I [ 2 ] : : N [ % ] # O [ 2 ] : # I [ 3 ] : : / / 5 # O [ 3 ] : # I [ 4 ] : : N [ %, 1 4 ] # O [ 4 ] : * ( ) # I [ 5 ] : : c i : 3 * ˆ - 8 # O [ 5 ] : * ˆ - 8 # I [ 6 ] : : 1 + ( 1 / ) ˆ 8 8 # O [ 6 ] : / # I [ 7 ] : : % # O [ 7 ] : 1 / Further numerical constructs (which may be used in any numerical operations) are: A [ x, (p : 0 )] Arbitrary magnitude number x 10 p. Floating point numbers are usually converted to this form when the modulus of their exponent exceeds 10. B [ n k,..., n 2, n 1, n 0 ] Arbitrary length integer n 0 + n n generated when integers with more than 10 digits are input. F [ n 1, n 2,...,(expt: 0 ),(di g : 6 )] Floating point number (n n ) 10 e x p t with dig significant digits. F projections are generated if possible when the precision specified in an N projection exceeds 10. Expressions involving several F projections are treated to the numerical accuracy ofthe least precise F given. E r r [ x, d x ] Number x with one-standard-deviation error d x ( x ± d x ). Errors are combined assuming statistical independence, and are evaluated for all projections carrying property L d i s t [4]. C x [ x, y ] Complex number x + I y. Automatically generated when required.

21 2.1 SMP REFERENCE MANUAL / Syntax 2.1 The presence of any A, B or F projections in an expression forces conversion of all numbers to these forms. # I [ 1 ] : : h : * ˆ # O [ 1 ] : * ˆ # I [ 2 ] : : h ˆ 8 # O [ 2 ] : * ˆ # I [ 3 ] : : # O [ 3 ] : * ( ) # I [ 4 ] : : % ˆ 2 # O [ 4 ] : * ( ) # I [ 5 ] : : % / ( ) # O [ 5 ] : * ( ) # I [ 6 ] : : 1 0 0! # O [ 6 ] : * ( \ # I [ 7 ] : : N [ % ] # O [ 7 ] : * ( * ˆ ) # I [ 8 ] : : N [ 1 / 7, 5 0 ] \ ) # O [ 8 ] : * ( ) # I [ 9 ] : : N [ 1. 1 / 7, ] # O [ 9 ] : * ( \ ) # I [ 1 0 ] : : E r r [ 6. 1, 0. 5 ] + E r r [ 8. 9, 0. 7 ] # O [ 1 0 ] : E r r [ 1 5, ] # I [ 1 1 ] : : ( I ) ( I ) # O [ 1 1 ] : * I # I [ 1 2 ] : : L p r [ % ] C x [ - 3 0, 7 2 ]

22 2.2 SMP REFERENCE MANUAL / Syntax Symbols Symbols are the basic objects of SMP. They may be assigned values [3.2] and properties [4]. Symbol names may be Strings of arbitrary length containing only alphanumeric characters, together with #, $ and % and not starting with numeric characters. Arbitrary character strings (possibly containing control characters) enclosed between " ". The " " serve only to delimit the symbol name and do not affect simplification of the symbol; they are printed on output only when necessary. [A.5] Symbols whose names have the following forms are taken to have special characteristics (ccc represents any valid symbol name): $ c c c Generic symbol (representing an arbitrary expression [2.6]). Gen [4, 2.6] $ $ c c c Multi-generic symbol (representing an arbitrary sequence of expressions [2.6]). M g e n [4] # # c c c Chameleonic symbol (whose name changes whenever itisevaluated [2.8]). C h a m [4] No values may be assigned to symbols of these types. The following naming conventions are used (C denotes any upper case alphabetic character): C c c c System-defined symbol. # c c c Internally-generated symbol. % c c c Symbol used locally within a procedure [6.3]. Some special system-defined symbols are: N u l l Input and output as a blank [2.10]. Often used to indicate "default" filters [0, 2.3]. I n f I Infinity. Used primarily to specify indefinite continuation of a process, rather than as a signal for mathematical infinities. The imaginary unit. %, # I, # O, # T [1.3] % %, % I, % O, % T [6.3] P i, E, e t c.[8.4] Terminal [10.3] # I [ 1 ] : : 1 + E i g h t h O r d e r T e r m # O [ 1 ] : 1 + E i g h t h O r d e r T e r m # I [ 2 ] : : { a 2, " a 2 ", 4 4, " 4 4 ", " 8 t h o r d e r ", " " } # O [ 2 ] : { a 2, a 2, 4 4, " 4 4 ", " 8 t h o r d e r ", " \ \ \ " } # I [ 3 ] : : P r [ n u m b e r, " s q u a r e o f n u m b e r " ] ; D o [ i, 3, P r [ i, i ˆ 2 ] ] n u m b e r s q u a r e o f n u m b e r # O [ 3 ] : 9

23 2.2 SMP REFERENCE MANUAL / Syntax 2.2 # I [ 4 ] : : f [ $ x ] : $ x ˆ 2 2 # O [ 4 ] : $ x # I [ 5 ] : : f [ a ] + f [ b ] 2 2 # O [ 5 ] : a + b # I [ 6 ] : : _ $ x # O [ 6 ] : { [ G e n ] : 1 } # I [ 7 ] : : g [ $ $ x ] : h [ 1, $ $ x, 2 ] # O [ 7 ] : h [ 1, $ $ x, 2 ] # I [ 8 ] : : g [ a, b ] + g [ z ] + g [ ] # O [ 8 ] : h [ 1, z, 2 ] + h [ 1,, 2 ] + h [ 1, a, b, 2 ] # I [ 9 ] : : _ $ $ x # O [ 9 ] : { [ G e n ] : 1, [ M g e n ] : 1 } # I [ 1 0 ] : : t : : # # v + # # w # O [ 1 0 ] : # # v + # # w # I [ 1 1 ] : : t # O [ 1 1 ] : # 1 + # 2 # I [ 1 2 ] : : t # O [ 1 2 ] : # 3 + # 4 # I [ 1 3 ] : : _ # # v # O [ 1 3 ] : { [ C h a m ] : 1 } # I [ 1 4 ] : : { _ L o g, _ l o g, _ P i, _ p i } # O [ 1 4 ] : { { [ S y s ] : 1, [ T i e r ] : 1, [ L d i s t ] : 1 }, _ l o g, { [ C o n s t ] : 1 }, _ p i } # I [ 1 5 ] : : I n t [ $ x ˆ 2, $ x ] 3 $ x # O [ 1 5 ] : # # I [ 1 6 ] : : L p r [ p [ ] + q [, a,, b, ] + r [ {, } ] ] p [ N u l l ] + q [ N u l l, a, N u l l, b, N u l l ] + r [ { N u l l, N u l l } ] # I [ 1 7 ] : : w [ x ] : N u l l # I [ 1 8 ] : : a + w [ x ] # O [ 1 8 ] : a + w [ x ] # I [ 1 9 ] : : M a p [ q, ( a + b ) ˆ ( c + d ), 1 ] q [ c + d ] # O [ 1 9 ] : q [ a + b ]

24 2.2 SMP REFERENCE MANUAL / Syntax 2.2 # I [ 2 0 ] : : M a p [ q, ( a + b ) ˆ ( c + d ), I n f ] q [ q [ c ] + q [ d ] ] # O [ 2 0 ] : q [ q [ a ] + q [ b ] ] # I [ 2 1 ] : : I ˆ 2 # O [ 2 1 ] : - 1

25 2.3 SMP REFERENCE MANUAL / Syntax Projections Projections specify parts of general structures. They are analogous to array subscriptings or function calls. In for example the projection f [ x, y ] the symbol f is termed the "projector", and x, y its "filters". These filters are used to select a part in the value of f. P r o j [7.3] Unless the projector f carries the properties Tier, Flat, Comm or Reor [4], f [x,y] is equivalent to f [ x ] [ y ],and the filters x and y are used successively (from left to right) to select a part in the value of f. The value of f [ x ] is found first, and then the projection of the resulting expression with the filter y is obtained. When f does carry T i e r properties, filters separated by commas are instead used together. Projections from f whose values were assigned before the Tier, Flat, Comm or Reor properties were assigned may be converted to tiered format by the projection T i e r [7.7]. Common system-defined projections may be input in special forms [2.10]. Filters for system-defined projections input as N u l l [2.2] (a blank [2.10]) are taken to have their default values. L [10.4] # I [ 1 ] : : u : b ˆ 2-4 a * c 2 # O [ 1 ] : - 4 a c + b # I [ 2 ] : : u [ 1 ] # O [ 2 ] : - 4 a c # I [ 3 ] : : u [ 2, 2 ] # O [ 3 ] : 2 # I [ 4 ] : : u [ 0 ] # O [ 4 ] : P l u s # I [ 5 ] : : u [ x ] # O [ 5 ] : u [ x ] # I [ 6 ] : : f : { [ x ] : { [ y ] : a 1, [ y p ] : a 2 }, [ x p ] : b } # O [ 6 ] : { [ x ] : { [ y ] : a 1, [ y p ] : a 2 }, [ x p ] : b } # I [ 7 ] : : f [ x ] # O [ 7 ] : { [ y ] : a 1, [ y p ] : a 2 } # I [ 8 ] : : f [ x, y ] # O [ 8 ] : a 1 # I [ 9 ] : : f [ x ] [ y ] # O [ 9 ] : a 1 # I [ 1 0 ] : : f _ : T i e r # O [ 1 0 ] : T i e r # I [ 1 1 ] : : f [ x ] # O [ 1 1 ] : f [ x ]

26 2.3 SMP REFERENCE MANUAL / Syntax 2.3 # I [ 1 2 ] : : f [ x, y ] # O [ 1 2 ] : f [ x, y ] # I [ 1 3 ] : : f : T i e r [ f ] # O [ 1 3 ] : { [ [ x, y ] ] : a 1, [ [ x, y p ] ] : a 2, [ [ x p ] ] : b } # I [ 1 4 ] : : f [ x ] # O [ 1 4 ] : f [ x ] # I [ 1 5 ] : : f [ x, y ] # O [ 1 5 ] : a 1 # I [ 1 6 ] : : g [ x ] [ y ] # O [ 1 6 ] : g [ x, y ] # I [ 1 7 ] : : g _ : T i e r # O [ 1 7 ] : T i e r # I [ 1 8 ] : : g [ x ] [ y ] # O [ 1 8 ] : P r o j [ g [ x ], { y } ] # I [ 1 9 ] : : M u l t [ a, b, c ] # O [ 1 9 ] : a b c # I [ 2 0 ] : : a * b * c # O [ 2 0 ] : a b c # I [ 2 1 ] : : R a n d [ ] # O [ 2 1 ] : [ x 1, x 2,...] or N p [ x 1, x 2,...] is a special system-defined null projection representing a sequence of expressions. A first step in the simplification of any projection is the replacement of null projections appearing as its filters by explicit sequences of filters. Sequences of values in contiguous lists may also be given asnull projections [2.4]. The value of a list element whose index is a null projection is extracted by projection with a sequence of filters corresponding to all those of the null projection. Such list elements are generated by assignments for projections carrying the properties Tier, Flat, Comm or Reor [4], or containing explicit null projections as filters (the partial simplification in Set [3.2] does not replace such null projections). No values may be assigned [3.2] directly to null projections. Removal ofinput null projections occurs through a type extension mechanism [4]. Seq, Repl [7.1] # I [ 1 ] : : r : [ [ x, y, z ] ] # O [ 1 ] : [ x, y, z ] # I [ 2 ] : : f [ r, w, [ r, w ] ] # O [ 2 ] : f [ x, y, z, w, x, y, z, w ] # I [ 3 ] : : { [ [ a ], b ], c, [ d, e ] } # O [ 3 ] : { a, b, c, d, e }

27 2.3 SMP REFERENCE MANUAL / Syntax 2.3 # I [ 4 ] : : # O [ 4 ] : [ 1, 2, 3, 4, 5 ] # I [ 5 ] : : f [ $ x ] : $ x # O [ 5 ] : $ x # I [ 6 ] : : f [ a, b, c ] # O [ 6 ] : f [ a, b, c ] # I [ 7 ] : : f [ $ $ x ] : $ $ x # O [ 7 ] : $ $ x # I [ 8 ] : : f [ a, b, c ] # O [ 8 ] : [ a, b, c ] ` e x p r or M a r k [ e x p r ] is used in a variety of cases to designate expressions with special characteristics. (Prefix form is "backquote" or "grave accent" character.) [2.7] # I [ 1 ] : : f [ ` 1, ` x + y, ` a + ` b, ` ` c, ` g [ x ], { ` { { } } } ] # O [ 1 ] : f [ ` 1, ` x + y, ` a + ( ` b ), ` ( ` c ), ` g [ x ], { ` { { } } } ] # I [ 2 ] : : A p [ f, { a, b } ] # O [ 2 ] : f [ a, b ] # I [ 3 ] : : A p [ ` f, { a, b } ] # O [ 3 ] : f

28 2.4 SMP REFERENCE MANUAL / Syntax Lists Lists are indexed and ordered sets of expressions. Lists may be input directly in the form { [i n d e x 1 ] : v a l u e 1, [i n d e x 2 ] : v a l u e 2,...}. Entries with delayed rather than immediate values [3.2] are input with : : instead of :. If the expressions i n d e x i are successive integers starting at 1, they may be omitted. The list may then be input as { v a l u e 1, v a l u e 2,...}.Such lists are termed "contiguous". L i s t [7.1] { } is a zero-length list containing no entries. List entries may also be specified indirectly through assignments for projections [3.2]. A value in a list may be extracted by a projection [2.3] with its index as a filter. Values corresponding to indices consisting of null projections [2.3] (as generated by assignments for projections with properties Tier, Flat or R e o r [4]) are extracted by sequences of filters. A r [7.1] # I [ 1 ] : : r : { [ x ] : a, [ y ] : : R a n d [ ], [ $ x ] : $ x - 3 } # O [ 1 ] : { [ x ] : a, [ y ] : : R a n d [ ], [ $ x ] : $ x } # I [ 2 ] : : t : { a, b, c } # O [ 2 ] : { a, b, c } # I [ 3 ] : : t [ 5 ] : e # O [ 3 ] : e # I [ 4 ] : : t # O [ 4 ] : { [ 5 ] : e, [ 1 ] : a, [ 2 ] : b, [ 3 ] : c } # I [ 5 ] : : t [ 4 ] : d # O [ 5 ] : d # I [ 6 ] : : t # O [ 6 ] : { a, b, c, d, e } # I [ 7 ] : : L p r [ { { }, {, } } ] { { }, { N u l l, N u l l } } # I [ 8 ] : : r [ x ] : b # O [ 8 ] : b # I [ 9 ] : : r # O [ 9 ] : { [ x ] : b, [ y ] : : R a n d [ ], [ $ x ] : $ x } # I [ 1 0 ] : : r [ x ] # O [ 1 0 ] : b # I [ 1 1 ] : : r [ y ] # O [ 1 1 ] :

29 2.4 SMP REFERENCE MANUAL / Syntax 2.4 # I [ 1 2 ] : : r [ y ] # O [ 1 2 ] : # I [ 1 3 ] : : r [ z ] # O [ 1 3 ] : z

30 2.5 SMP REFERENCE MANUAL / Syntax Expressions Expressions are combinations of symbols, projections and lists. Parts of expressions are selected by projections [2.3, 7.3]. Values in a list are specified by their indices [2.4]. Parts in projections are specified by numerical filters: 0 specifies the projector (which is always in a "held" form [3.5]) and 1,2,3,... label each of its filters. Numerical coefficients of symbols and projections are specified by the filter - 1.The 0 part of a symbol is the symbol itself, without any associated numerical coefficients. N c [7.9] Pos, Dis [7.3] L [10.4] A t [7.2] # I [ 1 ] : : t : { [ x ] : c, [ y ] : { a 1, a 2 } } # O [ 1 ] : { [ x ] : c, [ y ] : { a 1, a 2 } } # I [ 2 ] : : t [ y ] # O [ 2 ] : { a 1, a 2 } # I [ 3 ] : : t [ y ] [ 1 ] # O [ 3 ] : a 1 # I [ 4 ] : : t [ y, 2 ] # O [ 4 ] : a 2 # I [ 5 ] : : u : 2 a - 3 f [ x, y ˆ 2 ] / f [ x, y ] # O [ 5 ] : 2 a # I [ 6 ] : : u [ 1 ] # O [ 6 ] : 2 a # I [ 7 ] : : u [ 2, 1 ] # O [ 7 ] : x # I [ 8 ] : : u [ 2, 2 ] 2 # O [ 8 ] : y # I [ 9 ] : : % [ 1 ] # O [ 9 ] : y # I [ 1 0 ] : : u [ 0 ] # O [ 1 0 ] : P l u s # I [ 1 1 ] : : u [ 1 ] [ 0 ] # O [ 1 1 ] : a # I [ 1 2 ] : : u [ 2 ] [ 0 ] # O [ 1 2 ] : f

31 2.5 SMP REFERENCE MANUAL / Syntax 2.5 # I [ 1 3 ] : : u [ - 1 ] # O [ 1 3 ] : 1 # I [ 1 4 ] : : u [ 1, - 1 ] # O [ 1 4 ] : 2 # I [ 1 5 ] : : u [ 2, - 1 ] # O [ 1 5 ] : - 3 / 5 # I [ 1 6 ] : : u [ 5 ] # O [ 1 6 ] : u [ 5 ] # I [ 1 7 ] : : P o s [ x, u ] # O [ 1 7 ] : { { 2, 1 } } # I [ 1 8 ] : : P o s [ 2, u ] # O [ 1 8 ] : { { 2, 2, 2 } } # I [ 1 9 ] : : D i s [ u ] 2-3 f [ x, y ] # O [ 1 9 ] : { [ 0 ] : P l u s, [ 1 ] : 2 a, [ 2 ] : } 5 The n t h "level" in an expression is the set of parts which may be selected by n filters (when n is a positive integer). The "depth" of an expression is one plus the maximum number of filters necessary to specify any part [7.4]. The - n th level inanexpression is the set of parts which have depth n. Adomain is a set of parts in an expression. Domains may be specified by a parameter l e v s p e c giving the levels at which its elements may occur (n i are positive integers): n Levels 0 through n. - n Levels - 1 through - n. { ± n } Level ± n. { ± n 1, ± n 2 } Levels ± n 1 through ± n 2. { - n 1, n 2 } The intersection of levels - 1 through - n 1 and levels 0 through n 2. {l1,l2,levcrit } Levels specified by {l1,l2 } on which application of the template [2.7] levcrit does not yield false [5]. Domains may also be selected by requiring that application of a template [2.7] domcrit to any of their parts should yield true [5]. Many system-defined projections may carry filters which select particular domains. A repeat count rpt is usually given to specify the number of times an operation is to be performed successively on a particular domain (I n f causes repetition to continue until the domain no longer changes or a processing impasse is reached). A parameter max is used to determine the total maximum number of operations performed on any domain. The filters levspec, rpt, domcrit, max (or some subset of these) constitute a "domain specification". In treatment of a domain containing positive levels, larger subparts of an expression are treated first, following by their progressively smaller subparts. In a domain containing negative levels, the smallest subparts are treated first. Different parts at the same level are ordered by their "positions" (the sequences of filters necessary to select them). When rpt is specified, the subparts appearing in a domain are re-determined each time the operation is performed. # I [ 1 ] : : D e p [ a ] # O [ 1 ] : 1

32 2.5 SMP REFERENCE MANUAL / Syntax 2.5 # I [ 2 ] : : D e p [ a + b + c ] # O [ 2 ] : 2 # I [ 3 ] : : t : a + a ˆ ( b c ) + g [ g [ { x, { y, z } } ] ] b c # O [ 3 ] : a + g [ g [ { x, { y, z } } ] ] + a # I [ 4 ] : : D e p [ t ] # O [ 4 ] : 6 # I [ 5 ] : : P o s [ a, t ] # O [ 5 ] : { { 1 }, { 3, 1 } } # I [ 6 ] : : P o s [ z, t ] # O [ 6 ] : { { 2, 1, 1, 2, 2 } } # I [ 7 ] : : P o s [ g, t ] # O [ 7 ] : { { 2, 0 }, { 2, 1, 0 } } # I [ 8 ] : : M a p [ f, t ] b c # O [ 8 ] : f [ a ] + f [ g [ g [ { x, { y, z } } ] ] ] + f [ a ] # I [ 9 ] : : M a p [ f, t, { 2 } ] f [ b c ] # O [ 9 ] : a + g [ f [ g [ { x, { y, z } } ] ] ] + f [ a ] # I [ 1 0 ] : : M a p [ f, t, 2 ] f [ b c ] # O [ 1 0 ] : f [ a ] + f [ g [ f [ g [ { x, { y, z } } ] ] ] ] + f [ f [ a ] ] # I [ 1 1 ] : : M a p [ f, t, I n f ] # O [ 1 1 ] : f [ a ] + f [ g [ f [ g [ f [ { f [ x ], f [ { f [ y ], f [ z ] } ] } ] ] ] ] ] # I [ 1 2 ] : : M a p [ f, t, { - 1 } ] f [ f [ b ] f [ c ] ] + f [ f [ a ] ] f [ b ] f [ c ] # O [ 1 2 ] : f [ a ] + g [ g [ { f [ x ], { f [ y ], f [ z ] } } ] ] + f [ a ] # I [ 1 3 ] : : M a p [ f, t, - 1 ] f [ b ] f [ c ] # O [ 1 3 ] : f [ a ] + g [ g [ { f [ x ], { f [ y ], f [ z ] } } ] ] + f [ a ] # I [ 1 4 ] : : M a p [ f, t, { - 2 } ] f [ b c ] # O [ 1 4 ] : a + g [ g [ { x, f [ { y, z } ] } ] ] + a # I [ 1 5 ] : : M a p [ f, t, - 2 ] f [ f [ b ] f [ c ] ] # O [ 1 5 ] : f [ a ] + g [ g [ { f [ x ], f [ { f [ y ], f [ z ] } ] } ] ] + f [ a ]

33 2.5 SMP REFERENCE MANUAL / Syntax 2.5 # I [ 1 6 ] : : M a p [ f, t, - I n f ] # O [ 1 6 ] : f [ a ] + f [ g [ f [ g [ f [ { f [ x ], f [ { f [ y ], f [ z ] } ] } ] ] ] ] ] # I [ 1 7 ] : : M a p [ f, t, { 2, 3 } ] f [ f [ b ] f [ c ] ] + f [ f [ a ] ] f [ f [ b ] f [ c ] ] # O [ 1 7 ] : a + g [ f [ g [ f [ { x, { y, z } } ] ] ] ] + f [ a ] # I [ 1 8 ] : : M a p [ f, t, { - 2, 3 } ] f [ f [ b ] f [ c ] ] # O [ 1 8 ] : f [ a ] + g [ g [ { x, { y, z } } ] ] + f [ a ] # I [ 1 9 ] : : M a p [ f, t, { 0, I n f, E v e n p } ] f [ b c ] # O [ 1 9 ] : a + g [ f [ g [ { f [ x ], f [ { y, z } ] } ] ] ] + f [ a ] # I [ 2 0 ] : : M a p [ f, t, 0 ] b c # O [ 2 0 ] : a + g [ g [ { x, { y, z } } ] ] + a # I [ 2 1 ] : : M a p [ f, t, I n f,, $ x ] # O [ 2 1 ] : f [ a, 1 ] + f [ g [ f [ g [ f [ { f [ x, 4 ], f [ { f [ y, 5 ], f [ z, 5 ] }, 4 ] }, 3 ] ], 2 ] ], 1 ] # I [ 2 2 ] : : M a p [ f, t, - I n f,, $ x ] f [ f [ b, 3 ] f [ c, 3 ], 2 ] + f [ f [ a, 2 ], 1 ] # O [ 2 2 ] : f [ a, - 1 ] + f [ g [ f [ g [ f [ { f [ x, - 1 ], f [ { f [ y, - 1 ], f [ z, - 1 ] }, - 2 ] }, - 3 ] ], - 4 ] ], # I [ 2 3 ] : : i : 0 ; M a p [ f [ $ x, I n c [ i ] ], t ] f [ f [ b, - 1 ] f [ c, - 1 ], - 2 ] - 5 ] + f [ f [ a, - 1 ], - 3 ] b c # O [ 2 3 ] : f [ a, 1 ] + f [ g [ g [ { x, { y, z } } ] ], 2 ] + f [ a, 3 ] # I [ 2 4 ] : : i : 0 ; M a p [ f [ $ x, I n c [ i ] ], t, - 1 ] f [ b, 6 ] f [ c, 7 ] # O [ 2 4 ] : f [ a, 1 ] + g [ g [ { f [ x, 2 ], { f [ y, 3 ], f [ z, 4 ] } } ] ] + f [ a, 5 ] # I [ 2 5 ] : : i : 0 ; M a p [ f [ $ x, I n c [ i ] ], t, I n f ] # O [ 2 5 ] : f [ a, 1 ] + f [ g [ f [ g [ f [ { f [ x, 2 ], f [ { f [ y, 3 ], f [ z, 4 ] }, 5 ] }, 6 ] ], 7 ] ], 8 ] f [ f [ b, 1 0 ] f [ c, 1 1 ], 1 2 ] + f [ f [ a, 9 ], 1 3 ] # I [ 2 6 ] : : i : 0 ; M a p [ f [ $ x, I n c [ i ] ], t, - I n f ] # O [ 2 6 ] : f [ a, 1 ] + f [ g [ f [ g [ f [ { f [ x, 2 ], f [ { f [ y, 3 ], f [ z, 4 ] }, 5 ] }, 6 ] ], 7 ] ], 8 ] # I [ 2 7 ] : : M a p [ f, t, 3, L i s t p ] f [ f [ b, 1 0 ] f [ c, 1 1 ], 1 2 ] + f [ f [ a, 9 ], 1 3 ] b c # O [ 2 7 ] : a + g [ g [ f [ { x, { y, z } } ] ] ] + a

34 2.5 SMP REFERENCE MANUAL / Syntax 2.5 # I [ 2 8 ] : : M a p [ f, t, I n f, L i s t p ] b c # O [ 2 8 ] : a + g [ g [ f [ { x, f [ { y, z } ] } ] ] ] + a # I [ 2 9 ] : : M a p [ f, t, I n f, I n [ z, $ x ] ] f [ f [ b ] f [ c ] ] # O [ 2 9 ] : f [ a ] + f [ f [ a ] ] + g [ g [ { f [ x ], { f [ y ], z } } ] ] # I [ 3 0 ] : : i : 0 ; M a p [ f [ $ x, I n c [ i ] ], t, I n f,,, 7 ] b c # O [ 3 0 ] : f [ a, 1 ] + g [ f [ g [ f [ { f [ x, 2 ], f [ { f [ y, 3 ], f [ z, 4 ] }, 5 ] }, 6 ] ], 7 ] ] + a

35 2.6 SMP REFERENCE MANUAL / Syntax Patterns A"pattern" or "generic expression" is an expression containing generic symbols [2.2]. A pattern represents a possibly infinite set of expressions, in which arbitrary expressions replace the generic symbols. Every occurrence of a particular generic symbol in a pattern corresponds to the same expression. Tw o patterns are considered equivalent if the sets of expressions which they represent are identical; they are literally equivalent if all their parts are identical. Determination of literal equivalence takes account of filter reordering [4, 7.7] properties of projections, and of the correspondence between numerical coefficients [2.5] and explicit M u l t projections. Apattern p 2 "matches" p 1 if it represents a superset of the expressions represented by p 1 (so that p 1 may be obtained by replacing some or all of the generic symbols in p 2 ). p 1 is then considered "more specific" than p 2. M a t c h [ e x p r 2, e x p r 1 ] yields 0 if e x p r 2 does not match e x p r 1, 1 if e x p r 2 is equivalent to e x p r 1,oralist of replacements for generic symbols in e x p r 2 necessary to obtain e x p r 1. # I [ 1 ] : : M a t c h [ x ˆ 2, x ˆ 2 ] # O [ 1 ] : 1 # I [ 2 ] : : M a t c h [ x ˆ 2, y ˆ 2 ] # O [ 2 ] : 0 # I [ 3 ] : : M a t c h [ $ x ˆ 2, $ y ˆ 2 ] # O [ 3 ] : { $ x - > $ y } # I [ 4 ] : : M a t c h [ $ x ˆ 2, y ˆ 2 ] # O [ 4 ] : { $ x - > y } # I [ 5 ] : : M a t c h [ y ˆ 2, $ x ˆ 2 ] # O [ 5 ] : 0 # I [ 6 ] : : M a t c h [ $ x ˆ 2, ( a + b ) ˆ 2 ] # O [ 6 ] : { $ x - > a + b } # I [ 7 ] : : M a t c h [ f [ $ x ], f [ x ] ] # O [ 7 ] : { $ x - > x } # I [ 8 ] : : M a t c h [ f [ $ x ], f [ x, y ] ] # O [ 8 ] : 0 # I [ 9 ] : : M a t c h [ f [ $ x, $ y ], f [ x, a + b ] ] # O [ 9 ] : { $ x - > x, $ y - > a + b } # I [ 1 0 ] : : M a t c h [ $ x ˆ $ x, x ˆ x ] # O [ 1 0 ] : { $ x - > x } # I [ 1 1 ] : : M a t c h [ $ x ˆ $ x, x ˆ y ] # O [ 1 1 ] : 0 # I [ 1 2 ] : : M a t c h [ { $ x, a }, { x + y, a } ] # O [ 1 2 ] : { $ x - > x + y }

36 2.6 SMP REFERENCE MANUAL / Syntax 2.6 # I [ 1 3 ] : : M a t c h [ { [ x ] : $ a }, { [ x ] : b + c } ] # O [ 1 3 ] : { $ a - > b + c } # I [ 1 4 ] : : M a t c h [ { [ $ x ] : a }, { [ x ] : a } ] # O [ 1 4 ] : { $ x - > x } # I [ 1 5 ] : : M a t c h [ f [ $ x, $ y, $ x ], f [ a, b + c, a ] ] # O [ 1 5 ] : { $ x - > a, $ y - > b + c } # I [ 1 6 ] : : M a t c h [ f [ $ x, $ y, $ x ], f [ a, b + c, d ] ] # O [ 1 6 ] : 0 # I [ 1 7 ] : : M a t c h [ $ f [ $ x ], f [ x ] ] # O [ 1 7 ] : { $ f - > ( f ), $ x - > x } # I [ 1 8 ] : : M a t c h [ $ x a, 2 a ] # O [ 1 8 ] : { $ x - > 2 } # I [ 1 9 ] : : M a t c h [ b c $ x, a b c ] # O [ 1 9 ] : { $ x - > a } # I [ 2 0 ] : : h _ : C o m m # O [ 2 0 ] : C o m m # I [ 2 1 ] : : M a t c h [ h [ $ x, a ], h [ a, b ] ] # O [ 2 1 ] : { $ x - > b } # I [ 2 2 ] : : M a t c h [ f [ $ x, a ], f [ a, b ] ] # O [ 2 2 ] : 0 # I [ 2 3 ] : : r [ x ] : a ˆ x x # O [ 2 3 ] : a # I [ 2 4 ] : : r [ y ] # O [ 2 4 ] : r [ y ] # I [ 2 5 ] : : r [ $ x ] : b ˆ $ x $ x # O [ 2 5 ] : b # I [ 2 6 ] : : { r [ y ], r [ a + b ] } y a + b # O [ 2 6 ] : { b, b } # I [ 2 7 ] : : r x $ x # O [ 2 7 ] : { [ x ] : a, [ $ x ] : b } # I [ 2 8 ] : : S [ f [ x ˆ 2, y ˆ 2, x ˆ 3 ], $ x ˆ 2 - > h [ $ x ] ] 3 # O [ 2 8 ] : f [ h [ x ], h [ y ], x ]

37 2.6 SMP REFERENCE MANUAL / Syntax 2.6 # I [ 2 9 ] : : P o s [ $ x ˆ $ y, f [ x ˆ 2, y ˆ 2, x ˆ 3, z ] ] # O [ 2 9 ] : { { 1 }, { 2 }, { 3 } } # I [ 3 0 ] : : $ x f [ $ x ] : h p [ $ x ] # O [ 3 0 ] : h p [ $ x ] # I [ 3 1 ] : : { a b f [ a ], 2 a f [ 2 ], 2 f [ 2 ], x ˆ 2 f [ y ˆ 2 ] a y ˆ 2 } 2 2 # O [ 3 1 ] : { b h p [ a ], 2 a f [ 2 ], 2 f [ 2 ], a x h p [ y ] } # I [ 3 2 ] : : M a t c h [ a + c, a + b + c + d ] # O [ 3 2 ] : 0 # I [ 3 3 ] : : a + c : p # O [ 3 3 ] : p # I [ 3 4 ] : : a + b + c + d # O [ 3 4 ] : b + d + p # I [ 3 5 ] : : a. $ x : j [ $ x ] # O [ 3 5 ] : j [ $ x ] # I [ 3 6 ] : : { x. a. b. y, a. x. y, a. x } # O [ 3 6 ] : { x. j [ b ]. y, j [ x ]. y, j [ x ] } # I [ 3 7 ] : : a * $ x : j p [ $ x ] # O [ 3 7 ] : j p [ $ x ] # I [ 3 8 ] : : { x a b y, a x y, a x } # O [ 3 8 ] : { x y j p [ b ], y j p [ x ], j p [ x ] } A pattern p2 matches p1 if the simplified form of p2 after replacement of generic symbols is literally equivalent to p1. However, for at least one occurrence of each generic symbol in p2 the necessary replacement must follow from literal comparison with p 1 (and must thus appear as an explicit part of p 1 ). # I [ 1 ] : : M a t c h [ f [ $ x, 1 - $ x ], f [ x, 1 - x ] ] # O [ 1 ] : { $ x - > x } # I [ 2 ] : : M a t c h [ f [ $ x, 1 - $ x ], f [ x + y, 1 - x - y ] ] # O [ 2 ] : { $ x - > x + y } # I [ 3 ] : : M a t c h [ f [ $ x, 1 - $ x ], f [ 3, - 2 ] ] # O [ 3 ] : { $ x - > 3 } # I [ 4 ] : : M a t c h [ f [ $ x + $ y, $ x - $ y ], f [ 2, 0 ] ] # O [ 4 ] : 0 # I [ 5 ] : : M a t c h [ f [ $ x + $ y, $ x, $ y ], f [ 2, 1, 1 ] ] # O [ 5 ] : { $ x - > 1, $ y - > 1 } # I [ 6 ] : : q [ $ a + $ b, g [ $ a, $ b ] ] : h [ $ a, $ b ] # O [ 6 ] : h [ $ a, $ b ]

38 2.6 SMP REFERENCE MANUAL / Syntax 2.6 # I [ 7 ] : : { q [ 7, g [ 3, 4 ] ], q [ a ˆ 2 + b ˆ 2-1, g [ a ˆ 2-2, b ˆ ] ], q [ a, g [ b, c ] ] } 2 2 # O [ 7 ] : { h [ 3, 4 ], h [ a, 1 + b ], q [ a, g [ b, c ] ] } # I [ 8 ] : : h _ : C o m m # O [ 8 ] : C o m m # I [ 9 ] : : h [ $ a, $ a + 1 ] : h p [ $ a ] # O [ 9 ] : h p [ $ a ] # I [ 1 0 ] : : { h [ 4, 3 ], h [ 2, 3 ], h [ b, a ], h [ a, b ] } # O [ 1 0 ] : { h p [ 3 ], h p [ 2 ], h [ a, b ], h [ a, b ] } The value t of the property [4] _ $ x [ G e n ] restricts all occurrences of the generic symbol x to match only those expressions on which application of the template t yields "true" [5]. # I [ 1 ] : : _ $ i # O [ 1 ] : { [ G e n ] : 1 } # I [ 2 ] : : _ $ i [ G e n ] : I n t p # O [ 2 ] : I n t p # I [ 3 ] : : g [ $ i ] : 2 $ i # O [ 3 ] : 2 $ i # I [ 4 ] : : g [ x ] + g [ 4 ] # O [ 4 ] : 8 + g [ x ] pat _ = cond or Gen[ pat, cond ] represents a pattern equivalent to pat,but restricted to match only those expressions for which cond is determined to be true [5] after necessary replacements for generic symbols. # I [ 1 ] : : f [ $ n _ = I n t p [ $ n ] & $ n > 0 ] : $ n! # O [ 1 ] : $ n! # I [ 2 ] : : f [ 2 ] + f [ - 3 ] + f [ x ] # O [ 2 ] : 2 + f [ - 3 ] + f [ x ] # I [ 3 ] : : g [ $ x, $ y _ = $ x + $ y > 0 ] : t [ $ x, $ y ] # O [ 3 ] : t [ $ x, $ y ] # I [ 4 ] : : g [ x, y ] + g [ - 1, 0 ] + g [ 5, 1 ] # O [ 4 ] : g [ - 1, 0 ] + g [ x, y ] + t [ 5, 1 ] # I [ 5 ] : : u [ $ x _ = N c [ $ x ] < 0 ] : - u [ - $ x ] # O [ 5 ] : - u [ - $ x ] # I [ 6 ] : : u [ - x ] + u [ a + b ] + u [ u [ - 7 ] ] # O [ 6 ] : - u [ x ] - u [ u [ 7 ] ] + u [ a + b ] Multi-generic symbols [2.2] are a special class of generic symbols which represent sequences of expressions, corresponding to null projections [2.3] of any length. In a projection (or list), the sequence of filters matched by a multi-generic symbol is terminated when all subsequent filters can be otherwise matched. For projections with

39 2.6 SMP REFERENCE MANUAL / Syntax 2.6 Comm or Reor [4] properties, all but one multi-generic symbol is taken to match a zero-length sequence of expressions [ ]. In a projection from a projector f with property Flat [4], a multi-generic symbol matches a sequence of filters corresponding to a further projection from f. Although this further projection may be considered as a single filter in the original projection, it is not represented by a single ordinary generic symbol. # I [ 1 ] : : M a t c h [ f [ $ x ], f [ x, y ] ] # O [ 1 ] : 0 # I [ 2 ] : : M a t c h [ f [ $ $ x ], f [ x, y ] ] # O [ 2 ] : { $ $ x - - > [ x, y ] } # I [ 3 ] : : M a t c h [ f [ $ $ x, w, $ $ z ], f [ a, b, w, z ] ] # O [ 3 ] : { $ $ z - - > [ z ], $ $ x - - > [ a, b ] } # I [ 4 ] : : M a t c h [ f [ $ $ x, w, $ $ z ], f [ a, w, c, w, z ] ] # O [ 4 ] : { $ $ z - - > [ c, w, z ], $ $ x - - > [ a ] } # I [ 5 ] : : M a t c h [ f [ $ $ x, w, $ $ z ], f [ a, b, c, w ] ] # O [ 5 ] : { $ $ z - - > [ ], $ $ x - - > [ a, b, c ] } # I [ 6 ] : : M a t c h [ f [ $ $ x, w, $ $ z ], f [ w ] ] # O [ 6 ] : { $ $ z - - > [ ], $ $ x - - > [ ] } # I [ 7 ] : : M a t c h [ f [ $ $ x, $ x ], f [ a, b, c, d ] ] # O [ 7 ] : { $ x - > d, $ $ x - - > [ a, b, c ] } # I [ 8 ] : : M a t c h [ f [ $ $ x, $ x, $ y ], f [ a, b, c, d ] ] # O [ 8 ] : { $ x - > c, $ y - > d, $ $ x - - > [ a, b ] } # I [ 9 ] : : M a t c h [ f [ $ $ x, $ x, $ y ], f [ a, b ] ] # O [ 9 ] : { $ x - > a, $ y - > b, $ $ x - - > [ ] } # I [ 1 0 ] : : M a t c h [ f [ $ $ x, $ x, $ y ], f [ a ] ] # O [ 1 0 ] : 0 # I [ 1 1 ] : : M a t c h [ f [ $ $ x, $ $ y ], f [ a, b, c, d ] ] # O [ 1 1 ] : { $ $ y - - > [ a, b, c, d ], $ $ x - - > [ ] } # I [ 1 2 ] : : M a t c h [ f [ $ $ x, a, $ $ x ], f [ b, c, a, b, c ] ] # O [ 1 2 ] : { $ $ x - - > [ b, c ] } # I [ 1 3 ] : : M a t c h [ f [ $ $ x, a, $ $ x ], f [ b, c, a, b, d ] ] # O [ 1 3 ] : 0 # I [ 1 4 ] : : M a t c h [ f [ $ $ x, a, $ $ y ], f [ a, b, c, d, e ] ] # O [ 1 4 ] : { $ $ y - - > [ b, c, d, e ], $ $ x - - > [ ] } # I [ 1 5 ] : : M a t c h [ f [ $ x ], f [ x ] ] # O [ 1 5 ] : { $ x - > x } # I [ 1 6 ] : : M a t c h [ f [ $ $ x ], f [ x ] ] # O [ 1 6 ] : { $ $ x - - > [ x ] }

40 2.6 SMP REFERENCE MANUAL / Syntax 2.6 # I [ 1 7 ] : : p a l : f [ $ $ x _ = L i s t [ $ $ x ] = R e v [ L i s t [ $ $ x ] ] ] # O [ 1 7 ] : f [ $ $ x _ = ( L i s t [ $ $ x ] = R e v [ L i s t [ $ $ x ] ] ) ] # I [ 1 8 ] : : M a t c h [ p a l, f [ a, b, a ] ] # O [ 1 8 ] : { $ $ x - - > [ a, b, a ] } # I [ 1 9 ] : : M a t c h [ p a l, f [ a, b, b ] ] # O [ 1 9 ] : 0 # I [ 2 0 ] : : g _ : C o m m # O [ 2 0 ] : C o m m # I [ 2 1 ] : : M a t c h [ g [ $ $ x, c ], g [ a, c, x, y ] ] # O [ 2 1 ] : { $ $ x - - > [ a, x, y ] } # I [ 2 2 ] : : M a t c h [ g [ $ $ x, $ x ], g [ a, b, c, d ] ] # O [ 2 2 ] : { $ x - > a, $ $ x - - > [ b, c, d ] } # I [ 2 3 ] : : M a t c h [ g [ $ $ x, $ x, $ y ], g [ a, b, c, d ] ] # O [ 2 3 ] : { $ x - > a, $ y - > b, $ $ x - - > [ c, d ] } # I [ 2 4 ] : : M a t c h [ g [ $ $ x, $ x _ = N a t p [ $ x ] ], g [ a, 2, b, c ] ] # O [ 2 4 ] : { $ x - > 2, $ $ x - - > [ a, b, c ] } # I [ 2 5 ] : : M a t c h [ g [ $ $ x, w, $ $ y ], g [ a, b, w, z ] ] # O [ 2 5 ] : { $ $ x - - > [ a, b, z ] } # I [ 2 6 ] : : h _ : F l a t # O [ 2 6 ] : F l a t # I [ 2 7 ] : : M a t c h [ h [ $ $ x ], h [ a, b, c ] ] # O [ 2 7 ] : { $ $ x - > h [ a, b, c ] } # I [ 2 8 ] : : M a t c h [ h [ $ $ x ], h [ a ] ] # O [ 2 8 ] : { $ $ x - > h [ a ] } # I [ 2 9 ] : : M a t c h [ h [ a, $ $ x ], h [ a, b ] ] # O [ 2 9 ] : { $ $ x - > h [ b ] } # I [ 3 0 ] : : M a t c h [ h [ a, $ $ x ], h [ a ] ] # O [ 3 0 ] : 0 # I [ 3 1 ] : : p [ $ x $ y ] : p [ $ x ] + p [ $ y ] # O [ 3 1 ] : p [ $ x ] + p [ $ y ] # I [ 3 2 ] : : { p [ a b ], p [ a b c ] } # O [ 3 2 ] : { p [ a ] + p [ b ], p [ a b c ] } # I [ 3 3 ] : : q [ $ x $ $ x ] : q [ $ x ] + q [ $ $ x ] # O [ 3 3 ] : q [ $ $ x ] + q [ $ x ] # I [ 3 4 ] : : { q [ a b ], q [ a b c ], q [ a b c d ] } # O [ 3 4 ] : { q [ a ] + q [ b ], q [ a ] + q [ b ] + q [ c ], q [ a ] + q [ b ] + q [ c ] + q [ d ] }

41 2.6 SMP REFERENCE MANUAL / Syntax 2.6 # I [ 3 5 ] : : S [ a. b. a. c. d. a, a. $ $ x. a - > r [ $ $ x ] ] # O [ 3 5 ] : r [ b ]. c. d. a

42 2.7 SMP REFERENCE MANUAL / Syntax Templates Atemplate t is an expression specifying an action to be taken on a set of expressions {s 1, s 2,...}. The result from an application of t depends on its structure: number or N u l l pattern ` u or M a r k [ u ] u. other expression t [ s 1, s 2,...]. A p [7.2] t The value of t obtained by replacement of generic symbols d i occurring in it by any corresponding s i. The association of s i with d i is determined by first sorting the d i into canonical order. If any of the di are multi-generic symbols, the first is paired with the maximal set of s i.any unpaired d i are left unreplaced. All operations represented by templates may equivalently be specified by suitable lists: templates are provided for ease of use in simple cases. # I [ 1 ] : : A p [ 3, { a, b } ] # O [ 1 ] : 3 # I [ 2 ] : : A p [ f [ $ x, $ y ], { a, b } ] # O [ 2 ] : f [ a, b ] # I [ 3 ] : : A p [ f [ $ y, $ x ], { a, b } ] # O [ 3 ] : f [ b, a ] # I [ 4 ] : : A p [ f [ $ y ], { a, b } ] # O [ 4 ] : f [ a ] # I [ 5 ] : : A p [ f [ $ z, $ y, $ x ], { a, b } ] # O [ 5 ] : f [ $ z, b, a ] # I [ 6 ] : : A p [ f [ $ x, $ x, $ y ] * g [ $ y ˆ $ y ], { a, b } ] b # O [ 6 ] : f [ a, a, b ] g [ b ] # I [ 7 ] : : A p [ f [ $ $ x ], { a, b } ] # O [ 7 ] : f [ a, b ] # I [ 8 ] : : A p [ f [ $ $ x, 1, $ $ x ], { a, b } ] # O [ 8 ] : f [ a, b, 1, a, b ] # I [ 9 ] : : A p [ $ f [ $ x ], { g, y } ] # O [ 9 ] : g [ y ] # I [ 1 0 ] : : A p [ ` ( x + y ), { a, b } ] # O [ 1 0 ] : x + y # I [ 1 1 ] : : A p [ ( x + y ), { a, b } ] # O [ 1 1 ] : P r o j [ x + y, { a, b } ]

43 2.7 SMP REFERENCE MANUAL / Syntax 2.7 # I [ 1 2 ] : : A p [ f, { a, b } ] # O [ 1 2 ] : f [ a, b ] # I [ 1 3 ] : : A p [ { a 1, a 2, a 3, a 4, a 5 }, { 3 } ] # O [ 1 3 ] : a 3 # I [ 1 4 ] : : A r [ 5, f ] # O [ 1 4 ] : { f [ 1 ], f [ 2 ], f [ 3 ], f [ 4 ], f [ 5 ] } # I [ 1 5 ] : : A r [ 5, ` f ] # O [ 1 5 ] : { f, f, f, f, f } # I [ 1 6 ] : : A r [ 5, f [ $ x ] ] # O [ 1 6 ] : { f [ 1 ], f [ 2 ], f [ 3 ], f [ 4 ], f [ 5 ] } # I [ 1 7 ] : : A r [ 5, ` f [ $ x ] ] # O [ 1 7 ] : { f [ $ x ], f [ $ x ], f [ $ x ], f [ $ x ], f [ $ x ] } # I [ 1 8 ] : : A r [ { 2, 3 }, $ y ˆ $ x ] # O [ 1 8 ] : { { 1, 2, 3 }, { 1, 4, 9 } }

44 2.8 SMP REFERENCE MANUAL / Syntax Chameleonic expressions A chameleonic expression is an expression containing chameleonic symbols [2.2]. If a chameleonic expression is assigned as a delayed value [3.2], then each chameleonic symbol which it contains is given a unique new name whenever the value is used. Make [10.5] # I [ 1 ] : : t : : f [ # # a, # # b ] - # # c # O [ 1 ] : f [ # # a, # # b ] - # # c # I [ 2 ] : : t # O [ 2 ] : - # 3 + f [ # 1, # 2 ] # I [ 3 ] : : t - t # O [ 3 ] : - # 6 + # 9 + f [ # 4, # 5 ] - f [ # 7, # 8 ]

45 2.9 SMP REFERENCE MANUAL / Syntax Commentary input Any input (including n e wline s) between / * and * / is treated as commentary, and is not processed. Comments may be nested. # I [ 1 ] : : a + / * b e g i n c o m m e n t 1 / * n e s t e d c o m m e n t * / e n d c o m m e n t 1 * / b + \ / * c o m m e n t 2 * / \ c # O [ 1 ] : a + b + c

46 2.10 SMP REFERENCE MANUAL / Syntax Input forms input form projection grouping ( x ) (parentheses) { x 1, x 2, x 3,...} (list) { [ i 1 ] : x 1, [ i 2 ] : x 2,...} (list) x 1 * ˆ x 2 x1 * 1 0 ˆ x 2 ( x 1 * ˆ x 2 ) * ˆ x x # O [ x ] _ x P r o p [ x ] f [ x 1, x 2, x 3 ] (projection) f [ x 1, x 2, x 3 ] ( _ f [ T i e r ] : 0 ) ( ( f [ x 1 ] ) [ x 2 ] ) [ x 3 ] ( _ f [ T i e r ] : 1 ) [ x 1, x 2, x 3 ] N p [ x 1, x 2, x 3 ] [ x 1, x 2, x 3 ] < x G e t [ x ] x!! D f c t l [ x ] ( x!! )! x! F c t l [ x ] x 1. x 2. x 3 D o t [ x 1, x 2, x 3 ] x 1. x 2. x 3 x 1 * * x 2 * * x 3 O m u l t [ x 1, x 2, x 3 ] x 1 * * x 2 * * x 3 x 1 ˆ x 2 P o w [ x 1, x 2 ] x 1 ˆ ( x 2 ˆ x 3 ) - x M u l t [ - 1, x ] x 1 / x 2 D i v [ x 1, x 2 ] ( x 1 / x 2 ) / x 3 x 1 * x 2 * x 3 M u l t [ x 1, x 2, x 3 ] x 1 * x 2 * x 3 (see also below) x 1 + x 2 + x 3 P l u s [ x 1, x 2, x 3 ] x 1 + x 2 + x 3 x 1 - x 2 + x 3 P l u s [ x 1, - x 2, x 3 ] x 1 + ( - x 2 ) + x 3 x 1 = x 2 E q [ x 1, x 2 ] See note below x 1 = x 2 U n e q [ x 1, x 2 ] See note below x 1 > x 2 G t [ x 1, x 2 ] See note below x 1 > = x 2 G e [ x 1, x 2 ] See note below x 1 < x 2 G t [ x 2, x 1 ] See note below x 1 < = x 2 G e [ x 2, x 1 ] See note below x N o t [ x ] x 1 & x 2 & x 3 A n d [ x 1, x 2, x 3 ] x 1 & x 2 & x 3 x 1 x 2 x 3 O r [ x 1, x 2, x 3 ] x 1 x 2 x 3 x 1 x 2 x 3 X o r [ x 1, x 2, x 3 ] x 1 x 2 x 3 x 1 = > x 2 I m p [ x 1, x 2 ] x 1 = > ( x 2 = > x 3 ) x 1 _ = x 2 G e n [ x 1, x 2 ] ( x 1 _ = x 2 ) _ = x 3 x 1.. x 2 S e q [ x 1, x 2 ] ( x 1.. x 2 ).. x 3 x 1 : x 2 S e t [ x 1, x 2 ] x 1 : ( x 2 : x 3 ) x : S e t [ x ] x 1 : : x 2 S e t d [ x 1, x 2 ] x 1 : : ( x 2 : : x 3 ) x 1 - > x 2 R e p [ x 1, x 2 ] x 1 - > ( x 2 - > x 3 ) x > x 2 R e p d [ x 1, x 2 ] x > ( x > x 3 ) x 1 _ : x 2 P r s e t [ x 1, x 2 ] x 1 _ : ( x 2 _ : x 3 ) x 1 _ x 2 T y s e t [ x 1, x 2 ] x 1 _ ( x 2 _ x 3 ) x 1 : = x 2 S x s e t [ x 1, x 2 ] x 1 : = ( x 2 : = x 3 ) x 1 : = S x s e t [ x 1 ] x 1 ; x 2 ; x 3 P r o c [ x 1, x 2, x 3 ] x 1 ; x 2 ; x 3 x 1 ; x 2 ;...; x n ; P r o c [ x 1, x 2,..., x n, ] x 1 ; x 2 ;... x n ;! x (pre-simplification) x H o l d [ x ] ` x M a r k [ x ]

47 2.10 SMP REFERENCE MANUAL / Syntax 2.10 Forms given inthe same box have the same precedence; the boxes are in order of decreasing precedence. is a form with precedence higher than ##, then x2 ## x3 is treated as x2) ## x3, while x1 ## x3 is treated as x1 ## x3). #I[1]:: #O[1]: #I[2]:: x+yˆ2*a 2 x + a y (x+y)ˆ(2*a) 2a #O[2]: (x + y) #I[3]:: a/b*c - d/e/f + kˆ-u*-v - xˆyˆz z -d a c -u y #O[3]: k v - x e f b #I[4]:: {a+b:c, a+(b:c)} #O[4]: {c,a + c} #I[5]:: #O[5]: #I[6]:: #O[6]: {`a:b+c, (`a):b+c} {` 2c,2c} {c,#o[proj[4,{1}]]} #I[7]:: {3+0>1, 3+(0>1)} #O[7]: {1,3} #I[8]:: {k::(1;2), k::1;2} #O[8]: { 1 ; 2,2} #I[9]:: {1>0&1>0, 1>(0&1)>0} #O[9]: {1,0} #I[10]:: #O[10]: #I[11]:: #O[11]: #I[12]:: h1_:tier Tier {h1[x][y][z], h2[x][y][z]} {Proj[Proj[h1[x],{y}],{z}],h2[x,y,z]} {-1ˆ(1/2),a*-b,aˆ-b,-2!} 2 -c -c #O[12]: {-1,-2 c,2 c,-2} #I[13]:: #O[13]: {100*ˆ-1!, (100*ˆ-1)!} {10, *ˆ6} The last column of the table indicates how multiple appearances of the same form are grouped. When no parentheses appear, the corresponding projection is Flat [4,7.7]. These groupings also govern the treatment of different forms with the same precedence.

48 2.10 SMP REFERENCE MANUAL / Syntax 2.10 #I[1]:: {a/b/c, a/(b/c)} a a c #O[1]: {---,---} b c b #I[2]:: {aˆbˆc, (aˆb)ˆc} c b b c #O[2]: {a,a } #I[3]:: #O[3]: #I[4]:: #O[4]: #I[5]:: #O[5]: #I[6]:: #O[6]: a:b:c c {a,b} {c,c} a_b_c_type type {S[x,x->y->z], S[x,(x->y)->z]} {y -> z,x} #I[7]:: {3!!!, (3!)!!} #O[7]: {6,48} Combinations of the relational operators [5] =, =, >, >=, <, and <= may be input together; if # and ## represent input forms for two such operators, then x1 # x2 ## x3 is treated as (x1 # x2) & (x2 ## x3). However, x1 = x2 = x3 is treated as (x1 = x2) & (x2 = x3) & (x1 = x3); ingeneral, combinations of the form expr1 = expr2 = expr3 =... assert inequality of all the expri. #I[1]:: #O[1]: #I[2]:: #O[2]: #I[3]:: x<y y > x x=y=z<3 x = y & y = z & 3 > z a =b =c =17 #O[3]: a = 17 & a = b & a = c & b = 17 & b = c & c = 17 Products may be input without explicit * when their terms are suitably distinguished. For any numbers n, symbols s and f and expressions x the following input forms are taken as products: n n s n f[x]n (x)n {x}n ns s s f[x]s (x)s {x}s nf[x] s f[x] f[x]f[x] (x)f[x] {x}f[x] n(x) s(x) f[x](x) (x)(x) {x}(x) n{x} s{x} f[x]{x} (x){x} {x}{x} Precedence of such forms is as when explicit * are given. #I[1]:: #O[1]: 132

49 2.10 SMP REFERENCE MANUAL / Syntax 2.10 #I[2]:: #O[2]: #I[3]:: #O[3]: #I[4]:: {2a/4, a2/4} {a/2,a2/4} {3f[x]4, 3 4f[x], 34f[x]} {12f[x],12f[x],34f[x]} c(x+y) + 2(x+y)(y+z)ˆ3 + g[x]f[x]ˆ2 3 2 #O[4]: c (x + y) + 2(x + y) (y + z) + f[x] g[x] #I[5]:: a/2b a b #O[5]: #I[6]:: a/(2b) a #O[6]: -- 2b #I[7]:: aˆ2bˆc 2 c #O[7]: a b #I[8]:: #O[8]: #I[9]:: 2{{a,b},{c,d}} {{2a,2b},{2c,2d}} {a,b}{c,d} #O[9]: {a c,b d} The symbol Null [2.2] may be input as a blank when it appears as the value of an entry in a list, or as a filter in a projection given in standard form. Hence f[] is equivalent to f[null] and g[,,] to g[null,null,null]. #I[1]:: Lpr[f[] + g[,,1,2,,3,]] f[null] + g[null,null,1,2,null,3,null] #I[2]:: Lpr[{a,{,b,,c,},}] {a,{null,b,null,c,null},null} #I[3]:: Lpr[{}] {}

50 2.11 SMP REFERENCE MANUAL / Syntax Syntax modification cc:= dd or S x s e t [ cc, dd, (class : 0 ),(prec : 0 )] assigns the name c c of the symbol c c to be replaced textually on input by d d according to one of the following classes of transformations 0 c c d d 1 c c x d d [ x ] 2 x c c d d [ x ] 3 x 1 c c x 2 c c x 3 d d [ x 1, x 2, x 3 ] 4 x 1 c c x 2 d d [ x 1, x 2 ] x 1 c c x 2 c c x 3 d d [ x 1, d d [ x 2, x 3 ] ] 5 x 1 c c x 2 d d [ x 1, x 2 ] x 1 c c x 2 c c x 3 d d [ d d [ x 1, x 2 ], x 3 ] and with precedence p r ec. Te xtual replacements are performed before input expressions are simplified. Input text, excluding any strings enclosed in " ", is scanned once only from the beginning, and at each point, textual replacements for the longest possible character strings are made. Transformations 1 through 5 may carry precedences from 1 to 3 : 1 is the same as I n p u t, 2 as P l u s and 3 as I n f o. c c : = or S x s e t [ c c ] removes any textual replacements assigned for c c. S x s e t [ ] removes all assignments for textual replacements. # I [ 1 ] : : i n : = o u t # O [ 1 ] : o u t # I [ 2 ] : : { i n, i n i n, i n i n, i n i n i n } 2 # O [ 2 ] : { o u t, o u t, o u t o u t, o u t o u t o u t } # I [ 3 ] : : " ) ( " : = w w w # O [ 3 ] : w w w # I [ 4 ] : : ) ( ˆ ) ( w w w # O [ 4 ] : w w w # I [ 5 ] : : { 2 ( ) ( + 1 ), a ) (, a ) (, a ) ( ) ( ) ( ) ( } 2 # O [ 5 ] : { 2 ( 1 + w w w ), a w w w, a w w w, a w w w w w w w w w } # I [ 6 ] : : ( a + b ) ( c + d ) # O [ 6 ] : a + b w w w c + d # I [ 7 ] : : ( a + b ) ( c + d ) # O [ 7 ] : ( a + b ) ( c + d ) # I [ 8 ] : : ( a + b " ) ( " c + d ) # O [ 8 ] : a + d + b c " ) ( " # I [ 9 ] : : " + + " : = " # O [ 9 ] : "

51 2.11 SMP REFERENCE MANUAL / Syntax 2.11 # I [ 1 0 ] : : { + + x, } # O [ 1 0 ] : { # O [ x ], o u t } # I [ 1 1 ] : : ". " : = x # O [ 1 1 ] : x # I [ 1 2 ] : : ".. " : = y # O [ 1 2 ] : y # I [ 1 3 ] : : "... " : = z # O [ 1 3 ] : z # I [ 1 4 ] : : {.,..,...,....,.....,......, , , } # O [ 1 4 ] : { x, y, z, z x, z y, z z, z z x, z z y, z z z } # I [ 1 5 ] : : " " : = " + " # O [ 1 5 ] : " + " # I [ 1 6 ] : : { a b, 2 3, a b, 2 3, a b } # O [ 1 6 ] : { a b, 6, a + b, 5, a + b } # I [ 1 7 ] : : " * " : = " ˆ " # O [ 1 7 ] : " ˆ " # I [ 1 8 ] : : { a * b, a b, a ˆ b } b b # O [ 1 8 ] : { a, a b, a } # I [ 1 9 ] : : " ˆ " : = " * " # O [ 1 9 ] : " * " # I [ 2 0 ] : : { a * b, a b, a ˆ b, a * b * c, a ˆ b ˆ c } c b b # O [ 2 0 ] : { a, a b, a b, a, a b c } # I [ 2 1 ] : : " ˆ " : = # I [ 2 2 ] : : a ˆ b b # O [ 2 2 ] : a # I [ 2 3 ] : : S x s e t [ ] # I [ 2 4 ] : : a * b # O [ 2 4 ] : a b # I [ 2 5 ] : : S x s e t [ " + + ", O p l u s, 5, 2 ] # O [ 2 5 ] : O p l u s # I [ 2 6 ] : : { a + b, a + + b, a + + b + + c, a + + b c } # O [ 2 6 ] : { a + b, O p l u s [ a, b ], O p l u s [ a, O p l u s [ b, c ] ], O p l u s [ a, b c ] } # I [ 2 7 ] : : S x s e t [ " ˆ ˆ ", O p o w, 5, 1 ] # O [ 2 7 ] : O p o w

52 2.11 SMP REFERENCE MANUAL / Syntax 2.11 # I [ 2 8 ] : : { a ˆ ˆ b, a ˆ ˆ b c, a ˆ ˆ b + + c, a ˆ ˆ b! } # O [ 2 8 ] : { O p o w [ a, b ], c O p o w [ a, b ], O p o w [ a, O p l u s [ b, c ] ], O p o w [ a, b ]! }

53 2.12 SMP REFERENCE MANUAL / Syntax Output forms Most input forms are also used for output. Parentheses are omitted in output when the required groupings follow the precedences of forms given in[2.10]. Common additional output forms: M u l t [ x 1, x 2, x 3 ] x 1 x 2 x 3 x 1 D i v [ x 1, x 2 ] - - x 2 x 2 P o w [ x 1, x 2 ] x 1 The output form of the projection P l o t [10.2] is a "plot". F m t and S x are printed in a special formatted form. Assignment of a P r property [4] defines a special output form for a projection. The presence of special forms in an output expression is indicated by * at the beginning of the output. The labelling of parts in such special output forms may not be manifest. A direct and unambiguous representation of any expression is printed by L p r [10.1]. L [10.4] # I [ 1 ] : : P s [ E x p [ x ], x, 0, 4 ] x x x # O [ 1 ] : * 1 + x # I [ 2 ] : : L p r [ % ] P s [ 1, x, 0, { 0, 4 }, { [ 0 ] : 1, [ 1 ] : 1, [ 2 ] : 1 / 2, [ 3 ] : 1 / 6, [ 4 ] : 1 / 2 4 } ]

54 3. Fundamental operations 3.1 Automatic simplification 3.2 Assignment and deassignment 3.3 Replacements and substitutions 3.4 Numerical evaluation 3.5 Deferred simplification 3.6 Pre-simplification 3.7 Partial simplification

55 3.1 SMP REFERENCE MANUAL / Fundamental operations Automatic simplification Any input expression is automatically "simplified" to the maximum extent possible. Unless further assignments are made, the resulting output expression can be simplified no further; if it is input again, it will be output unchanged. # I [ 1 ] : : a : b # O [ 1 ] : b # I [ 2 ] : : b : c # O [ 2 ] : c # I [ 3 ] : : a # O [ 3 ] : c # I [ 4 ] : : a + 1 # O [ 4 ] : 1 + c # I [ 5 ] : : c : d # O [ 5 ] : d # I [ 6 ] : : a # O [ 6 ] : d Even if part of an expression is apparently meaningless, no message is printed; that part is merely returned without further simplification. Processing impasses occur if simplification apparently requires infinite time or memory space. # I [ 1 ] : : f [ x ] + 0 ˆ 0 0 # O [ 1 ] : f [ x ] + 0 # I [ 2 ] : : 0 ˆ 0 : 1 # O [ 2 ] : 1 # I [ 3 ] : 1 # O [ 3 ] : 1 + f [ x ] # I [ 4 ] : : f [ x ] : a # O [ 4 ] : a # I [ 5 ] : 1 # O [ 5 ] : 1 + a # I [ 6 ] : : f [ $ x ] : f [ $ x - 1 ] + 1 # O [ 6 ] : 1 + f [ $ x ] # I [ 7 ] : : f [ 1 0 ] < m e m o r y n e a r l y e x h a u s t e d >

56 3.1 SMP REFERENCE MANUAL / Fundamental operations 3.1 The simplification of expressions proceeds as follows: Numbers Symbols Projections Lists Ordinary numbers remain unchanged. A symbol is replaced by the simplified form of any value assigned [3.2] to it. 1. Each filter is simplified in turn, unless the value (k ) of any corresponding Smp property carried by the projector is 0. (Future parallel-processing implementations may not respect this ordering.) The simplification of a filter is carried out until its value no longer changes, or until any projectors not carrying property Rec have appeared recursively at most k times (see below). If any filter is found to be extended [4] with respect to the projector, then the projection is replaced or encased as specified in the relevant property list [4]. 2. Projections with Flat, Comm or Reor properties [4, 7.7] are cast into canonical form. If the projector carries the property Sys [4] built-in simplification routines are invoked for system-defined projections. External programs are used when applicable if the projector carries the property C o n s [4, 10.7]. 3. If avalue v has been assigned for the projector, then the filters of the projection are used in an attempt to select a part of v. The filters are used together if the projector carries the properties Tier, Flat, Comm or Reor. If the required part is present, any necessary replacements for generic symbols are performed (and values defined by generic assignments [3.2] are inserted); the projection is then replaced by the simplified value of the part. When v is a list, its entries are scanned sequentially until one is found whose indices match [2.6] the filters of the projection. Sequences of filters in the projection are used together in matching null projections appearing as list indices. F l a t, C o m m,and R e o r properties are accounted for in this matching process. Immediate values [3.2] for entries of a list are simplified in turn. Indices are not simplified. # I [ 1 ] : : a 1 : a 2 # O [ 1 ] : a 2 # I [ 2 ] : : a 1 # O [ 2 ] : a 2 # I [ 3 ] : : f [ P r [ 1 ], P r [ ], P r [ 3 ] ] # O [ 3 ] : f [ 1, 2, 3 ] # I [ 4 ] : : _ f [ S m p ] : 0 # O [ 4 ] : 0 # I [ 5 ] : : f [ P r [ 1 ], P r [ ], P r [ 3 ] ] # O [ 5 ] : f [ P r [ 1 ], P r [ ], P r [ 3 ] ] # I [ 6 ] : : _ j [ E x t r, h ] : h 1 # O [ 6 ] : h 1 # I [ 7 ] : : h [ a, b ] + h [ j, a ] + h [ j [ b ] ] # O [ 7 ] : h [ a, b ] + h 1 [ j [ b ] ] + h 1 [ j, a ]

57 3.1 SMP REFERENCE MANUAL / Fundamental operations 3.1 # I [ 8 ] : : j _ : F l a t # O [ 8 ] : F l a t # I [ 9 ] : : j [ j [ a ], j [ b, j [ c ] ] ] # O [ 9 ] : j [ a, b, c ] # I [ 1 0 ] : : v : b ˆ c + a + d c # O [ 1 0 ] : a + d + b # I [ 1 1 ] : : v [ 3, 1 ] + v [ 5 ] # O [ 1 1 ] : b + v [ 5 ] # I [ 1 2 ] : : v : { [ 0 ] : a, [ $ x ] : 1 / $ x } 1 # O [ 1 2 ] : { [ 0 ] : a, [ $ x ] : - - } $ x # I [ 1 3 ] : : v [ 0 ] + v [ x ] + v [ y ] 1 1 # O [ 1 3 ] : a x y # I [ 1 4 ] : : v p : { [ $ x ] : 1 / $ x, [ 0 ] : a } 1 # O [ 1 4 ] : { [ $ x ] : - -, [ 0 ] : a } $ x # I [ 1 5 ] : : v p [ 0 ] + v p [ x ] + v p [ y ] # O [ 1 5 ] : x y # I [ 1 6 ] : : a * c : t 1 # O [ 1 6 ] : t 1 # I [ 1 7 ] : : M u l t # O [ 1 7 ] : { [ [ a, c ] ] : t 1 } # I [ 1 8 ] : : a * b * c # O [ 1 8 ] : b t 1 # I [ 1 9 ] : : { [ P r [ i 1 ] ] : P r [ v 1 ], [ P r [ i 2 ] ] : : P r [ v 2 ], [ P r [ i 3 ] ] : P r [ v 3 ] } v 1 v 3 # O [ 1 9 ] : { [ P r [ i 1 ] ] : v 1, [ P r [ i 2 ] ] : : P r [ v 2 ], [ P r [ i 3 ] ] : v 3 } Whenever an expression to which an immediate value has been assigned (through : [3.2]) is simplified, the old value is replaced by the new simplified form. Delayed values (assigned by : : [3.2]) are simplified whenever they are required, but are not replaced by the resulting simplified forms. # I [ 1 ] : : a : b ; b : c # O [ 1 ] : c

58 3.1 SMP REFERENCE MANUAL / Fundamental operations 3.1 # I [ 2 ] : : a p : : b # O [ 2 ] : b # I [ 3 ] : : { a, a p } # O [ 3 ] : { c, c } # I [ 4 ] : : b : d # O [ 4 ] : d # I [ 5 ] : : { a, a p } # O [ 5 ] : { c, d } # I [ 6 ] : : f 1 [ $ x ] : D [ $ x, x ] # O [ 6 ] : 0 # I [ 7 ] : : f 2 [ $ x ] : : D [ $ x, x ] # O [ 7 ] : D [ $ x, x ] # I [ 8 ] : : { f 1 [ x ˆ 2 ], f 2 [ x ˆ 2 ] } # O [ 8 ] : { 0, 2 x } # I [ 9 ] : : f [ $ x ] : : f [ $ x ] : f [ $ x - 1 ] + f [ $ x - 2 ] # O [ 9 ] : f [ $ x ] : f [ $ x - 1 ] + f [ $ x - 2 ] # I [ 1 0 ] : : f [ 1 ] : f [ 0 ] : 1 # O [ 1 0 ] : 1 # I [ 1 1 ] : : f # O [ 1 1 ] : { [ 1 ] : 1, [ 0 ] : 1, [ $ x ] : : f [ $ x ] : f [ $ x - 1 ] + f [ $ x - 2 ] } # I [ 1 2 ] : : f [ 1 0 ] # O [ 1 2 ] : 8 9 # I [ 1 3 ] : : f # O [ 1 3 ] : { [ 1 0 ] : 8 9, [ 9 ] : 5 5, [ 8 ] : 3 4, [ 7 ] : 2 1, [ 6 ] : 1 3, [ 5 ] : 8, [ 4 ] : 5, [ 3 ] : 3, [ 2 ] : 2, [ 1 ] : 1, [ 0 ] : 1, [ $ x ] : : f [ $ x ] : f [ $ x - 1 ] + f [ $ x - 2 ] } Simplification of a projection may involve further projections from the same projector (recursion). Unless a projector g carries the property R e c,itmay appear recursively at most k times in the simplification of a filter in a projection from f before steps 2 and 3 in the simplification of the f projection are performed. The value of k for a particular filter is determined by the value of any corresponding Smp property for f. The default is Inf,causing each filter to be simplified until it no longer changes, regardless of the number of recursive appearances of g. Other values of k allow steps 2 and 3 in the simplification of the projection from f to be performed even though the filter may not be "completely simplified". When k is 0,the filter is left entirely unsimplified. The Smp properties of projectors such as Mult and Plus have value 1 since simplifications of their projections are valid regardless of the state of simplification of their filters. # I [ 1 ] : : g [ $ x ] : $ x g [ $ x - 1 ] # O [ 1 ] : $ x g [ $ x ]

59 3.1 SMP REFERENCE MANUAL / Fundamental operations 3.1 # I [ 2 ] : : g # O [ 2 ] : { [ $ x ] : $ x g [ $ x ] } # I [ 3 ] : : g [ 1 0 ] # O [ 3 ] : 0 # I [ 4 ] : : g [ 1 ] : 1 # O [ 4 ] : 1 # I [ 5 ] : : g [ 1 0 ] # O [ 5 ] : # I [ 1 ] : : M u l t _ : T r a c e # O [ 1 ] : T r a c e # I [ 2 ] : : _ M u l t [ S m p ] # O [ 2 ] : 1 # I [ 3 ] : : g [ $ x ] : $ x g [ $ x - 1 ] $ x g [ $ x ] # O [ 3 ] : $ x g [ $ x ] # I [ 4 ] : : g $ x g [ $ x ] # O [ 4 ] : { [ $ x ] : $ x g [ $ x ] } # I [ 5 ] : : g [ 5 ] 5 ( 4 g [ ] ) 3 ( 2 g [ ] ) 1 ( 0 g [ ] ) # O [ 5 ] : 0 # I [ 6 ] : : g [ 1 ] : 1 # O [ 6 ] : 1 # I [ 7 ] : : g [ 5 ] 5 ( 4 g [ ] ) 3 ( 2 g [ ] ) # O [ 7 ] : # I [ 8 ] : : h [ $ x ] : : $ x h [ P r [ $ x - 1 ] ] # O [ 8 ] : $ x h [ P r [ $ x - 1 ] ] # I [ 9 ] : : _ M u l t [ S m p ] : I n f # O [ 9 ] : I n f

60 3.1 SMP REFERENCE MANUAL / Fundamental operations 3.1 # I [ 1 0 ] : : h [ 5 ] q u i t i n t e r r u p t < q u i t > # I [ 1 1 ] : : h [ 1 ] : 1 # O [ 1 1 ] : 1 # I [ 1 2 ] : : h [ 5 ] # O [ 1 2 ] : # I [ 1 3 ] : : f [ $ x ] : : f [ $ x - 1 ] + f [ $ x - 2 ] # O [ 1 3 ] : f [ $ x - 1 ] + f [ $ x - 2 ] # I [ 1 4 ] : : f [ 0 ] : f [ 1 ] : 1 # O [ 1 4 ] : 1 # I [ 1 5 ] : : P l u s _ : T r a c e # O [ 1 5 ] : T r a c e # I [ 1 6 ] : : f [ 5 ] ( f [ 4-1 ] + f [ 4-2 ] ) + ( f [ 3-1 ] + f [ 3-2 ] )

61 3.1 SMP REFERENCE MANUAL / Fundamental operations ( f [ 2-1 ] + f [ 2-2 ] ) ( 1 + f [ 2-2 ] + f [ 2-1 ] ) # O [ 1 6 ] : 8 # I [ 1 7 ] : : f _ : R e c # O [ 1 7 ] : R e c # I [ 1 8 ] : : f [ 5 ]

62 3.1 SMP REFERENCE MANUAL / Fundamental operations # O [ 1 8 ] : 8 "Static" (manifestly non-terminating) recursive assignments in which the literal form of an expression appears in its simplified value are evaluated once only. D e p [7.4] # I [ 1 ] : : a : a + 1 # O [ 1 ] : 1 + a # I [ 2 ] : : a # O [ 2 ] : 1 + a # I [ 3 ] : : f : f [ x ] # O [ 3 ] : f [ x ] # I [ 4 ] : : f # O [ 4 ] : f [ x ] S m p [ e x p r, (le v s p e c : 1 ),(rp t : 1 ),(do m c r i t : 1 ),(ma x : 1 )] simplifies parts of expr in the domain specified by levspec and domcrit,simplifying at most rpt times per pass through the expression and making at most m a x passes. S m p [4] # I [ 1 ] : : g [ $ x ] : $ x g [ $ x - 1 ] # O [ 1 ] : $ x g [ $ x ] # I [ 2 ] : : S m p [ g [ 1 0 ], 2 ] # O [ 2 ] : 9 0 g [ ]

63 3.2 SMP REFERENCE MANUAL / Fundamental operations Assignment and deassignment Assignment is used to define a value for an expression. Simplification [3.1] replaces an expression by any value assigned to it. Values for expressions come in two types: Immediate Delayed The value is simplified when it is assigned, and is maintained in a simplified form, being updated, if necessary, whenever itisused. The value is maintained in an unsimplified form; a new simplified form is obtained whenever it is used. expr1 : expr2 or S e t [expr1,expr2 ] assigns e x p r 2 to be the immediate value of the expression e x p r 1. expr1 : : expr2 or S e t d [expr1,expr2 ] assigns e x p r 2 to be the delayed value of the expression e x p r 1. E v [3.7] # I [ 1 ] : : r 1 : R a n d [ ] # O [ 1 ] : # I [ 2 ] : : r 2 : : R a n d [ ] # O [ 2 ] : R a n d [ ] # I [ 3 ] : : { r 1, r 2 } # O [ 3 ] : { , } # I [ 4 ] : : { r 1, r 2 } # O [ 4 ] : { , } Values e x p r 2 are assigned to expressions e x p r 1 of different types as follows: Numbers Symbols No assignment is made. expr2 replaces any value previously assigned to expr1. No assignment is made for generic and chameleonic symbols [2.2]. Projections First, the filters of expr1 are simplified in turn, and any Flat, Comm, or Reor properties [4] of its projector f are used. Then the specified part in the simplified form v of f is assigned the value e x p r 2.The actions of the assignment for various types of v are as follows: Lists Symbols Lists Projections The value of f becomes a list (or nested set of lists) with one entry whose indices give the filters of e x p r 1 and whose value is e x p r 2. If the indices of an existing entry of v are equivalent [2.6] to the filters of e x p r 1, then the value of that entry is replaced by e x p r 2. Ifnosuch entry is present, then an additional entry with indices given bythe filters of e x p r 1 and with value expr2 is introduced. New entries are positioned in the list immediately after any entries with more specific [2.6] indices. Unless the relevant filter of expr1 is - 1, 0, or a positive integer, no assignment is made. If the filter corresponds to an existing part of v,this part is replaced by the expression e x p r 2 ; otherwise, additional N u l l filters are introduced so as to include the specified part. If e x p r 2 is a list, then each entry in e x p r 1 is assigned (in parallel) the value of the corresponding e x p r 2 entry (or N u l l if no such entry exists); otherwise, all entries in e x p r 1 are assigned the value e x p r 2.

64 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 1 ] : : a : 1 # O [ 1 ] : 1 # I [ 2 ] : : a # O [ 2 ] : 1 # I [ 3 ] : : a : 2 # O [ 3 ] : 2 # I [ 4 ] : : a # O [ 4 ] : 2 # I [ 5 ] : : g _ : C o m m # O [ 5 ] : C o m m # I [ 6 ] : : g [ b, a ] : x # O [ 6 ] : x # I [ 7 ] : : g # O [ 7 ] : { [ [ 2, b ] ] : x } # I [ 8 ] : : g [ a, b ] # O [ 8 ] : x # I [ 9 ] : : f [ x, y ] : a x y # O [ 9 ] : a x y # I [ 1 0 ] : : f # O [ 1 0 ] : { [ x ] : { [ y ] : a x y } } # I [ 1 1 ] : : f [ x, y ] : b x y # O [ 1 1 ] : b x y # I [ 1 2 ] : : f # O [ 1 2 ] : { [ x ] : { [ y ] : b x y } } # I [ 1 3 ] : : f [ x ˆ 2, z ] : c # O [ 1 3 ] : c # I [ 1 4 ] : : f 2 # O [ 1 4 ] : { [ x ] : { [ z ] : c }, [ x ] : { [ y ] : b x y } } # I [ 1 5 ] : : f [ $ x, $ y ] : d * $ y + $ x # O [ 1 5 ] : $ x + d $ y # I [ 1 6 ] : : f 2 # O [ 1 6 ] : { [ x ] : { [ z ] : c }, [ x ] : { [ y ] : b x y }, [ $ x ] : { [ $ y ] : $ x + d $ y } } # I [ 1 7 ] : : f [ $ q, a ˆ $ q ] : p [ $ q ] # O [ 1 7 ] : p [ $ q ]

65 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 1 8 ] : : f 2 $ q # O [ 1 8 ] : { [ x ] : { [ z ] : c }, [ x ] : { [ y ] : b x y }, [ $ q ] : { [ 2 ] : p [ $ q ] }, # I [ 1 9 ] : : f [ 3, 8 ] # O [ 1 9 ] : p [ 3 ] # I [ 2 0 ] : : v [ 1 ] : v 1 # O [ 2 0 ] : v 1 # I [ 2 1 ] : : v # O [ 2 1 ] : { v 1 } # I [ 2 2 ] : : v [ 3 ] : v 3 # O [ 2 2 ] : v 3 # I [ 2 3 ] : : v # O [ 2 3 ] : { [ 3 ] : v 3, [ 1 ] : v 1 } # I [ 2 4 ] : : v [ 2 ] : v 2 # O [ 2 4 ] : v 2 # I [ 2 5 ] : : v # O [ 2 5 ] : { v 1, v 2, v 3 } # I [ 2 6 ] : : v [ x ] : v x # O [ 2 6 ] : v x # I [ 2 7 ] : : v [ $ x ] : { [ $ y ] : $ x + d $ y } } # O [ 2 7 ] : { [ x ] : v x, [ 1 ] : v 1, [ 2 ] : v 2, [ 3 ] : v 3 } # I [ 2 8 ] : : L o g [ 0 ] # O [ 2 8 ] : L o g [ 0 ] # I [ 2 9 ] : : L o g [ 0 ] : i n f # O [ 2 9 ] : i n f # I [ 3 0 ] : : L o g # O [ 3 0 ] : { [ [ 0 ] ] : i n f } # I [ 3 1 ] : : a + b : 2 # O [ 3 1 ] : 2 # I [ 3 2 ] : : P l u s # O [ 3 2 ] : { [ [ 2, b ] ] : 2 } # I [ 3 3 ] : : a + b + c # O [ 3 3 ] : 2 + c # I [ 3 4 ] : : t : r [ x, y ˆ 2, b * x ] 2 # O [ 3 4 ] : r [ x, y, b x ]

66 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 3 5 ] : : t [ 2 ] [ 1 ] : c # O [ 3 5 ] : c # I [ 3 6 ] : : t 2 # O [ 3 6 ] : r [ x, c, b x ] # I [ 3 7 ] : : t [ 3, 0 ] : P o w # O [ 3 7 ] : P o w # I [ 3 8 ] : : t 2 x # O [ 3 8 ] : r [ x, c, b ] # I [ 3 9 ] : : t [ 2, - 1 ] : 3 / 2 # O [ 3 9 ] : 3 / 2 # I [ 4 0 ] : : t 2 3 c x # O [ 4 0 ] : r [ x, , b ] 2 # I [ 4 1 ] : : t [ 4 ] : e 4 # O [ 4 1 ] : e 4 # I [ 4 2 ] : : t 2 3 c x # O [ 4 2 ] : r [ x, , b, e 4 ] 2 # I [ 4 3 ] : : t [ 7 ] : e 7 # O [ 4 3 ] : e 7 # I [ 4 4 ] : : t 2 3 c x # O [ 4 4 ] : r [ x, , b, e 4,,, e 7 ] 2 # I [ 4 5 ] : : t [ 3, 0 ] : : P l u s # O [ 4 5 ] : P l u s # I [ 4 6 ] : : t 2 3 c # O [ 4 6 ] : r [ x, , b + x, e 4,,, e 7 ] 2 # I [ 4 7 ] : : p : 1 ; q : 2 # O [ 4 7 ] : 2 # I [ 4 8 ] : : { a, p, q } : { 5, q, p } # O [ 4 8 ] : { 5, 2, 1 }

67 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 4 9 ] : : { a, p, q } # O [ 4 9 ] : { 5, 2, 1 } # I [ 5 0 ] : : a : b : c : 8 # O [ 5 0 ] : 8 # I [ 5 1 ] : : { a, b, c } # O [ 5 1 ] : { 8, 8, 8 } # I [ 5 2 ] : : { a, b, c } : 7 # O [ 5 2 ] : 7 # I [ 5 3 ] : : { a, b, c + a } # O [ 5 3 ] : { 7, 7, 1 4 } # I [ 5 4 ] : : { a, b, c } : { 4 } # O [ 5 4 ] : { a, b, c } : { 4 } # I [ 5 5 ] : : { a, b, c, a + b, b + c } # O [ 5 5 ] : { 7, 7, 7, 1 4, 1 4 } e x p r : or e x p r :Null or Set[e x p r ] or Set[e x p r,null] removes any values assigned for the literal expression e x p r. If filters in projections are removed, the projections are correspondingly shortened. "Removal" of a projector results in its replacement by Np [2.3]. If expr is a list, values for each entry are removed. _symb : removes properties [4] assigned to the symbol s y m b (restoring any initial properties if s y m b is system-defined). L c l [6.3] D e l [7.3] S e t [ ] removes values assigned to all expressions. # I [ 1 ] : : a : b : 3 # O [ 1 ] : 3 # I [ 2 ] : : { a, b, c } # O [ 2 ] : { 3, 3, c } # I [ 3 ] : : a : # I [ 4 ] : : { a, b, c } # O [ 4 ] : { a, 3, c } # I [ 5 ] : : f [ x ] : x ˆ 2 ; f [ y ] : 4 ; f [ $ x ] : $ x ˆ 3 3 # O [ 5 ] : $ x # I [ 6 ] : : f 2 3 # O [ 6 ] : { [ y ] : 4, [ x ] : x, [ $ x ] : $ x } # I [ 7 ] : : f [ x ] :

68 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 8 ] : : f 3 # O [ 8 ] : { [ y ] : 4, [ $ x ] : $ x } # I [ 9 ] : : f [ $ y ] : # I [ 1 0 ] : : f 3 # O [ 1 0 ] : { [ y ] : 4, [ $ x ] : $ x } # I [ 1 1 ] : : f [ $ x ] : # I [ 1 2 ] : : f # O [ 1 2 ] : { [ y ] : 4 } # I [ 1 3 ] : : f : # I [ 1 4 ] : : f # O [ 1 4 ] : f # I [ 1 5 ] : : f [ x ] # O [ 1 5 ] : f [ x ] # I [ 1 6 ] : : t : r [ 1, 2, 3, 4, 5 ] # O [ 1 6 ] : r [ 1, 2, 3, 4, 5 ] # I [ 1 7 ] : : t [ 2 ] : # I [ 1 8 ] : : t # O [ 1 8 ] : r [ 1, 3, 4, 5 ] # I [ 1 9 ] : : t [ 0 ] : # I [ 2 0 ] : : t # O [ 2 0 ] : [ 1, 3, 4, 5 ] # I [ 2 1 ] : : a : b : c : 4 # O [ 2 1 ] : 4 # I [ 2 2 ] : : { a, b, c } # O [ 2 2 ] : { 4, 4, 4 } # I [ 2 3 ] : : { a, b } : # I [ 2 4 ] : : { a, b, c } # O [ 2 4 ] : { a, b, 4 } # I [ 2 5 ] : : S e t [ ] # I [ 2 6 ] : : { a, b, c } # O [ 2 6 ] : { a, b, c } I n c [ e x p r, (st e p : 1 )] increments the value of e x p r by s t e p. D o [6.2] D e c [ e x p r, (st e p : 1 )] decrements the value of e x p r by s t e p.

69 3.2 SMP REFERENCE MANUAL / Fundamental operations 3.2 # I [ 1 ] : : i : 1 ; x : a ; # I [ 2 ] : : D e c [ i, 6 ] # O [ 2 ] : - 5 # I [ 3 ] : : i # O [ 3 ] : - 5 # I [ 4 ] : : I n c [ x ] # O [ 4 ] : 1 + a # I [ 5 ] : : x # O [ 5 ] : 1 + a Assignment and deassignment projections have the special capability to effect permanent changes on their filters; all other system projections must leave their filters unchanged.

70 3.3 SMP REFERENCE MANUAL / Fundamental operations Replacements and substitutions Values assigned for expressions [3.2] are used whenever they are applicable. More controlled evaluation is provided by the use of substitution projections. expr1 - > expr2 or Rep[ expr1, expr2, (levspec : Inf ),(rpt : Inf ),(max : Inf )] is a purely syntactic construct which represents a replacement of expr1 by expr2. The replacement is specified to be active when used in S projection substitutions on an expression e x p r only for the first m a x occurrences of e x p r 1 appearing at or below level l e v in e x p r,and during the first r p t passes through e x p r. expr1 - - > expr2 or Repd[ expr1, expr2, (levspec : Inf ),(rpt : Inf ),(max : Inf )] represents a replacement in which expr2 is maintained in an unsimplified form; a new simplified form is obtained whenever the replacement is performed. S [ e x p r, r ep1,r ep2,..., (rp t : 1 ),(le v s p e c : I n f ),(do m c r i t : 1 )] performs substitutions in e x p r specified by the replacements r ep1, r ep2,... inthe domain defined by l e v - spec and domcrit [2.5]. Each successive subpart of expr is compared with the left members of each active replacement r epi in turn; if a match [2.6] is found, then the part is replaced by the corresponding right member, with any necessary substitutions for generic symbols made. The resulting complete expression is scanned until no further replacements can be used, or at most r p t times. (r p t may be I n f ). When a replacement is used, the resulting subexpression is not scanned for possible further substitutions until it is reached on at least the next pass through the complete expression. # I [ 1 ] : : S [ x ˆ 2 + y ˆ 2, x - > a, y - > 1 ] 2 # O [ 1 ] : 1 + a # I [ 2 ] : : S [ 3 x - x ( x + 1 ), x - > 2 b - 2 ] # O [ 2 ] : b - ( b ) ( b ) # I [ 3 ] : : S [ { [ i ] : 3 i - 2, [ 2 i + 1 ] : 5 i }, 2 i - > 3 ] # O [ 3 ] : { [ i ] : 5 / 2, [ 2 i + 1 ] : 1 5 / 2 } # I [ 4 ] : : g t : g [ 3 / 2 ] + g [ 4 ] + g [ x ] # O [ 4 ] : g [ 3 / 2 ] + g [ 4 ] + g [ x ] # I [ 5 ] : : r 1 : g [ $ x ] - > f 1 [ $ x ] # O [ 5 ] : g [ $ x ] - > f 1 [ $ x ] # I [ 6 ] : : r 2 : g [ $ x _ = N a t p [ $ x ] ] - > f 2 [ $ x ] # O [ 6 ] : g [ $ x _ = N a t p [ $ x ] ] - > f 2 [ $ x ] # I [ 7 ] : : r 3 : g [ $ x _ = N u m b p [ $ x ] ] - > f 3 [ $ x ] # O [ 7 ] : g [ $ x _ = N u m b p [ $ x ] ] - > f 3 [ $ x ] # I [ 8 ] : : S [ g t, r 1 ] # O [ 8 ] : f 1 [ 3 / 2 ] + f 1 [ 4 ] + f 1 [ x ] # I [ 9 ] : : S [ g t, r 2 ] # O [ 9 ] : f 2 [ 4 ] + g [ 3 / 2 ] + g [ x ] # I [ 1 0 ] : : S [ g t, r 2, r 1 ] # O [ 1 0 ] : f 1 [ 3 / 2 ] + f 1 [ x ] + f 2 [ 4 ]

71 3.3 SMP REFERENCE MANUAL / Fundamental operations 3.3 # I [ 1 1 ] : : S [ g t, r 3, r 2, r 1 ] # O [ 1 1 ] : f 1 [ x ] + f 3 [ 3 / 2 ] + f 3 [ 4 ] # I [ 1 2 ] : : S [ g t, r 2, r 3, r 1 ] # O [ 1 2 ] : f 1 [ x ] + f 2 [ 4 ] + f 3 [ 3 / 2 ] # I [ 1 3 ] : : S [ x ˆ 2, x - > x + 1 ] 2 # O [ 1 3 ] : ( 1 + x ) # I [ 1 4 ] : : S [ x ˆ 2, x - > x + 1, 4 ] 2 # O [ 1 4 ] : ( 4 + x ) # I [ 1 5 ] : : S [ f [ x ] + f [ y ], f [ x ] - > 1, f [ $ x ] - > $ x ˆ 2 ] 2 # O [ 1 5 ] : 1 + y # I [ 1 6 ] : : r f : f [ $ x ] - > f [ $ x - 1 ] + f [ $ x - 2 ] # O [ 1 6 ] : f [ $ x ] - > f [ $ x ] + f [ $ x ] # I [ 1 7 ] : : S [ f [ 4 ], r f ] # O [ 1 7 ] : f [ 2 ] + f [ 3 ] # I [ 1 8 ] : : S [ f [ 4 ], r f, 4 ] # O [ 1 8 ] : f [ - 4 ] + 4 f [ - 3 ] + 6 f [ - 2 ] + 4 f [ - 1 ] + f [ 0 ] # I [ 1 9 ] : : r f e : { f [ 1 ] - > 1, f [ 0 ] - > 1 } # O [ 1 9 ] : { f [ 1 ] - > 1, f [ 0 ] - > 1 } # I [ 2 0 ] : : S [ f [ 4 ], r f, r f e, 4 ] # O [ 2 0 ] : f [ - 4 ] + 4 f [ - 3 ] + 6 f [ - 2 ] + 4 f [ - 1 ] + f [ 0 ] # I [ 2 1 ] : : S [ f [ 4 ], r f e, r f, 4 ] # O [ 2 1 ] : 5 # I [ 2 2 ] : : S [ f [ 4 ], r f e, r f, I n f ] # O [ 2 2 ] : 5 # I [ 2 3 ] : : h t : S [ x, $ x - > h [ $ x ], 5 ] # O [ 2 3 ] : h [ h [ h [ h [ h [ x ] ] ] ] ] # I [ 2 4 ] : : h r : h [ $ x ] - > y [ $ x ] # O [ 2 4 ] : h [ $ x ] - > y [ $ x ] # I [ 2 5 ] : : S [ h t, h r ] # O [ 2 5 ] : y [ h [ h [ h [ h [ x ] ] ] ] ] # I [ 2 6 ] : : S [ h t, h r, 2 ] # O [ 2 6 ] : y [ y [ h [ h [ h [ x ] ] ] ] ] # I [ 2 7 ] : : S [ h t, h r, 1, - 1 ] # O [ 2 7 ] : h [ h [ h [ h [ h [ x ] ] ] ] ]

72 3.3 SMP REFERENCE MANUAL / Fundamental operations 3.3 # I [ 2 8 ] : : S [ h t, h r, 1, - 2 ] # O [ 2 8 ] : h [ h [ h [ h [ y [ x ] ] ] ] ] # I [ 2 9 ] : : S [ h t, h r, 2, - 2 ] # O [ 2 9 ] : h [ h [ h [ h [ y [ x ] ] ] ] ] # I [ 3 0 ] : : S [ h t, h r, 2, - 3 ] # O [ 3 0 ] : h [ h [ h [ y [ y [ x ] ] ] ] ] # I [ 3 1 ] : : h r p : R e p [ h [ $ x ], y p [ $ x ], 1 ] # O [ 3 1 ] : R e p [ h [ $ x ], y p [ $ x ], 1 ] # I [ 3 2 ] : : S [ h t, h r p ] # O [ 3 2 ] : y p [ h [ h [ h [ h [ x ] ] ] ] ] # I [ 3 3 ] : : S [ h t, h r p, 2 ] # O [ 3 3 ] : y p [ y p [ h [ h [ h [ x ] ] ] ] ] # I [ 3 4 ] : : S [ h t, h r p, I n f ] # O [ 3 4 ] : y p [ y p [ h [ h [ h [ x ] ] ] ] ] # I [ 3 5 ] : : S [ h t, h r p, I n f, I n f ] # O [ 3 5 ] : y p [ y p [ h [ h [ h [ x ] ] ] ] ] # I [ 3 6 ] : : S [ D [ f [ x ], x ], ( D [ $ y, { $ x, 1, $ z } ] ) - - > S [ d [ $ y ], $ x - > $ z ] ] # O [ 3 6 ] : d [ f [ x ] ] # I [ 3 7 ] : : r k : k [ $ x ] - - > ( P r [ $ x ] ; $ x ˆ 2 ) 2 # O [ 3 7 ] : k [ $ x ] - - > ( P r [ $ x ] ; $ x ) # I [ 3 8 ] : : t k : A r [ 4, k ] # O [ 3 8 ] : { k [ 1 ], k [ 2 ], k [ 3 ], k [ 4 ] } # I [ 3 9 ] : : S [ t k, r k ] # O [ 3 9 ] : { 1, 4, 9, 1 6 } Many relations involving mathematical functions are given inexternal files [1.4] in the form of replacements, to be applied using S. S i [ e x p r 1, r ep1,r ep2,..., (le v s p e c : I n f ),(do m c r i t : 1 )] is equivalent to S [expr, rep1,rep2,...,in f, (levspec : I n f ),(domcrit : 1 )]; the repi are repeatedly used in e x p r until the result no longer changes. A r e p [ r ep1,r ep2,... ] performs explicit assignments using Set or Setd projections [3.2] on the Rep or Repd replacements r epi.

73 3.3 SMP REFERENCE MANUAL / Fundamental operations 3.3 # I [ 1 ] : : r : a - > b + c # O [ 1 ] : a - > b + c # I [ 2 ] : : a # O [ 2 ] : a # I [ 3 ] : : A r e p [ r ] # O [ 3 ] : b + c # I [ 4 ] : : a # O [ 4 ] : b + c I r e p [ r ep1,r ep2,... ] yields a list of "inverted" replacements. # I [ 1 ] : : f [ $ x ] - > a ˆ $ x $ x # O [ 1 ] : f [ $ x ] - > a # I [ 2 ] : : I r e p [ % ] $ x # O [ 2 ] : a - > f [ $ x ]

74 3.4 SMP REFERENCE MANUAL / Fundamental operations Numerical evaluation N [ e x p r, (ac c : 6 ),(tr u n c : 0 )] < L d i s t > yields the numerical value of expr in terms of real or complex decimal numbers, maintaining if possible an accuracy of at most acc significant figures, and setting all numerical coefficients smaller in magnitude than t r u n c to zero. A, F and C x projections [2.1] are generated when required. Numerical values for arbitrary expressions may be defined by assignments [3.2] for the corresponding N [ e x p r ] or N [ e x p r, n ]. # I [ 1 ] : : N [ G a m m a [ 3. 2 ] ] # O [ 1 ] : # I [ 2 ] : : N [ G a m m a [ 3. 2 ], 1 2 ] # O [ 2 ] : # I [ 3 ] : : N [ ( I ) ˆ ( I ) ] # O [ 3 ] : * I # I [ 4 ] : : N [ L o g [ I ] - S i n [ E x p [ 1 + A s i n [ 2 I ] ] ], 1 0 ] # O [ 4 ] : * I # I [ 5 ] : : P i # O [ 5 ] : P i # I [ 6 ] : : N [ P i ] # O [ 6 ] : # I [ 7 ] : : N [ s e v e n t h ] : # O [ 7 ] : # I [ 8 ] : : 7 s e v e n t h + 7 # O [ 8 ] : s e v e n t h # I [ 9 ] : : N [ % ] # O [ 9 ] : 8 # I [ 1 0 ] : : N [ f [ $ x _ = N u m b p [ $ x ] ] ] : : N [ S u m [ $ x ˆ 2 / i ˆ 5, { i, 1, 1 0 } ] ] 2 $ x # O [ 1 0 ] : N [ S u m [ - - -, { i, 1, 1 0 } ] ] 5 i # I [ 1 1 ] : : N [ f [ x ] + a * f [ 2 ] + b * f [ I ] + c * f [ 2 - S i n [ 1 7 D e g ] ] ] # O [ 1 1 ] : * ( a b c + f [ x ] ) b I # I [ 1 2 ] : : u : { 1 / 7 0, 1 / 7 0 0, 1 / , 1 / } # O [ 1 2 ] : { 1 / 7 0, 1 / 7 0 0, 1 / , 1 / }

75 3.4 SMP REFERENCE MANUAL / Fundamental operations 3.4 # I [ 1 3 ] : : N [ u ] # O [ 1 3 ] : { , , * ˆ - 4, * ˆ - 5 } # I [ 1 4 ] : : N [ u, 9 ] # O [ 1 4 ] : { , , * ˆ - 4, * ˆ - 5 } # I [ 1 5 ] : : N [ u, 9, ] # O [ 1 5 ] : { , , 0, 0 } # I [ 1 6 ] : : N [ u,, ] # O [ 1 6 ] : { , , 0, 0 } N e q [ e x p r 1, e x p r 2, (ac c : 1 * ˆ - 8 ),(n : 2 ),(r ange : { - 1 0, 1 0 } )] tests for numerical equality of expr1 and expr2 within fractional accuracy acc by evaluating them at least n times with random numerical choices (in the specified r ange) for all symbolic parameters appearing in them. Complex numerical values are treated when possible. E q [5] # I [ 1 ] : : e 1 : ( x + y ) ˆ 3 3 # O [ 1 ] : ( x + y ) # I [ 2 ] : : e 2 : E x [ e 1 ] # O [ 2 ] : 3 x y + 3 x y + x + y # I [ 3 ] : : e 1 = e # O [ 3 ] : ( x + y ) = 3 x y + 3 x y + x + y # I [ 4 ] : : N e q [ e 1, e 2 ] # O [ 4 ] : 1 # I [ 5 ] : : N e q [ e 1 + 1, e 2 ] # O [ 5 ] : 0 # I [ 6 ] : : N e q [ f [ x ], f [ x + 1 ] ] # O [ 6 ] : N e q [ f [ x ], f [ 1 + x ] ] Sum, Prod [9.2] D, Int [9.4]

76 3.5 SMP REFERENCE MANUAL / Fundamental operations Deferred simplification e x p r or H o l d [ e x p r ] yields an expression entirely equivalent to expr but all of whose parts are "held" in an unsimplified form, until "released" by R e l. (Prefix form is "forward-quote" or "acute accent" character.) R e l [ e x p r ] releases all "held" parts of e x p r for simplification. E v [3.7] Projectors in simplified projections are maintained in "held" form. Use of H o l d projections allows expressions to be treated by "name" rather than by "value". # I [ 1 ] : : t : 1 + a + 3 # O [ 1 ] : 1 + a + 3 # I [ 2 ] : : t [ 2 ] # O [ 2 ] : a # I [ 3 ] : : R e l [ t ] # O [ 3 ] : 4 + a # I [ 4 ] : : t [ 3 ] : 4 # O [ 4 ] : 4 # I [ 5 ] : : t # O [ 5 ] : 1 + a + 4 # I [ 6 ] : : u : f [ x ] # O [ 6 ] : f [ x ] # I [ 7 ] : : u [ 0 ] # O [ 7 ] : f # I [ 8 ] : : S [ u, f - > t ] # O [ 8 ] : P r o j [ 1 + a + 4, { x } ] # I [ 9 ] : : S [ u, f - > t ] # O [ 9 ] : t [ x ]

77 3.6 SMP REFERENCE MANUAL / Fundamental operations Pre-simplification! e x p r represents the simplified form of expr regardless of its environment. Simplifications indicated by! are performed during input.! may be used to insert simplified forms as filters in projections for which the Smp property [4] has the value 0.! denotes pre-simplification only if it is not the first character of an input line [1.6]. #I[1]:: _f[smp]:0 #O[1]: 0 #I[2]:: f[!1+1,1+1] #O[2]: f[2,1 + 1] #I[3]:: #O[3]: #I[4]:: #O[4]: #I[5]:: #O[5]: #I[6]:: #O[6]: #I[7]:: #O[7]: a:b b a:c c {a,b,c} {c,b,c} (!a):d d {a,b,c} {d,b,d} 2 Pr[1];!Pr[2] 1 #O[8]: 2 #I[9]:: j:$xˆ2 2 #O[9]: $x #I[10]:: #O[10]: #I[11]:: Ar[4,j] {$x,2,j[3],j[4]} Ar[4,!j] #O[11]: {1,4,9,16}

78 3.7 SMP REFERENCE MANUAL / Fundamental operations Partial simplification E v [ e x p r ] yields a held form obtained by simplifying e x p r but leaving unsimplified any delayed values which appear. # I [ 1 ] : : a : b ; a a : : b # O [ 1 ] : b # I [ 2 ] : : b : c # O [ 2 ] : c # I [ 3 ] : : { E v [ a ], E v [ a a ] } # O [ 3 ] : { c, b } # I [ 4 ] : : E v [ # I [ 1 ] ] # O [ 4 ] : a : b ; a a : : b

79 4. Properties _ s y m b or P r o p [ s y m b ] is a list giving properties of the symbol s y m b used to specify treatment of s y m b or its projections. The operations of projection [2.3, 7.3], assignment [3.2] and deassignment [3.2] may be applied to _ s y m b just as to symbols. _ s y m b : causes the properties of a system-defined symbol s y m b to revert to their initial form [3.2]. # I [ 1 ] : : _ a # O [ 1 ] : _ a # I [ 2 ] : : _ a : { [ p 1 ] : 1, [ p 2 ] : 0 } # O [ 2 ] : { [ p 1 ] : 1, [ p 2 ] : 0 } # I [ 3 ] : : _ a [ p 3 ] : x # O [ 3 ] : x # I [ 4 ] : : _ a # O [ 4 ] : { [ p 3 ] : x, [ p 1 ] : 1, [ p 2 ] : 0 } # I [ 5 ] : : _ a [ p 1 ] : # I [ 6 ] : : _ a # O [ 6 ] : { [ p 3 ] : x, [ p 2 ] : 0 } # I [ 7 ] : : _ D o t # O [ 7 ] : { [ S y s ] : 1, [ F l a t ] : 1, [ T i e r ] : 1 } # I [ 8 ] : : _ D o t [ C o m m ] : 1 # O [ 8 ] : 1 # I [ 9 ] : : _ D o t # O [ 9 ] : { [ C o m m ] : 1, [ S y s ] : 1, [ F l a t ] : 1, [ T i e r ] : 1 } # I [ 1 0 ] : : _ D o t : # I [ 1 1 ] : : _ D o t # O [ 1 1 ] : { [ S y s ] : 1, [ F l a t ] : 1, [ T i e r ] : 1 } Asymbol is considered to "carry" a particular property p if the value of _ s y m b [ p ] is not "false" [5]. The properties Gen, Mgen, Cham, Smp, Tier, Flat, Reor and Comm, which affect treatment of assignments for projections, must be defined before the projections are assigned. The following are system-defined properties for a symbol s : S y s Cons Inline Symbol with system-defined values for projections. Symbol for which some projections are evaluated by binary code internally loaded by Cons or Load [10.7]. When a program invoking a projection from s is constructed by Cons or Prog [10.7], the program will use directly the value of the projection rather than call an intermediate language function corresponding to s.

80 4. SMP REFERENCE MANUAL / Properties 4. G e n Generic symbol [2.2], representing the class of expressions on which application of the template _ s [ G e n ] yields a non-zero number [2.6]. M g e n Multi-generic symbol [2.2]. C h a m Chameleonic symbol [2.2]. I n i t S m p S e r Any value assigned for _s[in i t ] is simplified, and then removed, when s next appears as a projector. The ith filter in a projection from s is simplified until any projector not carrying the property R e c has appeared recursively at most _ s [ S m p ] [ i ] times [3.1]. If the value of _ s [ S m p ] [ i ] is 0,the filter is left unsimplified. If no value is given, it is taken by default as I n f,and the filter is simplified until it no longer changes. If the value of _ s [ S m p ] is a number or symbol, it is taken to apply to all filters. Filters in projections from s are simplified from left to right even when parallel processing is possible. R e c Arbitrary recursive appearances of s as a projector are permitted [3.1]. P r T r a c e T i e r F l a t R e o r Comm D i s t P o w d i s t L d i s t C o n s t E x t r E x t e T y p e The value of _ s [ P r ] is used as the printing format for s and its projections. Fmt, Sx [10.1] If the value of _s[tr a c e ] is "true", then any projections from s are printed before evaluation. Any other values are applied as templates to projections from s. [10.10] The projections s [x] [y] and s [x,y] are distinguished [2.3]; filters separated by commas are used together in the extraction of parts specified by projections. Values assigned to projections are represented by list entries with null projection indices containing the complete sequences of filters in the projections. All projections from s are flattened [7.7], so that s is treated as an "associative n -ary function". Assignments for projections are made as if s carried the property T i e r. Filters of projections from s are placed in canonical order, by reordering them using permutation symmetries given as the value of _s[re o r ] [7.7]. Assignments for projections are made as if s carried the property T i e r. Equivalent to _ s [ Reor] : Sym [7.7]. Causes filters of projections from s to be placed in canonical order, sothat s represents a "commutative function". _ f [ D i s t ] : : g1,(h1 :g1 ),(k1 :f ),(pspec1 :I n f ) defines f to be distributive over projections from gi appearing as its filters in positions specified by pspeci,yielding projections of hi and ki. The definitions are used as defaults in E x [7.8]. _ f [ P o w d i s t ] : : g1,(h1 :P l u s ) defines projections of f to be "power expandable" over projections of hi appearing as their first filters, and yielding projections from gi. The definitions are used as defaults in E x [7.8]. Projections from s are "distributed" over the entries of lists appearing as filters in projections from s [7.7]. s is treated as a numerical constant for differentiation [9.4] and other purposes. The projector f of a projection containing s (as an isolated symbol or as a projector) in its filters is replaced by a template given asthe value of _ s [ E x t r, f ] (see below). The value of _ s [ E x t e ] is applied as a template to any projection whose filters involve s (as an isolated symbol or as a projector), and for whose projector f no entry _s[ex t r,f] exists (see below). E x t e is also effective for entries in lists. s is treated as carrying the additional properties assigned to a symbol given as the value of _ s [ T y p e ]. These additional properties are considered only if properties given directly for s are inadequate. Any number of T y p e indirection levels may be used.

81 4. SMP REFERENCE MANUAL / Properties 4. F i l e The value of _ s [ F i l e ] is used as the default f o r m a t [A.6] entry in any fi l e s p e c for the file s [10.3]. _s[fi l e ] is reassigned automatically when format is modified in a filespec or when the graphics code g c o d e [A.6] is modified in an O p e n [10.3] projection. All system-defined symbols carry the property T i e r. # I [ 1 ] : : f [ $ x ] : : $ x ˆ P i P i # O [ 1 ] : $ x # I [ 2 ] : : f [ 3 ] P i # O [ 2 ] : 3 # I [ 3 ] : : C o n s [ f ] # O [ 3 ] : { f } # I [ 4 ] : : _ f # O [ 4 ] : { [ C o n s ] : 1 } # I [ 5 ] : : f [ 3 ] # O [ 5 ] : # I [ 6 ] : : _ f [ C o n s ] : # I [ 7 ] : : f [ 3 ] P i # O [ 7 ] : 3 # I [ 8 ] : : g [ $ x, $ y ] : : f [ $ x ] + $ y # O [ 8 ] : f [ $ x ] + $ y # I [ 9 ] : : P r o g [ g ] d o u b l e g ( ) ; d o u b l e f ( ) ; / * g [ $ x, $ y ] : : f [ $ x ] + $ y * / d o u b l e g ( d _ x, d _ y ) d o u b l e d _ x ; d o u b l e d _ y ; { r e t u r n f ( d _ x ) + d _ y ; } # O [ 9 ] : { g } # I [ 1 0 ] : : f _ : I n l i n e # O [ 1 0 ] : I n l i n e

82 4. SMP REFERENCE MANUAL / Properties 4. # I [ 1 1 ] : : P r o g [ g ] d o u b l e g ( ) ; d o u b l e p o w ( ) ; / * g [ $ x, $ y ] : : f [ $ x ] + $ y P i f [ $ x ] : : $ x * / d o u b l e g ( d _ x, d _ y ) d o u b l e d _ x ; d o u b l e d _ y ; { r e t u r n p o w ( d _ x, ) + d _ y ; } # O [ 1 1 ] : { g } # I [ 1 ] : : _ $ x # O [ 1 ] : { [ G e n ] : 1 } # I [ 2 ] : : _ $ x [ G e n ] : I n t p # O [ 2 ] : I n t p # I [ 3 ] : : f [ $ x ] : $ x ˆ 2 2 # O [ 3 ] : $ x # I [ 4 ] : : f [ x ] + f [ 3 ] # O [ 4 ] : 9 + f [ x ] # I [ 1 ] : : _ f [ I n i t ] : : P r [ " U s i n g f " ] # O [ 1 ] : P r [ " U s i n g f " ] # I [ 2 ] : : f # O [ 2 ] : f # I [ 3 ] : : f [ x ] + f [ y ] U s i n g f # O [ 3 ] : f [ x ] + f [ y ] # I [ 4 ] : : _ f # O [ 4 ] : _ f # I [ 1 ] : : _ g [ S m p ] : 0 # O [ 1 ] : 0 # I [ 2 ] : : _ h [ S m p ] : { 0,, } # O [ 2 ] : { 0,, }

83 4. SMP REFERENCE MANUAL / Properties 4. # I [ 3 ] : : _ i [ S m p ] [ $ x ] : : O d d p [ $ x ] # O [ 3 ] : O d d p [ $ x ] # I [ 4 ] : : { f [ ], g [ ], h [ 1 + 1, 1 + 1, 1 + 1, ], i [ 1 + 1, 1 + 1, 1 + 1, ] } # O [ 4 ] : { f [ 2 ], g [ ], h [ 1 + 1, 2, 2, 2 ], i [ 2, 1 + 1, 2, ] } # I [ 1 ] : : _ f [ P r ] : a # O [ 1 ] : a # I [ 2 ] : : f ˆ 2 + f [ x ] 2 # O [ 2 ] : * f [ x ] + a # I [ 3 ] : : L p r [ % ] f [ x ] + f ˆ 2 # I [ 4 ] : : _ b i r d [ P r ] : F m t [ { { 0, 0 }, { 0, 1 }, { 0, 2 } }, " [ ] ", " \ / ", " " ] \ / # O [ 4 ] : [ ] # I [ 5 ] : : b i r d ˆ b i r d b i r d ˆ b i r d ˆ b i r d \ / \ / \ / [ ] \ / [ ] + [ ] # O [ 5 ] : * [ ] # I [ 6 ] : : L p r [ % ] b i r d ˆ ( b i r d + b i r d ˆ b i r d ) # I [ 7 ] : : _ g [ P r ] [ $ x, $ y ] : F m t [ { { 0, 0 }, { 1, - 1 }, { 2, - 2 } }, $ x, " s t e p ", $ y ] # O [ 7 ] : $ x s t e p $ y # I [ 8 ] : : { g [ s t e p, s t e p ], g [ ( a + b ) / c, x / ( y + z ) ], g [ 3 ] } a + b # O [ 8 ] : * { s t e p, , g [ 3 ] } s t e p c s t e p s t e p x y + z # I [ 1 ] : : f _ : T r a c e # O [ 1 ] : T r a c e

84 4. SMP REFERENCE MANUAL / Properties 4. # I [ 2 ] : : f [ f [ x ] ] + f [ y ] f [ x ] f [ f [ x ] ] f [ y ] # O [ 2 ] : f [ y ] + f [ f [ x ] ] # I [ 3 ] : : _ g [ T r a c e ] : : P r [ L e n [ $ x ] ] # O [ 3 ] : P r [ L e n [ $ x ] ] # I [ 4 ] : : g [ g [ 1, 2, 3 ], 1 ] + g [ 4 ] # O [ 4 ] : g [ 4 ] + g [ g [ 1, 2, 3 ], 1 ] # I [ 5 ] : : S e t _ : T r a c e # O [ 5 ] : T r a c e # I [ 6 ] : : a : b : c a : ( b : c ) b : c # O [ 6 ] : c # I [ 1 ] : : f [ x ] [ y ] # O [ 1 ] : f [ x, y ] # I [ 2 ] : : f _ : T i e r # O [ 2 ] : T i e r # I [ 3 ] : : f [ x ] [ y ] # O [ 3 ] : P r o j [ f [ x ], { y } ] # I [ 4 ] : : { P l u s [ a, b, 1 ], P l u s [ a, b ] [ 1 ] } # O [ 4 ] : { 1 + a + b, a } # I [ 1 ] : : f _ : F l a t # O [ 1 ] : F l a t # I [ 2 ] : : f [ f [ a, b ], f [ c + f [ d, e ], f [ f [ c ] ] ], e ] # O [ 2 ] : f [ a, b, c + f [ d, e ], c, e ] # I [ 3 ] : : g _ : C o m m # O [ 3 ] : C o m m # I [ 4 ] : : g [ b, a ] + g [ d, c ] + g [ c, d ] # O [ 4 ] : g [ a, b ] + 2 g [ c, d ]

85 4. SMP REFERENCE MANUAL / Properties 4. # I [ 5 ] : : _ h [ R e o r ] : A s y m # O [ 5 ] : A s y m # I [ 6 ] : : { h [ b, a ], h [ a, b ], h [ a, a ], h [ c, b, a ], h [ a, c, b ], h [ a, b, a ] } # O [ 6 ] : { - h [ a, b ], h [ a, b ], 0, - h [ a, b, c ], - h [ a, b, c ], 0 } # I [ 7 ] : : _ i [ R e o r ] : { C y c l i c [ 1, 2, 3 ], A s y m [ 4, 5 ] } # O [ 7 ] : { C y c l i c [ 1, 2, 3 ], A s y m [ 4, 5 ] } # I [ 8 ] : : { i [ b, a, c, e, d ], i [ b, b, a, d, e ], i [ b, c, a, e, d ] } # O [ 8 ] : { - i [ a, c, b, d, e ], i [ a, b, b, d, e ], - i [ a, b, c, d, e ] } # I [ 1 ] : : _ f [ D i s t ] : : P l u s # O [ 1 ] : P l u s # I [ 2 ] : : E x [ f [ a + f [ b + c ] ] ] # O [ 2 ] : f [ a ] + f [ f [ b ] ] + f [ f [ c ] ] # I [ 3 ] : : _ f [ D i s t ] : : { M u l t, D o t } # O [ 3 ] : { M u l t, D o t } # I [ 4 ] : : E x [ f [ a b c ] + f [ u. v. w ] + f [ x + y ] ] # O [ 4 ] : f [ x + y ] + f [ u ]. f [ v ]. f [ w ] + f [ a ] f [ b ] f [ c ] # I [ 5 ] : : _ j [ D i s t ] : : { { g, h, k } } # O [ 5 ] : { { g, h, k } } # I [ 6 ] : : t : j [ g [ a, b ], g p [ x, y ], g [ c, d, e ] ] # O [ 6 ] : j [ g [ a, b ], g p [ x, y ], g [ c, d, e ] ] # I [ 7 ] : : E x [ t ] # O [ 7 ] : h [ k [ a, g p [ x, y ], g [ c, d, e ] ], k [ b, g p [ x, y ], g [ c, d, e ] ] ] # I [ 8 ] : : _ j [ D i s t ] : : { { g, h, j }, g p } # O [ 8 ] : { { g, h, j }, g p } # I [ 9 ] : : E x [ t ] # O [ 9 ] : h [ g p [ h [ j [ a, x, c ], j [ a, x, d ], j [ a, x, e ] ], h [ j [ a, y, c ], j [ a, y, d ], j [ a, y, e ] ] ], g p [ h [ j [ b, x, c ], j [ b, x, d ], j [ b, x, e ] ], h [ j [ b, y, c ], j [ b, y, d ], j [ b, y, e ] ] ] ] # I [ 1 ] : : _ f [ P o w d i s t ] : : M u l t # O [ 1 ] : M u l t # I [ 2 ] : : E x [ f [ a + b, 3 ] ] # O [ 2 ] : f [ a, 3 ] + f [ b, 3 ] + 3 f [ a, 1 ] f [ b, 2 ] + 3 f [ a, 2 ] f [ b, 1 ]

86 4. SMP REFERENCE MANUAL / Properties 4. # I [ 3 ] : : _ f [ P o w d i s t ] : : { { M u l t, P l u s }, { D o t, g } } # O [ 3 ] : { { M u l t, P l u s }, { D o t, g } } # I [ 4 ] : : E x [ f [ a + b + c, 2 ] ] # O [ 4 ] : 2 a b + 2 a c + 2 b c + a + b + c # I [ 5 ] : : E x [ f [ g [ a, b ], 3 ] ] # O [ 5 ] : g [ a, b ]. g [ a, b ]. g [ a, b ] # I [ 1 ] : : f _ : L d i s t # O [ 1 ] : L d i s t # I [ 2 ] : : f [ { a 1, a 2, a 3 }, { b 1, b 2 }, c ] # O [ 2 ] : { f [ a 1, b 1, c ], f [ a 2, b 2, c ], f [ a 3, c ] } # I [ 3 ] : : f [ { { 1, 2 }, { 3, 4 } }, c, { a 1, a 2, a 3 } ] # O [ 3 ] : { { f [ 1, c, a 1 ], f [ 2, c, a 1 ] }, { f [ 3, c, a 2 ], f [ 4, c, a 2 ] }, f [ c, a 3 ] } # I [ 4 ] : : f [ { [ x ] : a x, [ y ] : a y }, { [ z ] : b z, [ x ] : b x }, c ] # O [ 4 ] : { [ x ] : f [ a x, b x, c ], [ y ] : f [ a y, c ], [ z ] : f [ b z, c ] } # I [ 5 ] : : { 4, 5, 3 } + a { 3, 4, { 2, 5 } } # O [ 5 ] : { a, a, { a, a } } # I [ 6 ] : : r [ $ x ] : $ x + 3 # O [ 6 ] : 3 + $ x # I [ 7 ] : : r # O [ 7 ] : { [ $ x ] : 3 + $ x } # I [ 8 ] : : r p : r ˆ 2 2 # O [ 8 ] : { [ $ x ] : ( 3 + $ x ) } # I [ 9 ] : : r p [ x ] 2 # O [ 9 ] : ( 3 + x ) # I [ 1 ] : : _ f [ S m p ] : 0 # O [ 1 ] : 0 # I [ 2 ] : : f [ ] + g [ ] # O [ 2 ] : f [ ] + g [ 2 ] # I [ 3 ] : : g _ f # O [ 3 ] : f # I [ 4 ] : : _ g # O [ 4 ] : { [ T y p e ] : : f }

87 4. SMP REFERENCE MANUAL / Properties 4. # I [ 5 ] : : f [ ] + g [ ] # O [ 5 ] : f [ ] + g [ ] symb _ : p or P r s e t [symb,p] is equivalent to _ s y m b [ p ] : 1 and assigns the property p to the symbol s y m b. symb _ st or T y s e t [symb,st ] is equivalent to _ s y m b [ T y p e ] : : s t and assigns the symbol s y m b to have the type of the symbol s t. # I [ 1 ] : : f _ : p 1 # O [ 1 ] : p 1 # I [ 2 ] : : _ f # O [ 2 ] : { [ p 1 ] : 1 } # I [ 3 ] : : f _ : g _ : p 2 # O [ 3 ] : p 2 # I [ 4 ] : : _ f # O [ 4 ] : { [ p 2 ] : 1, [ p 1 ] : 1 } # I [ 5 ] : : f _ g _ t 1 # O [ 5 ] : t 1 # I [ 6 ] : : _ f # O [ 6 ] : { [ T y p e ] : : t 1, [ p 2 ] : 1, [ p 1 ] : 1 } Entries _s[ex t r ] and _s[ex t e ] in the property list of a symbol s allow for "type extension". Standard projections may be replaced by special projections if some of their filters are of some special extended type. Hence, for example, a product may be entered as a projection of M u l t,but is replaced by a projection of P s m u l t if one or more of its filters is a power series (Ps projection [9.5]). Projections reached by type extension are usually not described separately in this document. Type extension is carried out before any Flat, Comm, or Reor properties of the original operator are used. Thus such properties must be specifically given to"relacement extensions" if they are desired. # I [ 1 ] : : _ f [ E x t r, g ] : f g # O [ 1 ] : f g # I [ 2 ] : : _ f [ E x t r, M u l t ] : f m u l t # O [ 2 ] : f m u l t # I [ 3 ] : : g [ f [ x ], y ] + g [ x, y ] * f [ a, b ] + c * a * b * f # O [ 3 ] : f g [ f [ x ], y ] + f m u l t [ g [ x, y ], f [ a, b ] ] + f m u l t [ c, a, b, f ] # I [ 4 ] : : _ f [ E x t e ] : f g e n # O [ 4 ] : f g e n # I [ 5 ] : : g [ f [ x ], y ] + f [ f [ x ], y ] # O [ 5 ] : f g [ f [ x ], y ] + f g e n [ f [ f [ x ], y ] ]

88 4. SMP REFERENCE MANUAL / Properties 4. # I [ 6 ] : : j _ f # O [ 6 ] : f # I [ 7 ] : : f * a + g * b + j * c # O [ 7 ] : f m u l t [ f, a ] + f m u l t [ j, c ] + b g # I [ 8 ] : : { f [ 1 ], f [ 2 ] } # O [ 8 ] : f g e n [ { f [ 1 ], f [ 2 ] } ]

89 5. Relational and logical operations An expression is treated as "false" if it is zero, and "true" if it is any non-zero number. P [ e x p r ] yields 1 if e x p r is "true", and 0 otherwise. The relational and logical projections described below yield 0 or 1 if their "truth" or "falsity" can be determined (by syntactic comparison or linear elimination of symbolic parameters); otherwise they yield simplified forms of undetermined truth value. When only one filter is given, the relational projections defined below yield as images that filter. When more than two filters are given, they yield the conjunction of results for each successive pair of filters; however, U n e q is an exception, yielding the conjunction of results for all possible pairs of filters. expr1 = expr2 or Eq[ expr1, expr2 ] < C o m m > represents an equation asserting the equality of expr1 and expr2. Equations represented by Eq projections are used in S o l [9.3]. N e q [3.4] expr1 = expr2 or Uneq[ expr1, expr2 ] < C o m m > asserts the inequality of e x p r 1 and e x p r 2. U n e q [ e x p r 1, e x p r 2,...] asserts inequality of all the e x p r i. expr1 > expr2 or Gt[ expr1, expr2 ] asserts that e x p r 1 is numerically larger than e x p r 2. expr1 >= expr2 or Ge[ expr1, expr2 ] asserts that e x p r 1 is numerically larger than or equal to e x p r 2. expr1 < expr2 is equivalent to expr2 > expr1. expr1 <= expr2 is equivalent to expr2 >= expr1. The assignment [3.2] expr1 > expr2 : 1 defines the expression expr1 to be greater than expr2. The projection Ge tests for assignments of relevant Gt projections. If # and ## represent special input forms for relational projections then expr1 # expr2 ## expr3 is converted to (expr1 # expr2) & (expr2 ## expr3) [2.10]. However, combinations of the form expr1 = expr2 = expr3 =... are converted to (expr1 = expr2) & (expr2 = expr3) & (expr1 = expr3) &..., asserting inequality of all the expri. #I[1]:: {2+1=3,x=1,P[x=1],P[2+1=3]} #O[1]: {1,x = 1,0,1} #I[2]:: {Eq[2],Uneq[2],2 =2+1,Uneq[1,2,1],Uneq[1,2,3,4]} #O[2]: {2,1,1,0,1} #I[3]:: {x<y,x+3>x+2,x+a<x+b,2x+a>x-3a} #O[3]: {y > x,1,b > a,4a + x > 0} #I[4]:: {x>y>z,x>y>=z,x=y=z} #O[4]: {x > y & y > z,y >= z & x > y,x = y & y = z}

90 5. SMP REFERENCE MANUAL / Relational and logical operations 5. #I[5]:: a>0:1 #O[5]: 1 #I[6]:: {a>0,a<0,0<a,a>=0,a>1} #O[6]: {1,0,1,1,a > 1} #I[7]:: f[$x]>f[$y]:$x>$y #O[7]: $x > $y #I[8]:: {f[3]>f[2],f[x]>f[y],f[x+a]>f[x],f[x+b]>f[x]} #O[8]: {1,x > y,1,b > 0} #I[9]:: 47 =d =d+1 =e =f =57 #O[9]: 46 = d & 47 = d & 47 = e & 47 = f & d = 56 & d = 57 & d = e & d = f & e = 57 & e = f & f = 57 & 1 + d = e & 1 + d = f e x p r or N o t [ e x p r ] yields "true" if e x p r is 0 and 0 if e x p r is "true". e x p r 1 & e x p r 2 & e x p r 3... or A n d [ e x p r 1, e x p r 2, e x p r 3,...] < C o m m, F l a t > forms the conjunction of the e x p r i. e x p r 1 e x p r 2 e x p r 3... or O r [ e x p r 1, e x p r 2, e x p r 3,...] < C o m m, F l a t > forms the inclusive disjunction of the e x p r i. e x p r 1 e x p r 2 e x p r 3... or X o r [ e x p r 1, e x p r 2, e x p r 3,...] < C o m m, F l a t > forms the exclusive disjunction of the e x p r i. expr1 => expr2 or I m p [ e x p r 1, e x p r 2 ] represents the logical implication "if e x p r 1 then e x p r 2 ". # I [ 1 ] : : 1 & 0 4 > 3 # O [ 1 ] : 1 # I [ 2 ] : : O u t e r [ f, { 1, 0 }, { 1, 0 } ] # O [ 2 ] : { { f [ 1, 1 ], f [ 1, 0 ] }, { f [ 0, 1 ], f [ 0, 0 ] } } # I [ 3 ] : : O u t e r [ A n d, { 1, 0 }, { 1, 0 } ] # O [ 3 ] : { { 1, 0 }, { 0, 0 } } # I [ 4 ] : : O u t e r [ O r, { 1, 0 }, { 1, 0 } ] # O [ 4 ] : { { 1, 1 }, { 1, 0 } } # I [ 5 ] : : O u t e r [ X o r, { 1, 0 }, { 1, 0 } ] # O [ 5 ] : { { 0, 1 }, { 1, 0 } } # I [ 6 ] : : O u t e r [ I m p, { 1, 0 }, { 1, 0 } ] # O [ 6 ] : { { 1, 0 }, { 1, 1 } }

91 5. SMP REFERENCE MANUAL / Relational and logical operations 5. I s [ e x p r ] yields 1 if expr represents a logical tautology "true" regardless of the "truth" or "falsity" of any symbols appearing in it, and yields 0 otherwise. N e q [3.4] # I [ 1 ] : : { I s [ p p ], I s [ p p ], I s [ p & p ], I s [ ( p = > q ) = ( ( q ) = > ( p ) ) ] } # O [ 1 ] : { 1, 0, 0, 1 } # I [ 2 ] : : b a s e : ( e v e n o d d ) = > ( i n t & r e a l ) # O [ 2 ] : e v e n o d d = > i n t & r e a l # I [ 3 ] : : { I s [ b a s e = > o d d = > i n t ], I s [ b a s e = > i n t = > o d d ], I s [ b a s e = > ( r e a l ) = > ( e v e n ) ] } # O [ 3 ] : { 1, 0, 1 } I f [6.1] I n t p, e t c.[7.6] O r d [ e x p r 1, e x p r 2 ] yields +1 if expr1 is lexically [10.5] ordered before expr2, - 1 if expr1 is lexically ordered after expr2, and 0 if they are literally equivalent [2.6]. Reor, Sort [7.7] # I [ 1 ] : : { O r d [ a, b ], O r d [ b, a ], O r d [ f [ x ], x ], O r d [ a, a ] } # O [ 1 ] : { 1, - 1, - 1, 0 }

92 6. Control structures 6.1 Conditional statements 6.2 Iteration 6.3 Procedures and flow control

93 6.1 SMP REFERENCE MANUAL / Control structures Conditional statements I f [ p r ed,(e x p r 1 : N u l l ),(e x p r 2 : N u l l ),(e x p r 3 : N u l l )] yields e x p r 1 if the predicate expression p r ed is determined to be "true" [5]; e x p r 2 if it is determined to be "false", and expr3 if its truth or falsity cannot be determined [5]. Only the expri selected by evaluation of p r ed is simplified. # I [ 1 ] : : f 1 [ $ x ] : : I f [ $ x > 0, a ] # O [ 1 ] : I f [ $ x > 0, a ] # I [ 2 ] : : f 2 [ $ x ] : : I f [ $ x > 0, a, b ] # O [ 2 ] : I f [ $ x > 0, a, b ] # I [ 3 ] : : f 3 [ $ x ] : : I f [ $ x > 0, a, b, c ] # O [ 3 ] : I f [ $ x > 0, a, b, c ] # I [ 4 ] : : { f 1 [ 1 ], f 2 [ 1 ], f 3 [ 1 ] } # O [ 4 ] : { a, a, a } # I [ 5 ] : : { f 1 [ - 1 ], f 2 [ - 1 ], f 3 [ - 1 ] } # O [ 5 ] : {, b, b } # I [ 6 ] : : { f 1 [ x ], f 2 [ x ], f 3 [ x ] } # O [ 6 ] : {,, c } S e l [ p r ed1,e x p r 1, p r ed2,e x p r 2,...] tests p r ed1, p r ed2,... inturn, selecting the e x p r i associated with the first one determined to be "true" [5] (N u l l if none are "true"). Only the p r edi tested and the e x p r i selected are simplified. # I [ 1 ] : : f [ $ x ] : : S e l [ $ x > 5, a, $ x < 3, b ] # O [ 1 ] : S e l [ $ x > 5, a, 3 > $ x, b ] # I [ 2 ] : : { f [ 7 ], f [ 4 ], f [ 2 ], f [ x ] } # O [ 2 ] : { a,, b, } # I [ 3 ] : : g [ $ x ] : : S e l [ $ x > 5, a, $ x < 3, b, P r [ " n o v a l u e f o r ", $ x ] ] # O [ 3 ] : S e l [ $ x > 5, a, 3 > $ x, b, P r [ " n o v a l u e f o r ", $ x ] ] # I [ 4 ] : : { g [ 7 ], g [ 4 ], g [ 2 ], g [ x ] } n o v a l u e f o r 4 n o v a l u e f o r x # O [ 4 ] : { a,, b, }

94 6.2 SMP REFERENCE MANUAL / Control structures Iteration R p t [ e x p r, (n : 1 )] simplifies e x p r n times, yielding the last value found. # I [ 1 ] : : R p t [ P r [ x ], 3 ] x x x # O [ 1 ] : x # I [ 2 ] : : r : x # O [ 2 ] : x # I [ 3 ] : : R p t [ r : 1 / ( 1 + r ), 3 ] 1 # O [ 3 ] : x L o o p [ (pr econd : 1 ),e x p r, (po s t c o n d : 1 )] repeatedly simplifies precond, expr and postcond in turn, yielding the last value of expr found before prec o n d or p o s t c o n d ceases to be "true" [5]. # I [ 1 ] : : i : 0 ; L o o p [ i < 5, P r [ i, i! ] ; I n c [ i ] ] # O [ 1 ] : 5 # I [ 2 ] : : i # O [ 2 ] : 5 # I [ 3 ] : : i : 0 ; L o o p [, P r [ i ] ; I n c [ i ], i < 3 ] # O [ 3 ] : 3 # I [ 4 ] : : i : 0 ; L o o p [ i < 0, P r [ i ] ; I n c [ i ] ] # I [ 5 ] : : i : 0 ; L o o p [, P r [ i ] ; I n c [ i ], i < 0 ] 0 # O [ 5 ] : 1 F o r [ i n i t, t e s t, n e x t, e x p r ] first simplifies i n i t,and then repeatedly simplifies e x p r and n e x t in turn until t e s t fails to be "true" (according to the sequence i n i t <t e s t e x p r n e x t >), yielding the last form of e x p r found.

95 6.2 SMP REFERENCE MANUAL / Control structures 6.2 # I [ 1 ] : : F o r [ i : 0, i < 5, I n c [ i ], P r [ i, i! ] ] # O [ 1 ] : 2 4 # I [ 2 ] : : i # O [ 2 ] : 5 # I [ 3 ] : : F o r [ x : , x = 0, x : F l o o r [ x / 3 3 ], P r [ x ] ] # O [ 3 ] : 9 D o [ v a r, (st a r t : 1 ),e n d, (st e p : 1 ),e x p r ] first sets var to start and then repeatedly evaluates expr,successively incrementing the value of var by step until it reaches the value e n d ;the image is the last form of e x p r found. # I [ 1 ] : : D o [ i, 4, P r [ i, i! ] ] # O [ 1 ] : 2 4 # I [ 2 ] : : i # O [ 2 ] : i # I [ 3 ] : : D o [ i, 2, 8, 3, P r [ i, i! ] ] # O [ 3 ] : # I [ 4 ] : : D o [ i, x, x + 2, f [ 1 / i ] : i ] # O [ 4 ] : 2 + x # I [ 5 ] : : f # O [ 5 ] : { [ ] : 2 + x, [ ] : 1 + x, [ - ] : x } 2 + x 1 + x x Inc, Dec [3.2] Ret, Jmp [6.3]

96 6.3 SMP REFERENCE MANUAL / Control structures Procedures and flow control e x p r 1 ; e x p r 2 ;...e x p r n or P r o c [ e x p r 1, e x p r 2,..., e x p r n ] represents a procedure in which the expressions expri are simplified in turn, yielding finally the value of e x p r n. In the form e x p r 1 ; e x p r 2 ;...; e x p r k ; the last filter of P r o c is taken to be N u l l [1.1]. The unsimplified form of each expri is maintained throughout the execution of a P r o c,so as to allow resimplification if required by a control transfer. Unless specified otherwise by Lcl projections, all expressions may be accessed and affected in any procedure. Objects local to a procedure are (c f.[1.3]): % % The last expression (other than Null [2.2]) generated by simplification of a segment in the procedure. % I [ i ] The i th (unsimplified) segment. < L d i s t > % O [ i ] The value of the i th segment. < L d i s t > % T [ i ] The approximate time (in seconds [A.8]) required to generate % O [ i ]. < L d i s t > Get[ ] initiates an interactive procedure, terminated by input termination character [1.5] or a Ret projection. A prompt % I [ i ] : : is given for the i th input segment. # I [ 1 ] : : t : E ˆ # O [ 1 ] : E # I [ 2 ] : : G e t [ ] % I [ 1 ] : : N [ t ] % O [ 1 ] : % I [ 2 ] : : t p : t % O [ 2 ] : 1 + E % I [ 3 ] : : G e t [ ] % I [ 1 ] : : t p 2 % O [ 1 ] : 1 + E % I [ 2 ] : : t q : N [ t p ] % O [ 2 ] : % I [ 3 ] : : % % % O [ 3 ] : % I [ 4 ] : : % O 2 % O [ 4 ] : { [ 3 ] : , [ 2 ] : , [ 1 ] : 1 + E, [ 0 ] : I n i t }

97 6.3 SMP REFERENCE MANUAL / Control structures 6.3 % I [ 5 ] : : % 2 % O [ 5 ] : E % I [ 6 ] : : R e t [ ] % I [ 4 ] : : % I % O [ 4 ] : { [ 3 ] : : <, [ 2 ] : : t p : t + 2, [ 1 ] : : N [ t ], [ 0 ] : : I n i t } % I [ 5 ] : : t q - 1 % O [ 5 ] : % I [ 6 ] : : R e t [ ] # I [ 3 ] : : % ˆ 2 2 # O [ 3 ] : # I [ 4 ] : : t p ˆ # O [ 4 ] : ( 1 + E ) # I [ 1 ] : : P r [ 1 ] ; P r [ 2 ] ; P r [ 7 ] # O [ 1 ] : 7 # I [ 2 ] : : P r [ 1 ] ; P r [ 2 ] ; 1 2 # I [ 3 ] : : f [ $ x ] : : ( $ x - 1 ; % % - % % ˆ 2 ) 2 # O [ 3 ] : $ x - 1 ; % % - % % # I [ 4 ] : : { f [ x ], f [ 2 ] } 2 # O [ 4 ] : { x - ( x ), 0 } # I [ 5 ] : : G e t [ ] % I [ 1 ] : : y - 1 % O [ 1 ] : y % I [ 2 ] : : % % ˆ % O [ 2 ] : ( y ) % I [ 3 ] : : R e t [ 1 4 ] % O [ 3 ] : 1 4 # O [ 5 ] : 1 4 L c l [ s 1, s 2,...] declares the symbols s 1,s2, to be "local variables" in the current Proc (and any nested within it); the

98 6.3 SMP REFERENCE MANUAL / Control structures 6.3 original values and properties of the s i are removed, to be restored upon exit from the P r o c. Local variables are conventionally given names beginning with the character % [2.2]. L c l may be used in interactive procedures. # I [ 1 ] : : L c l [ a ] ; a : 5 ; P r [ a ] ; a 5 # O [ 1 ] : 5 # I [ 2 ] : : a # O [ 2 ] : a # I [ 3 ] : : b : 1 # O [ 3 ] : 1 # I [ 4 ] : : G e t [ ] % I [ 1 ] : : c : 2 % O [ 1 ] : 2 % I [ 2 ] : : { b, c } % O [ 2 ] : { 1, 2 } % I [ 3 ] : : L c l [ b, c ] % O [ 3 ] : L c l [ b, c ] % I [ 4 ] : : { b, c } % O [ 4 ] : { b, c } % I [ 5 ] : : b : c : 5 % O [ 5 ] : 5 % I [ 6 ] : : { b, c } % O [ 6 ] : { 5, 5 } % I [ 7 ] : : R e t [ b ] % O [ 7 ] : 5 # O [ 4 ] : 5 # I [ 5 ] : : { b, c } # O [ 5 ] : { 1, 2 } # I [ 6 ] : : L c l [ % x ] ; % y : % x : 3 ; ( L c l [ % x ] ; % x : 7 ; P r [ % x, % y ] ) ; P r [ % x, % y ] ; % x # O [ 6 ] : 3 L b l [ e x p r ] represents a "label" within a Proc ; its "identifier" expr is resimplified when a Jmp might transfer control to its position. J m p [ e x p r ] causes "control" to be "transferred" to the nearest label which matches L b l [ e x p r ]. The current P r o c and

99 6.3 SMP REFERENCE MANUAL / Control structures 6.3 then any successive enclosing Proc are scanned to find a suitable Lbl. After Jmp has acted, the remaining segments of the Proc containing the Lbl are (re)simplified. For positive integer n, Jmp[n] transfers control to the n th segment in the current procedure. Jmp may be used in interactive procedures: if the specified L b l is not present, input lines are read without simplification until it is encountered. # I [ 1 ] : : P r [ 1 ] ; J m p [ o n ] ; P r [ 2 ] ; L b l [ o n ] ; P r [ 3 ] 1 3 # O [ 1 ] : 3 # I [ 2 ] : : P r [ 1 ] ; ( x ; J m p [ o n ] ) ; P r [ 2 ] ; L b l [ o n ] ; P r [ 3 ] 1 3 # O [ 2 ] : 3 # I [ 3 ] : : P r [ 1 ] ; J m p [ o n ] ; P r [ 2 ] 1 # O [ 3 ] : J m p [ o n ] # I [ 4 ] : : i : 0 ; L b l [ a ] ; P r [ i ] ; I n c [ i ] ; I f [ i < 3, J m p [ a ] ] # I [ 5 ] : : P r [ a ] ; J m p [ 4 ] ; P r [ y ] ; P r [ z ] ; P r [ w ] a z w # O [ 5 ] : w # I [ 6 ] : : i : x ; L b l [ i + x ] ; P r [ i ] ; I n c [ i ] ; J m p [ x + 1 ] ; J m p [ x + 2 ] x # O [ 6 ] : J m p [ x + 1 ] R e t [ e x p r, (n : 1 )] exits at most n nested control structures, yielding e x p r as the value of the outermost one. R e t is effective in P r o c, R p t, L o o p, F o r and D o. It may be used to exit interactive subsidiary procedures. R e t [ e x p r, I n f ] returns from any number of nested procedures to standard input mode. # I [ 1 ] : : a ; R e t [ b ] ; c # O [ 1 ] : b # I [ 2 ] : : f [ R e t [ a ], b ] # O [ 2 ] : f [ a, b ] # I [ 3 ] : : a ; ( b ; R e t [ x ] ) ; c # O [ 3 ] : c # I [ 4 ] : : a ; ( b ; R e t [ x, 2 ] ) ; c # O [ 4 ] : x

100 6.3 SMP REFERENCE MANUAL / Control structures 6.3 # I [ 5 ] : : a ; ( b ; R e t [ x, I n f ] ) ; c # O [ 5 ] : x # I [ 6 ] : : D o [ i, 1 0, I f [ i > 3, R e t [ i ] ] ] # O [ 6 ] : 4 # I [ 7 ] : : D o [ i, 1 0, I f [ i > 3, R e t [ i ] ] ; P r [ i ] ] # O [ 7 ] : 1 0 # I [ 8 ] : : D o [ i, 1 0, I f [ i > 3, R e t [ i, 2 ] ] ; P r [ i ] ] # O [ 8 ] : 4

101 7. Structural operations 7.1 Projection and list generation 7.2 Template application 7.3 Part extraction and removal 7.4 Structure determination 7.5 Content determination 7.6 Character determination 7.7 List and projection manipulation 7.8 Distribution and expansion 7.9 Rational expression manipulation and simplification 7.10 Statistical expression generation and analysis

102 7.1 SMP REFERENCE MANUAL / Structural operations Projection and list generation x.. y or S e q [ x, y ] yields if possible a null projection [2.3] consisting of a sequence of expressions whose integer parameters form linear progressions between those in x and y. For two integers m and n (with n > m ), m.. n yields [ m, m + 1, m + 2,..., n - 1, n ]. Similarly, f [ m 1, m 2 ].. f [ n 1, n 2 ] yields [ f [ m 1, m 2 ], f [ m 1 + 1, m 2 + i ], f [ m 1 + 2, m i ],..., f [ n 1, n 2 ] ] if i = (n2 - m2 )/(n1 - m1 )is an integer. Only the values of integer parameters may differ between x and y,and all such differences must be integer multiples of the smallest. # I [ 1 ] : : # O [ 1 ] : [ 1, 2, 3, 4, 5 ] # I [ 2 ] : : { } # O [ 2 ] : { 1, 2, 3, 4, 5 } # I [ 3 ] : : f [ 1.. 5, 1 0, 2 x.. 6 x ] # O [ 3 ] : f [ 1, 2, 3, 4, 5, 1 0, 2 x, 3 x, 4 x, 5 x, 6 x ] # I [ 4 ] : : f [ 1 ].. f [ 5 ] # O [ 4 ] : [ f [ 1 ], f [ 2 ], f [ 3 ], f [ 4 ], f [ 5 ] ] # I [ 5 ] : : f [ 0, 0 ].. f [ 4, 8 ] # O [ 5 ] : [ f [ 0, 0 ], f [ 1, 2 ], f [ 2, 4 ], f [ 3, 6 ], f [ 4, 8 ] ] # I [ 6 ] : : f [ 0, 0 ].. f [ 4, 9 ] # O [ 6 ] : f [ 0, 0 ].. f [ 4, 9 ] # I [ 7 ] : : x ˆ 2.. x ˆ # O [ 7 ] : [ x, x, x ] # I [ 8 ] : : f [ g [ 1 0 ( x + y ), 0 ], ].. f [ g [ 6 0 ( x + y ), 5 ], ] # O [ 8 ] : [ f [ g [ 1 0 ( x + y ), 0 ], ], f [ g [ 2 0 ( x + y ), 1 ], ], f [ g [ 3 0 ( x + y ), 2 ], ], f [ g [ 4 0 ( x + y ), 3 ], ], f [ g [ 5 0 ( x + y ), 4 ], ], f [ g [ 6 0 ( x + y ), 5 ], ] ] A r [ s p e c, (te m p : E q ),(ic r i t : 1 ),(vc r i t : 1 )] generates a list whose entries have sets of indices with ranges specified by s p e c,and whose values are obtained by application of the template temp to these indices. Sequences of indices at each level in the list are defined by n 1, 2,..., n { s, e, (i :1)} s, s + i, s + 2 i,..., s + k * i where k is the largest integer such that s + k * i is not greater than e. { { x 1, x 2,...} } x 1, x 2,... and collected into a complete specification { s p e c 1, s p e c 2,...}. For a contiguous [2.4] list with one level, s p e c may be given as n. Entries with sets of indices on which application of the template i c r i t would yield 0 are omitted. Entries whose values would yield 0 on application of the template v c r i t are also omitted. Outer [9.6] D i m [7.4]

103 7.1 SMP REFERENCE MANUAL / Structural operations 7.1 # I [ 1 ] : : A r [ 5, f ] # O [ 1 ] : { f [ 1 ], f [ 2 ], f [ 3 ], f [ 4 ], f [ 5 ] } # I [ 2 ] : : A r [ { { 2, 1 2, 3 } }, f ] # O [ 2 ] : { [ 2 ] : f [ 2 ], [ 5 ] : f [ 5 ], [ 8 ] : f [ 8 ], [ 1 1 ] : f [ 1 1 ] } # I [ 3 ] : : A r [ { { x, x + 4 } }, f ] # O [ 3 ] : { [ x ] : f [ x ], [ 1 + x ] : f [ 1 + x ], [ 2 + x ] : f [ 2 + x ], [ 3 + x ] : f [ 3 + x ], [ 4 + x ] : f [ 4 + x ] } # I [ 4 ] : : A r [ { { { i 1, i 2, i 3 } } }, f ] # O [ 4 ] : { [ i 1 ] : f [ i 1 ], [ i 2 ] : f [ i 2 ], [ i 3 ] : f [ i 3 ] } # I [ 5 ] : : A r [ { 2, 2 }, f ] # O [ 5 ] : { { f [ 1, 1 ], f [ 1, 2 ] }, { f [ 2, 1 ], f [ 2, 2 ] } } # I [ 6 ] : : A r [ { 2, 2, 2 }, f ] # O [ 6 ] : { { { f [ 1, 1, 1 ], f [ 1, 1, 2 ] }, { f [ 1, 2, 1 ], f [ 1, 2, 2 ] } }, { { f [ 2, 1, 1 ], f [ 2, 1, 2 ] }, { f [ 2, 2, 1 ], f [ 2, 2, 2 ] } } } # I [ 7 ] : : A r [ { 2, { 2, 5 } }, f ] # O [ 7 ] : { { [ 2 ] : f [ 1, 2 ], [ 3 ] : f [ 1, 3 ], [ 4 ] : f [ 1, 4 ], [ 5 ] : f [ 1, 5 ] }, { [ 2 ] : f [ 2, 2 ], [ 3 ] : f [ 2, 3 ], [ 4 ] : f [ 2, 4 ], [ 5 ] : f [ 2, 5 ] } } # I [ 8 ] : : A r [ 5 ] # O [ 8 ] : { 1, 2, 3, 4, 5 } # I [ 9 ] : : A r [ 5, F c t l ] # O [ 9 ] : { 1, 2, 6, 2 4, } # I [ 1 0 ] : : A r [ { 3, 3 } ] # O [ 1 0 ] : { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } # I [ 1 1 ] : : A r [ { 4, 2 }, ( $ x + 1 ) ˆ ( $ y - 1 ) ] # O [ 1 1 ] : { { 1, 2 }, { 1, 3 }, { 1, 4 }, { 1, 5 } } # I [ 1 2 ] : : A r [ 1 ] # O [ 1 2 ] : { f [ 1 ], f [ 2 ] } # I [ 1 3 ] : : A r [ { { 3, 5 } 1 ] # O [ 1 3 ] : { [ 3 ] : f [ 3 ], [ 4 ] : f [ 4 ], [ 5 ] : f [ 5 ] } # I [ 1 4 ] : : A r [ 1 0, f, E v e n p ] # O [ 1 4 ] : { [ 2 ] : f [ 2 ], [ 4 ] : f [ 4 ], [ 6 ] : f [ 6 ], [ 8 ] : f [ 8 ], [ 1 0 ] : f [ 1 0 ] } # I [ 1 5 ] : : A r [ { 3, 3 }, f, $ x > $ y - 1 ] # O [ 1 5 ] : { { f [ 1, 1 ] }, { f [ 2, 1 ], f [ 2, 2 ] }, { f [ 3, 1 ], f [ 3, 2 ], f [ 3, 3 ] } } # I [ 1 6 ] : : A r [ 1 0, $ x ˆ 2-3 $ x, E v e n p ] # O [ 1 6 ] : { [ 2 ] : - 2, [ 4 ] : 4, [ 6 ] : 1 8, [ 8 ] : 4 0, [ 1 0 ] : 7 0 }

104 7.1 SMP REFERENCE MANUAL / Structural operations 7.1 # I [ 1 7 ] : : A r [ 1 0, $ x ˆ 2-3 $ x, 1, E v e n p ] # O [ 1 7 ] : { - 2, - 2, 0, 4, 1 0, 1 8, 2 8, 4 0, 5 4, 7 0 } # I [ 1 8 ] : : u : 0 ; A r [ 1 0, ` I n c [ u ] ] # O [ 1 8 ] : { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 0 } R e p l [ e x p r, (n : 1 )] yields a null projection [2.3] containing n replications of e x p r. # I [ 1 ] : : R e p l [ f [ x ], 4 ] # O [ 1 ] : [ f [ x ], f [ x ], f [ x ], f [ x ] ] # I [ 2 ] : : { R e p l [ 0, 5 ] } # O [ 2 ] : { 0, 0, 0, 0, 0 } # I [ 3 ] : : A r [ 4, R e p l [ $ 1, $ 1 ] ] # O [ 3 ] : { 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 } L i s t [ e x p r 1, e x p r 2,...] yields the contiguous list { e x p r 1, e x p r 2,...}. # I [ 1 ] : : L i s t [ x, y, z ] # O [ 1 ] : { x, y, z } # I [ 2 ] : : A r [ 5, L i s t ] # O [ 2 ] : { { 1 }, { 2 }, { 3 }, { 4 }, { 5 } }

105 7.2 SMP REFERENCE MANUAL / Structural operations Template application A p [ t e m p, { e x p r 1, (e x p r 2,...)} ] applies the template t e m p to the e x p r i [2.7]. # I [ 1 ] : : A p [ f, { a, b, c } ] # O [ 1 ] : f [ a, b, c ] # I [ 2 ] : : A p [ $ z ˆ $ x - $ x, { a, b } ] a # O [ 2 ] : - a + b # I [ 3 ] : : A p [ { a, b, c, d }, { 2 } ] # O [ 3 ] : b # I [ 4 ] : : f : g # O [ 4 ] : g # I [ 5 ] : : A p [ f, { a, b } ] # O [ 5 ] : f [ a, b ] # I [ 6 ] : : A p [! f, { a, b } ] # O [ 6 ] : g [ a, b ] # I [ 7 ] : : A p [ A p, { f, { a, b } } ] # O [ 7 ] : g [ a, b ] A t [ temp, expr, (partspec : L [ expr ] )] yields the expression obtained from expr by applying (if possible) the template temp to parts specified by partspec. partspec may consist of a list giving the filters necessary to select a particular part of expr,or of a list of such lists, representing a sequence of parts. The template is applied in turn to each specified part; for overlapping part specifications it is applied first to the deepest parts. partspec is obtained by default by graphical part selection in e x p r using L [10.4]. # I [ 1 ] : : t : a x ˆ 2 + g [ y ˆ 2 b ˆ 2-3 h [ 7 p + q ˆ 2, q ˆ 3 ] ] # O [ 1 ] : g [ - 3 h [ 7 p + q, q ] + b y ] + a x # I [ 2 ] : : A t [ f, t, P o s [ x ˆ 2, t ] ] # O [ 2 ] : g [ - 3 h [ 7 p + q, q ] + b y ] + a f [ x ] # I [ 3 ] : : A t [ f, t, P o s [ $ x ˆ 2, t ] ] # O [ 3 ] : g [ - 3 h [ 7 p + f [ q ], q ] + f [ b ] f [ y ] ] + a f [ x ] # I [ 4 ] : : { r - > - A t a n [ ( a x ˆ 2 + b x ) / ( a x y + 3 a x + b y + 3 b ) ] / 2 w } 2 a x + b x - w A t a n [ ] 3 b + 3 a x + b y + a x y # O [ 4 ] : { r - > } 2

106 7.2 SMP REFERENCE MANUAL / Structural operations 7.2 # I [ 5 ] : : A t [ M a p [ F a c, $ 1 ], %, P o s [ A t a n [ $ x ], % ] ] x - w A t a n [ ] 3 + y # O [ 5 ] : { r - > } 2 M a p [ t e m p, e x p r, (le v s p e c : 1 ),(do m c r i t : 1 ),(lt e m p : N u l l ),(ma x : I n f )] yields the expression obtained by recursively applying the template temp at most max times to the parts of expr in the domain specified by levspec and domcrit [2.5]. Any non-null result obtained by applying the template ltemp to the (positive or neg ative) integer specifying the level in expr reached is used as a second expression on which to apply t e m p. (With l e v : 0 M a p is equivalent to A p with a single e x p r i.) # I [ 1 ] : : t : { { a, b }, { x ˆ 2, y ˆ 2 }, z } 2 2 # O [ 1 ] : { { a, b }, { x, y }, z } # I [ 2 ] : : M a p [ f, t ] 2 2 # O [ 2 ] : { f [ { a, b } ], f [ { x, y } ], f [ z ] } # I [ 3 ] : : M a p [ f, t, 2 ] 2 2 # O [ 3 ] : { f [ { f [ a ], f [ b ] } ], f [ { f [ x ], f [ y ] } ], f [ z ] } # I [ 4 ] : : M a p [ f, t, 2,, $ x ] 2 2 # O [ 4 ] : { f [ { f [ a, 2 ], f [ b, 2 ] }, 1 ], f [ { f [ x, 2 ], f [ y, 2 ] }, 1 ], f [ z, 1 ] } # I [ 5 ] : : M a p [ f, t, I n f,, $ x ] f [ 2, 3 ] f [ 2, 3 ] # O [ 5 ] : { f [ { f [ a, 2 ], f [ b, 2 ] }, 1 ], f [ { f [ f [ x, 3 ], 2 ], f [ f [ y, 3 ], 2 ] }, 1 ], f [ z, 1 ] } # I [ 6 ] : : M a p [ f, t, - 1 ] f [ 2 ] f [ 2 ] # O [ 6 ] : { { f [ a ], f [ b ] }, { f [ x ], f [ y ] }, f [ z ] } # I [ 7 ] : : M a p [ f, t, - I n f,, $ x ] # O [ 7 ] : { f [ { f [ a, - 1 ], f [ b, - 1 ] }, - 2 ], # I [ 8 ] : : u : A r [ 1 0 ] # O [ 8 ] : { 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 0 } # I [ 9 ] : : M a p [ f, u, 1, E v e n p ] f [ 2, - 1 ] f [ 2, - 1 ] f [ { f [ f [ x, - 1 ], - 2 ], f [ f [ y, - 1 ], - 2 ] }, - 3 ], f [ z, - 1 ] } # O [ 9 ] : { 1, f [ 2 ], 3, f [ 4 ], 5, f [ 6 ], 7, f [ 8 ], 9, f [ 1 0 ] } # I [ 1 0 ] : : v : a ˆ ( b + c a ˆ 2 ) + 2 g [ a - b, c ˆ 2 + d ˆ 2 ] b + a c # O [ 1 0 ] : 2 g [ a - b, c + d ] + a

107 7.2 SMP REFERENCE MANUAL / Structural operations 7.2 # I [ 1 1 ] : : M a p [ f, v, - 1 ] f [ 2 ] f [ 2 ] f [ 2 ] f [ b ] + f [ a ] f [ c ] # O [ 1 1 ] : 2 g [ f [ a ] + f [ - b ], f [ c ] + f [ d ] ] + f [ a ] # I [ 1 2 ] : : M a p [ f, v, - 1, N u m b p [ $ x ] ] f [ b ] + f [ a ] f [ c ] # O [ 1 2 ] : 2 g [ f [ a ] + f [ - b ], f [ c ] + f [ d ] ] + f [ a ] # I [ 1 3 ] : : M a p [ f, v, - I n f, I n [ a, $ x ] ] f [ 2 ] f [ 2 ] f [ 2 ] f [ b ] + a f [ c ] # O [ 1 3 ] : 2 g [ a + f [ - b ], f [ f [ f [ c ] ] + f [ f [ d ] ] ] ] + a # I [ 1 4 ] : : M a p [ f, v, I n f, $ y & I n [ a, $ x ], $ 1 > 2 ] f [ 2, 1 ] f [ 2, 1 ] # O [ 1 4 ] : 2 g [ a + f [ - b, 1 ], f [ f [ f [ c, 1 ], 1 ] + f [ f [ d, 1 ], 1 ], 0 ] ] f [ 2, 1 ] f [ b, 1 ] + a f [ c, 1 ] + a

108 7.3 SMP REFERENCE MANUAL / Structural operations Part extraction and removal e x p r [fi l t 1,fi l t 2,...] or P r o j [e x p r, {fi l t 1,fi l t 2,...} ] extracts the part of e x p r specified by successive projections with the filters fi l t 1, fi l t 2,... [2.3]. P o s [ f o r m 1, e x p r, (te m p : L i s t ),(le v : I n f ),(ma x : I n f )] gives a list of the results obtained by applying the template temp to sets of filters specifying the positions of (at most m a x )occurrences of parts in e x p r (at or below level l e v [2.5]) matching any ofthe f o r m i. I n [7.5] # I [ 1 ] : : t : 3 f [ a ˆ 2 + ( ( a + b ) / x ) ] / f [ z ˆ 3 + f [ x ˆ x ] ] a + b 2 3 f [ a ] x # O [ 1 ] : f [ f [ x + x ] + z ] # I [ 2 ] : : P o s [ a ˆ 2, t ] # O [ 2 ] : { { 1, 1, 2 } } # I [ 3 ] : : P o s [ $ x ˆ 2, t ] # O [ 3 ] : { { 1, 1, 2 }, { 2, 1, 1, 1, 3 } } # I [ 4 ] : : P o s [ $ x ˆ 2, t, { t [ $ $ x ], { $ $ x } } ] 2 2 # O [ 4 ] : { { a, { 1, 1, 2 } }, { x, { 2, 1, 1, 1, 3 } } } # I [ 5 ] : : P o s [ f, t ] # O [ 5 ] : { { 1, 0 }, { 2, 0 }, { 2, 1, 1, 0 } } # I [ 6 ] : : P o s [ f [ $ x ], t ] # O [ 6 ] : { { 1 }, { 2 }, { 2, 1, 1 } } # I [ 7 ] : : P o s [ f [ $ x ], t,, - 3 ] # O [ 7 ] : { { 2, 1, 1 } } # I [ 8 ] : : P o s [ D i v, t ] # O [ 8 ] : { { 0 }, { 1, 1, 1, 0 } } # I [ 9 ] : : P o s [ M u l t, t ] # O [ 9 ] : { } # I [ 1 0 ] : : P o s [ { a, b }, t ] # O [ 1 0 ] : { { 1, 1, 2, 1 }, { 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 2 } } # I [ 1 1 ] : : P o s [ a, t, 3 ] # O [ 1 1 ] : { 3, 3 } # I [ 1 2 ] : : P o s [ a, t,, I n f, I n f ] # O [ 1 2 ] : { { 1, 1, 2, 1 }, { 1, 1, 1, 1, 1 } } # I [ 1 3 ] : : P o s [ a, t,, I n f, 1 ] # O [ 1 3 ] : { { 1, 1, 2, 1 } }

109 7.3 SMP REFERENCE MANUAL / Structural operations 7.3 E l e m [ e x p r, { n 1, n 2,...} ] extracts successively the n i th values in the list e x p r,irrespective of their indices. # I [ 1 ] : : t : { [ x ] : a, [ y ] : b, [ 1 ] : c } # O [ 1 ] : { [ x ] : a, [ y ] : b, [ 1 ] : c } # I [ 2 ] : : E l e m [ t, { 1 } ] # O [ 2 ] : a # I [ 3 ] : : t [ 1 ] # O [ 3 ] : c L a s t [ l i s t ] yields the value of the last entry in l i s t. # I [ 1 ] : : t : { [ x ] : a, [ y ] : b } # O [ 1 ] : { [ x ] : a, [ y ] : b } # I [ 2 ] : : L a s t [ t ] # O [ 2 ] : b # I [ 3 ] : : L a s t [ a ] # O [ 3 ] : L a s t [ a ] I n d [ l i s t, n ] yields the index ofthe n th entry in l i s t. # I [ 1 ] : : I n d [ { [ x ] : a, [ y ] : b }, 1 ] # O [ 1 ] : x # I [ 2 ] : : I n d [ { x, y, z }, 2 ] # O [ 2 ] : 2 D i s [ e x p r, (le v : 1 )] yields a list in which all projections in expr (below level lev ) are "disassembled" into lists with the same parts. # I [ 1 ] : : t : f [ g [ a, b ], c ˆ 2, d ] 2 # O [ 1 ] : f [ g [ a, b ], c, d ] # I [ 2 ] : : D i s [ t ] 2 # O [ 2 ] : { [ 0 ] : f, [ 1 ] : g [ a, b ], [ 2 ] : c, [ 3 ] : d } # I [ 3 ] : : D i s [ t, I n f ] # O [ 3 ] : { [ 0 ] : f, [ 1 ] : { [ 0 ] : g, [ 1 ] : a, [ 2 ] : b }, [ 2 ] : { [ 0 ] : P o w, [ 1 ] : c, [ 2 ] : 2 }, [ 3 ] : d }

110 7.3 SMP REFERENCE MANUAL / Structural operations 7.3 # I [ 4 ] : : D i s [ 5 a / 6 ] # O [ 4 ] : { [ - 1 ] : 5 / 6, [ 0 ] : a } A s [ e x p r, (le v : 1 )] yields an expression in which any suitable lists (at or below level lev ) in expr are "assembled" into projections with the same parts. # I [ 1 ] : : D i s [ f [ x, y, z ˆ 2 ] ] 2 # O [ 1 ] : { [ 0 ] : f, [ 1 ] : x, [ 2 ] : y, [ 3 ] : z } # I [ 2 ] : : A s [ % ] 2 # O [ 2 ] : f [ x, y, z ] D e l [ f o r m, e x p r, (le v : I n f ),(n : I n f )] yields an expression in which (at most n )parts matching form (and appearing at or below level lev )in expr have been deleted. S e t [3.2] # I [ 1 ] : : D e l [ a, { a, b, a, c } ] # O [ 1 ] : { b, c } # I [ 2 ] : : t : ( a + b ˆ 2 + c * a ) ˆ ( a + b * c ) 2 a + b c # O [ 2 ] : ( a + a c + b ) # I [ 3 ] : : D e l [ a, t ] 2 b c # O [ 3 ] : ( c + b ) # I [ 4 ] : : D e l [ $ x _ = I n t p [ $ x ], { 3, 2. 5, 7 } ] # I [ 5 ] : : M a p [ D e l [ $ x _ = I n t p [ $ x ], $ 1 ], { 3, 2. 5, 7 } ] # O [ 5 ] : { 3,, 7 }

111 7.4 SMP REFERENCE MANUAL / Structural operations Structure determination T r e e [ e x p r, (nl e v : 1 )] yields a list of successive replacements specifying the construction of e x p r from its level - n l e v parts. D i s [7.3] # I [ 1 ] : : t : a ˆ ( b + c ) + d b + c # O [ 1 ] : d + a # I [ 2 ] : : T r e e [ % ] # 3 # O [ 2 ] : { # 1 - > d + # 2, # 2 - > a, # 3 - > b + c } L e n [ e x p r ] the number of filters or entries in a projection or list e x p r,and 0 for a symbol e x p r.(the "length" of e x p r ). # I [ 1 ] : : t : a ˆ 2 + b ˆ 2 + c + d 2 2 # O [ 1 ] : c + d + a + b # I [ 2 ] : : L e n [ t ] # O [ 2 ] : 4 # I [ 3 ] : : L e n [ { a, b } ] # O [ 3 ] : 2 D e p [ e x p r ] the maximum number of filters necessary to specify any part of expr. (The "depth" of expr [2.5]). Yields I n f for a "static recursive" expression [3.1]. # I [ 1 ] : : D e p [ a ] # O [ 1 ] : 1 # I [ 2 ] : : D e p [ a ˆ 2 ] # O [ 2 ] : 2 # I [ 3 ] : : D e p [ a ˆ 2 + b ˆ 2 ] # O [ 3 ] : 3 # I [ 4 ] : : D e p [ a ˆ 2 + b ˆ 2 + c ˆ 2 ] # O [ 4 ] : 3 # I [ 5 ] : : D e p [ f [ f [ f [ a ] ] ] + f [ a ] ] # O [ 5 ] : 5 D i m [ l i s t, (ll e v : I n f )] gives the ranges of contiguous indices at or below level l l e v in l i s t (in the form used by A r [7.1]).

112 7.4 SMP REFERENCE MANUAL / Structural operations 7.4 # I [ 1 ] : : { { a }, { b } } # O [ 1 ] : { { a }, { b } } # I [ 2 ] : : D i m [ % ] # O [ 2 ] : { 2, 1 } # I [ 3 ] : : A r [ { 2, 3, 1 } ] # O [ 3 ] : { { { 1 }, { 0 }, { 0 } }, { { 0 }, { 0 }, { 0 } } } # I [ 4 ] : : D i m [ % ] # O [ 4 ] : { 2, 3, 1 } # I [ 5 ] : : D i m [ % ] # O [ 5 ] : { 3 } H a s h [ e x p r, (n : 2 ˆ 1 5 )] a positive integer less than n which provides an almost unique "hash code" for expr. Tw o expressions with different hash codes cannot be identical. # I [ 1 ] : : H a s h [ a ] # O [ 1 ] : # I [ 2 ] : : H a s h [ a ˆ 2 + b ˆ 2 / c ] # O [ 2 ] :

113 7.5 SMP REFERENCE MANUAL / Structural operations Content determination I n [ f o r m 1, e x p r, (le v : I n f )] yields 1 if a part matching any ofthe f o r m i occurs in e x p r at or below level l e v,and 0 otherwise. # I [ 1 ] : : t : x + a * x * y ˆ 2 + x ˆ # O [ 1 ] : x + a x y + x # I [ 2 ] : : I n [ y ˆ 2, t ] # O [ 2 ] : 1 # I [ 3 ] : : I n [ { z, x ˆ 2 }, t ] # O [ 3 ] : 1 # I [ 4 ] : : I n [ x ˆ $ i _ = E v e n p [ $ i ], t ] # O [ 4 ] : 1 # I [ 5 ] : : I n [ z, t ] # O [ 5 ] : 0 # I [ 6 ] : : I n [ y ˆ 2, t, 1 ] # O [ 6 ] : 0 C o n t [ (e x p r :(all symbols)),(cr i t : 1 )] yields a held ordered list of the symbols in e x p r on which application of the template c r i t does not yield 0 (default is to omit symbols appearing as projectors). # I [ 1 ] : : t : a + b ˆ c c # O [ 1 ] : a + b # I [ 2 ] : : C o n t [ t ] # O [ 2 ] : { a, b, c } # I [ 3 ] : : C o n t [ t, 1 ] # O [ 3 ] : { a, b, c, P l u s, P o w } # I [ 4 ] : : a _ : b _ : d _ : s p e c # O [ 4 ] : s p e c # I [ 5 ] : : _ a # O [ 5 ] : { [ s p e c ] : 1 } # I [ 6 ] : : C o n t [ t, _ $ x [ s p e c ] ] # O [ 6 ] : { a, b } # I [ 7 ] : : C o n t [, _ $ x [ s p e c ] ] # O [ 7 ] : { a, b, d }

114 7.6 SMP REFERENCE MANUAL / Structural operations Character determination The following projections yield 1 if expr is determined to be of the specified character, and 0 otherwise. The determination includes use of any assignments made for the testing projection; Intp[ x ] : 1 thus defines x to be an integer. S y m b p [ e x p r ] N u m b p [ e x p r ] R e a l p [ e x p r ] I m a g p [ e x p r ] I n t p [ e x p r ] N a t p [ e x p r ] E v e n p [ e x p r ] O d d p [ e x p r ] Single symbol. Real or complex number. Real number. Purely imaginary number. Integer. Natural number (positive integer). Even integer. Odd integer. R a t p [ expr, (maxden : 1 * ˆ 5 ),(acc : 1 * ˆ )] Rational number (to within accuracy a c c )with denominator not greater than m a x d e n. P r o j p [ e x p r ] L i s t p [ e x p r ] Projection. List. C o n t p [ expr, (lev : I n f )] List or list of lists contiguous [2.4] to at least level l e v. F u l l p [ expr, (lev : I n f )] "Full" list whose indices (and those of its sublists at or below level lev ) are "contiguous" and have ranges independent of the values of any other indices (so that the list is "rectangular"). V a l p [ e x p r ] Value other than N u l l. H e l d p [ e x p r ] "Held" expression [3.5]. P o l y p [ e x p r, ( f o r m 1 )] Polynomial in "bases" matching f o r m i [9.1]. # I [ 1 ] : : { I n t p [ 3 ], I n t p [ 3 / 2 ], I n t p [ x ] } # O [ 1 ] : { 1, 0, 0 } # I [ 2 ] : : I n t p [ x ] : 1 # O [ 2 ] : 1 # I [ 3 ] : : { I n t p [ x ], I n t p [ x ˆ 2 ], I n t p [ y ] } # O [ 3 ] : { 1, 0, 0 } # I [ 4 ] : : I n t p [ $ x _ = _ $ x [ i n t ] ] : 1 # O [ 4 ] : 1 # I [ 5 ] : : I n t p [ $ x ˆ 2 ] : : I n t p [ $ x ] # O [ 5 ] : I n t p [ $ x ] # I [ 6 ] : : y _ : i n t # O [ 6 ] : i n t

115 7.6 SMP REFERENCE MANUAL / Structural operations 7.6 # I [ 7 ] : : { I n t p [ x ˆ 2 ], I n t p [ y ], I n t p [ y ˆ 2 ], I n t p [ z ˆ 2 ] } # O [ 7 ] : { 1, 1, 1, 0 } # I [ 8 ] : : { R a t p [ ], R a t p [ N [ P i ] ], R a t p [ 2 / 3, 4 ], R a t p [ 2 / 3, 2 ] } # O [ 8 ] : { 1, 0, 1, 0 } # I [ 9 ] : : { C o n t p [ { a, b, c } ], C o n t p [ { [ x ] : a, [ y ] : b } ] } # O [ 9 ] : { 1, 0 } # I [ 1 0 ] : : t : { { a, b }, { c } } # O [ 1 0 ] : { { a, b }, { c } } # I [ 1 1 ] : : u : { { a, b }, { [ x ] : c } } # O [ 1 1 ] : { { a, b }, { [ x ] : c } } # I [ 1 2 ] : : { C o n t p [ u ], C o n t p [ u, 1 ], C o n t p [ u, 2 ], C o n t p [ t ] } # O [ 1 2 ] : { 0, 1, 0, 1 } # I [ 1 3 ] : : v : { { a, b }, { c, d } } # O [ 1 3 ] : { { a, b }, { c, d } } # I [ 1 4 ] : : { F u l l p [ t ], F u l l p [ t, 1 ], F u l l p [ t, 2 ], F u l l p [ v ] } # O [ 1 4 ] : { 0, 1, 1, 1 } # I [ 1 5 ] : : f [ x ] : x v # O [ 1 5 ] : x v # I [ 1 6 ] : : { V a l p [ f ], V a l p [ f [ x ] ], V a l p [ f [ y ] ], V a l p [ 1 ] } # O [ 1 6 ] : { 1, 1, 0, 0 } # I [ 1 7 ] : : { H e l d p [ f ], H e l d p [ # I [ 1 5 ] [ 0 ] ], H e l d p [ f ] } # O [ 1 7 ] : { 1, 1, 0 } # I [ 1 8 ] : : { P o l y p [ x ˆ 2 - x + 1 ], P o l y p [ x + E x p [ x ] ] } # O [ 1 8 ] : { 1, 0 }

116 7.7 SMP REFERENCE MANUAL / Structural operations List and projection manipulation C a t [ l i s t 1, l i s t 2,...] < F l a t > yields a contiguous list [2.4] obtained by concatenating the entries in l i s t 1, l i s t 2,.... C a t [ l i s t ] renders the indices of entries in l i s t contiguous, without affecting their values. # I [ 1 ] : : t 1 : { a, b, c } # O [ 1 ] : { a, b, c } # I [ 2 ] : : t 2 : { d, { e, f } } # O [ 2 ] : { d, { e, f } } # I [ 3 ] : : C a t [ t 1, t 2, t 1, t 1 ] # O [ 3 ] : { a, b, c, d, { e, f }, a, b, c, a, b, c } # I [ 4 ] : : C a t [ { [ x ] : 1, [ y ] : 2 }, t 1 ] # O [ 4 ] : { 1, 2, a, b, c } # I [ 5 ] : : C a t [ { [ a ] : x, [ b ] : y, [ c ] : z } ] # O [ 5 ] : { x, y, z } S o r t [ l i s t, (ca r d : N u l l ),(or d : O r d )] yields a list v obtained by sorting the top-level entries in l i s t so that either the expressions A p [ c a r d, { E l e m [ v, { i } ] } ] are in canonical order (for increasing i ), or A p [ o r d, { E l e m [ v, { i } ], E l e m [ v, { j } ] } ] is non-negative for i < j and is non-positive for i > j. # I [ 1 ] : : t : { 2, 1, 3, 4, 1 } # O [ 1 ] : { 2, 1, 3, 4, 1 } # I [ 2 ] : : S o r t [ t ] # O [ 2 ] : { 1, 1, 2, 3, 4 } # I [ 3 ] : : S o r t [ t, E v e n p ] # O [ 3 ] : { 1, 1, 3, 2, 4 } # I [ 4 ] : : S o r t [ t,, - O r d [ $ x, $ y ] ] # O [ 4 ] : { 4, 3, 2, 1, 1 } # I [ 5 ] : : S o r t [ { b, c, a } ] # O [ 5 ] : { a, b, c } # I [ 6 ] : : S o r t [ { [ b ] : 3, [ c ] : 1, [ a ] : 2 } ] # O [ 6 ] : { [ c ] : 1, [ a ] : 2, [ b ] : 3 } C y c [ e x p r, (n : 1 )] gives alist or projection obtained by cycling entries or filters in e x p r to the left by n positions with respect to their first index. R e v [ e x p r ] yields a list or projection obtained from e x p r by reversing the order of entries or filters with respect to their first index.

117 7.7 SMP REFERENCE MANUAL / Structural operations 7.7 # I [ 1 ] : : t : { a, b, c, d } # O [ 1 ] : { a, b, c, d } # I [ 2 ] : : C y c [ t ] # O [ 2 ] : { b, c, d, a } # I [ 3 ] : : C y c [ t, - 2 ] # O [ 3 ] : { c, d, a, b } # I [ 4 ] : : R e v [ t ] # O [ 4 ] : { d, c, b, a } # I [ 5 ] : : r : f [ x, y, z, w ] # O [ 5 ] : f [ x, y, z, w ] # I [ 6 ] : : C y c [ %, 1 5 ] # O [ 6 ] : f [ w, x, y, z ] # I [ 7 ] : : R e v [ % ] + C y c [ %, - 3 ] # O [ 7 ] : f [ x, y, z, w ] + f [ z, y, x, w ] # I [ 8 ] : : R e v [ { [ a ] : 1, [ b ] : 2 } ] # O [ 8 ] : { [ b ] : 2, [ a ] : 1 } R e o r [ e x p r, (f : e x p r [0]),(r eord : S y m )] places filters of projections from f in expr in canonical order using the reordering (permutation) symmetries specified by r eord. Symmetries are represented by the following codes (or lists of such codes applied in the order given): S y m A s y m C y c l i c Completely symmetric under interchange of all filters. Completely antisymmetric. Sig [9.6] Completely cyclic. S y m [ i 1, i 2,...] Symmetric with respect to interchanges of filters i1, i2,.... A s y m [ i 1, i 2,...] Antisymmetric with respect to interchanges of filters i1, i2,.... C y c l i c [ i 1, i 2,...] Symmetric under cyclic interchange of filters i1, i2,.... G r e o r [ { p e r m 1, (wt 1 : 1 )}, { p e r m 2, (wt 2 : 1 )},...] Projections are multiplied by the weights obtained by application of wti to them when their filters are permuted so that the jth becomes the permi[j]th. Projections from a symbol f are automatically reordered according to any permutation symmetries given (using the above codes) as the value of the property _f[reor] [4]. Comm [4] #I[1]:: #O[1]: #I[2]:: #O[2]: _ts[reor]:sym Sym {ts[a,b,c],ts[b,a,c],ts[c,a,b],ts[c,a,a]} {ts[a,b,c],ts[a,b,c],ts[a,b,c],ts[a,a,c]}

118 7.7 SMP REFERENCE MANUAL / Structural operations 7.7 #I[3]:: #O[3]: #I[4]:: #O[4]: #I[5]:: #O[5]: #I[6]:: #O[6]: #I[7]:: #O[7]: #I[8]:: #O[8]: #I[9]:: #O[9]: _ta[reor]:asym Asym {ta[a,b,c],ta[b,a,c],ta[c,a,b],ta[c,a,a]} {ta[a,b,c],-ta[a,b,c],ta[a,b,c],0} _tc[reor]:cyclic Cyclic {tc[a,b,c],tc[b,a,c],tc[c,a,b],tc[c,a,a]} {tc[a,b,c],tc[a,c,b],tc[a,b,c],tc[a,a,c]} _tg[reor]:greor[{{1,3,2},7},{{3,2,1},11},{2,1,3}] Greor[{{1,3,2},7},{{3,2,1},11},{2,1,3}] {tg[a,b,c],tg[a,c,b],tg[b,c,a],tg[d,c,b,a]} {tg[a,b,c],7tg[a,b,c],77tg[a,b,c],11tg[b,c,d,a]} _t[reor]:{cyclic[1,3,4],asym[2,5]} {Cyclic[1,3,4],Asym[2,5]} #I[10]:: {t[a,c,b,a,e],t[a,b,d,c,e],t[a,a,b,c,a], \ t[c,b,d,a,a],t[a,c,b,a,e,f,g]} #O[10]: #I[11]:: #O[11]: #I[12]:: #O[12]: {t[a,c,a,b,e],t[a,b,d,c,e],0,-t[a,a,c,d,b],t[a,c,a,b,e,f,g]} Reor[f[a,c,b],,Greor[{{1,3,2},wt}]] f[a,b,c] wt[f[a,b,c]] Reor[f[a,c,b],,Sym] f[a,b,c] L d i s t [ e x p r, (f : e x p r [0]),(le v s p e c : I n f ),(do m c r i t : 1 ),(ma x : 1 )] "distributes" projections from f in the domain of expr specified by levspec and domcrit over lists appearing as their filters, making at most m a x passes through e x p r. f [ { [ i 1 ] : v 1 1, [ i 2 ] : v 1 2,.. }, { [ i 1 ] : v 2 1, [ i 2 ] : v 2 2,.. }, a,.. ] becomes { [ i 1 ] : f [ v 1 1, v 2 1, a,.. ], [ i 2 ] : f [ v 1 2, v 2 2, a,.. ],.. } where a is not a list. Projections from symbols carrying the property Ldist [4] are automatically distributed over lists appearing as their filters. # I [ 1 ] : : t : f [ { a, b }, e, { c, d } ] # O [ 1 ] : f [ { a, b }, e, { c, d } ] # I [ 2 ] : : L d i s t [ t ] # O [ 2 ] : { f [ a, e, c ], f [ b, e, d ] } # I [ 3 ] : : u : f [ { a, b }, { c, d }, f [ { i, j }, { k, l } ] ] # O [ 3 ] : f [ { a, b }, { c, d }, f [ { i, j }, { k, l } ] ] # I [ 4 ] : : L d i s t [ u ] # O [ 4 ] : { f [ a, c, f [ i, k ] ], f [ b, d, f [ j, l ] ] }

119 7.7 SMP REFERENCE MANUAL / Structural operations 7.7 # I [ 5 ] : : L d i s t [ u, f, 1 ] # O [ 5 ] : { f [ a, c, f [ { i, j }, { k, l } ] ], f [ b, d, f [ { i, j }, { k, l } ] ] } # I [ 6 ] : : { x, y, z } = { 1, 2, 3 } # O [ 6 ] : { x, y, z } = { 1, 2, 3 } # I [ 7 ] : : L d i s t [ % ] # O [ 7 ] : { x = 1, y = 2, z = 3 } F l a t [expr, (levspec : I n f ),(f :expr [0] or L i s t ),(domcrit : 1 )] "flattens" nested projections from f or lists in expr in the domain specified by levspec and domcrit [2.5]. f projections appearing as filters within f projections are replaced by null projections [2.3]. Sublists in lists are "unraveled". Indices in flattened lists are contiguous [2.4]. Projections from symbols carrying the property F l a t [4] are automatically "flattened". # I [ 1 ] : : t : f [ f [ a, b ], f [ c ], f [ f [ d ] ], e ] # O [ 1 ] : f [ f [ a, b ], f [ c ], f [ f [ d ] ], e ] # I [ 2 ] : : F l a t [ t ] # O [ 2 ] : f [ a, b, c, d, e ] # I [ 3 ] : : F l a t [ t, 2 ] # O [ 3 ] : f [ a, b, c, d, e ] # I [ 4 ] : : u : { { a, b }, { c, { d } }, e } # O [ 4 ] : { { a, b }, { c, { d } }, e } # I [ 5 ] : : F l a t [ u ] # O [ 5 ] : { a, b, c, d, e } # I [ 6 ] : : v : { [ x ] : a, [ y ] : b, [ z ] : c } # O [ 6 ] : { [ x ] : a, [ y ] : b, [ z ] : c } # I [ 7 ] : : F l a t [ v ] # O [ 7 ] : { a, b, c } T i e r [ l i s t ] generates a single level list in which the complete sequence of indices specifying each expression in l i s t appear in null projections. Assignments for projections from symbols carrying the property Tier automatically generate lists with a single level inwhich the filters of the projections appear in indices as null projections [2.3]. # I [ 1 ] : : f [ x, y ] : g [ x / y ] x # O [ 1 ] : g [ - ] y # I [ 2 ] : : f x # O [ 2 ] : { [ x ] : { [ y ] : g [ - ] } } y

120 7.7 SMP REFERENCE MANUAL / Structural operations 7.7 # I [ 3 ] : : f : T i e r [ f ] x # O [ 3 ] : { [ [ x, y ] ] : g [ - ] } y # I [ 4 ] : : f x # O [ 4 ] : { [ [ x, y ] ] : g [ - ] } y U n i o n [ l i s t 1, l i s t 2,...] < C o m m, F l a t > yields a sorted contiguous [2.4] list of all entries appearing in l i s t 1, l i s t 2,.... # I [ 1 ] : : t : { a, b, a, a, d, c } # O [ 1 ] : { a, b, a, a, d, c } # I [ 2 ] : : U n i o n [ t ] # O [ 2 ] : { a, b, c, d } # I [ 3 ] : : u : { a, b, f, e } # O [ 3 ] : { a, b, f, e } # I [ 4 ] : : U n i o n [ u, t, u ] # O [ 4 ] : { a, b, c, d, e, f } I n t e r [ l i s t 1, l i s t 2,...] < C o m m, F l a t > yields a sorted contiguous [2.4] list of the entries common to l i s t 1, l i s t 2,.... # I [ 1 ] : : t : { a, b, a, a, c, d } # O [ 1 ] : { a, b, a, a, c, d } # I [ 2 ] : : u : { b, a, e, f } # O [ 2 ] : { b, a, e, f } # I [ 3 ] : : I n t e r [ t, u ] # O [ 3 ] : { a, b }

121 7.8 SMP REFERENCE MANUAL / Structural operations Distribution and expansion E x [ e x p r, (dl i s t ),(nd l i s t : { } ),(rp t : I n f ),(le v s p e c : I n f ),(do m c r i t : 1 )] "expands" expr in the domain specified by levcrit and domcrit [2.5] using distributive replacements for projections specified in dlist but not in ndlist,performing replacements on a particular level at most rpt times. The default replacements in dlist are standard mathematical results for M u l t, D i v, D o t, P o w, E x p, L o g, G and their extensions [4], together with any replacements defined by D i s t or P o w d i s t properties [4]. # I [ 1 ] : : t : ( a + x ) ˆ 2 ( b + x ( x + a ) + ( b + x ) ˆ 2 ) 2 2 # O [ 1 ] : ( a + x ) ( b + x ( a + x ) + ( b + x ) ) # I [ 2 ] : : E x [ t ] # O [ 2 ] : 5 a x + b x + 2 b x + a b + a b + 4 a x + a x + b x # I [ 3 ] : : E x [ t, P o w ] a b x + 4 a b x + 2 a b x + 2 a b x + 2 x # O [ 3 ] : ( 2 a x + a + x ) ( b + 2 b x + x ( a + x ) + b + x ) # I [ 4 ] : : E x [ t, M u l t ] # O [ 4 ] : b ( a + x ) + x ( a + x ) + ( a + x ) ( b + x ) + a x ( a + x ) # I [ 5 ] : : E x [ t,, P o w ] # O [ 5 ] : b ( a + x ) + x ( a + x ) + ( a + x ) ( b + x ) + a x ( a + x ) # I [ 6 ] : : E x [ t,,, 1 ] # O [ 6 ] : b ( a + x ) + x ( a + x ) + ( a + x ) ( b + x ) # I [ 7 ] : : E x [ t,,, 2 ] # O [ 7 ] : b ( 2 a x + a + x ) + x ( 3 a x + 3 a x + a + x ) # I [ 8 ] : : E x [ t,,,, 1 ] ( 2 a x + a + x ) ( 2 b x + b + x ) # O [ 8 ] : b ( a + x ) + x ( a + x ) + ( a + x ) ( b + x ) # I [ 9 ] : : E x [ t,,,, 2 ] # O [ 9 ] : 5 a x + b x + 2 b x + a b + a b + 4 a x + a x + b x a b x + 4 a b x + 2 a b x + 2 a b x + 2 x

122 7.8 SMP REFERENCE MANUAL / Structural operations 7.8 # I [ 1 0 ] : : E x [ t,,,, - 1 ] 2 2 # O [ 1 0 ] : ( a + x ) ( b + x ( a + x ) + ( b + x ) ) # I [ 1 1 ] : : E x [ t,,,, - 3 ] # O [ 1 1 ] : ( 2 a x + a + x ) ( b + a x + 2 b x + b + 2 x ) # I [ 1 2 ] : : E x [ t,,,,, I n [ b, $ x ] ] # O [ 1 2 ] : ( 2 a x + a + x ) ( b + a x + x + ( b + x ) ) # I [ 1 3 ] : : E x [ t,,,,, L e n [ $ x ] = 2 ] # O [ 1 3 ] : 5 a x + b x + 2 b x + a b + a b + 4 a x + a x + b x # I [ 1 4 ] : : E x [ 2 ( u + v ) ] # O [ 1 4 ] : 2 u + 2 v # I [ 1 5 ] : : E x [ a ( u + v ) ] # O [ 1 5 ] : a u + a v # I [ 1 6 ] : : E x [ ( u + v ) ˆ 3 ] a b x + 4 a b x + 2 a b x + 2 a b x + 2 x # O [ 1 6 ] : 3 u v + 3 u v + u + v # I [ 1 7 ] : : E x [ ( u + v ) / a ] u v # O [ 1 7 ] : a a # I [ 1 8 ] : : E x [ a. ( u + v ) ] # O [ 1 8 ] : a. u + a. v # I [ 1 9 ] : : E x [ E x p [ u v ] ] # O [ 1 9 ] : E x p [ u v ] # I [ 2 0 ] : : E x [ L o g [ u v ] ] # O [ 2 0 ] : L o g [ u ] + L o g [ v ] # I [ 2 1 ] : : E x [ L o g [ u / v ] ] # O [ 2 1 ] : L o g [ u ] - L o g [ v ] # I [ 2 2 ] : : E x [ L o g [ u ˆ v ] ] # O [ 2 2 ] : v L o g [ u ] # I [ 2 3 ] : : E x [ f [ a + b + c ] ] # O [ 2 3 ] : f [ a + b + c ] # I [ 2 4 ] : : _ f [ D i s t ] : : P l u s # O [ 2 4 ] : P l u s

123 7.8 SMP REFERENCE MANUAL / Structural operations 7.8 # I [ 2 5 ] : : E x [ f [ a + b + c ] ] # O [ 2 5 ] : f [ a ] + f [ b ] + f [ c ] # I [ 2 6 ] : : _ g [ P o w d i s t ] : : h # O [ 2 6 ] : h # I [ 2 7 ] : : E x [ g [ a + b, 3 ] ] # O [ 2 7 ] : h [ a + b, a + b, a + b ] D i s t [ e x p r, { f 1, g 1, ((h1 : g 1 ),(k1 : f 1 )),(ps p e c 1 : I n f )}, (rp t : I n f ),(le v s p e c : I n f ),(do m c r i t : 1 )] distributes occurrences of the projectors fi in expr (in the domain specified by levspec and domcrit [2.5]) over projections from gi appearing as their filters, yielding projections of hi and ki. Distributions on a particular level are performed at most rpt times. A distribution specified by {f,g,h,k,pspec } corresponds to the replacement f [ $ $ 1, g [ x 1, x 2,...], $ $ 2 ] - > h [ k [ $ $ 1, x 1, $ $ 2 ], k [ $ $ 1, x 2, $ $ 2 ],...]. The possible positions at which the g projection may appear in f are specified by p s p e c according to i 1 through i. { i } i only. { i, j } i through j. { i, j, p c r i t } i through j and such that application of the template p c r i t yields "true". # I [ 1 ] : : t : f [ g [ a, b ], c, g [ x, y, z ] ] # O [ 1 ] : f [ g [ a, b ], c, g [ x, y, z ] ] # I [ 2 ] : : D i s t [ t, { f, g } ] # O [ 2 ] : g [ g [ f [ a, c, x ], f [ b, c, x ] ], g [ f [ a, c, y ], f [ b, c, y ] ], g [ f [ a, c, z ], f [ b, c, z ] ] ] # I [ 3 ] : : D i s t [ t, { f, g, h, k, { 3 } } ] # O [ 3 ] : h [ k [ g [ a, b ], c, x ], k [ g [ a, b ], c, y ], k [ g [ a, b ], c, z ] ] # I [ 4 ] : : D i s t [ t, { f, g, h, k, { k, g } } ] # O [ 4 ] : h [ k [ a, c, g [ x, y, z ] ], k [ b, c, g [ x, y, z ] ] ] # I [ 5 ] : : D i s t [ t, { f, g, h, a = $ x } ] # O [ 5 ] : h [ g [ a, b ] = c = x, g [ a, b ] = c = y, g [ a, b ] = c = z ] # I [ 6 ] : : s : a + b ( c + d ) # O [ 6 ] : a + b ( c + d ) # I [ 7 ] : : D i s t [ s, { M u l t, P l u s } ] # O [ 7 ] : a + b c + b d P o w d i s t [expr, {fpow1,fmult1, (fplus1 : P l u s )}, (rpt : I n f ),(levspec : I n f ), (do m c r i t : 1 )] performs a "power expansion" on projections from fpowi appearing in expr (in the domain specified by lev - spec and domcrit ) over projections from fplus appearing as their first filters, and yielding projections from fmult. Expansions on a particular level are performed at most rpt times. A power expansion specified by { f p o w, f m u l t, f p l u s } corresponds to the replacement f p o w [ f p l u s [ $ $ 1 ], $ n _ = N a t p [ $ n ] ] - > f m u l t [ R e p l [ f p l u s [ $ $ 1 ], $ n ] followed by expansion of the result.

124 7.8 SMP REFERENCE MANUAL / Structural operations 7.8 # I [ 1 ] : : t : ( a + b ) ˆ 3 3 # O [ 1 ] : ( a + b ) # I [ 2 ] : : P o w d i s t [ t, { P o w, M u l t } ] # O [ 2 ] : 3 a b + 3 a b + a + b # I [ 3 ] : : P o w d i s t [ t, { P o w, D o t } ] # O [ 3 ] : a. a. a + a. a. b + a. b. a + a. b. b + b. a. a + b. a. b + b. b. a + b. b. b # I [ 4 ] : : P o w d i s t [ f [ g [ a, b ], 3 ], { f, h, g } ] # O [ 4 ] : g [ h [ h [ a, a ], a ], h [ h [ a, a ], b ], h [ h [ a, b ], a ], h [ h [ a, b ], b ], h [ h [ b, a ], a ], h [ h [ b, a ], b ], h [ h [ b, b ], a ], h [ h [ b, b ], b ] ] Ldist [4,7.7]

125 7.9 SMP REFERENCE MANUAL / Structural operations Rational expression manipulation and simplification N c [ e x p r ] gives the overall numerical coefficient of e x p r. [2.5] # I [ 1 ] : : { N c [ a / b ], N c [ 2 a / b ], N c [ 2 / ( 3 b ) ], N c [ 2 / 3 ] } # O [ 1 ] : { 1, 2, 2 / 3, 2 / 3 } C o e f [ term, expr, (temp : P l u s )] yields the result of applying t e m p to the set of coefficients of t e r m in e x p r. # I [ 1 ] : : t : E x [ ( 2 a + x + b * x ) ˆ 3 ] # O [ 1 ] : 6 a x + 3 b x a x + 3 b x + b x a b x + 6 a b x # I [ 2 ] : : C o e f [ x ˆ 2, t ] a b x + 8 a + x 2 # O [ 2 ] : 6 a a b + 6 a b # I [ 3 ] : : C o e f [ a * x ˆ 2, t ] 2 # O [ 3 ] : b + 6 b # I [ 4 ] : : C o e f [ a * b * x, t ] # O [ 4 ] : 0 # I [ 5 ] : : C o e f [ x, t, f ] 2 2 # O [ 5 ] : f [ 1 2 a, 1 2 a b ] E x p t [ form, expr, (temp : M a x )] yields the result of applying t e m p to the set of exponents for f o r m in e x p r. # I [ 1 ] : : t : E x [ ( x ˆ 3 + f [ y ] ˆ b + z / x ˆ 2 ) ˆ 2 ] b 2 2 z f [ y ] z 3 b 6 2 b # O [ 1 ] : x z + 2 x f [ y ] + x + f [ y ] 2 4 x x # I [ 2 ] : : E x p t [ x, t ] # O [ 2 ] : 6 # I [ 3 ] : : E x p t [ f [ y ], t ] # O [ 3 ] : M a x [ b, 2 b ] # I [ 4 ] : : E x p t [ x, t, h ] # O [ 4 ] : h [ - 2, - 4, 1, 3, 6 ]

126 7.9 SMP REFERENCE MANUAL / Structural operations 7.9 N u m [ e x p r ] numerator of e x p r. # I [ 1 ] : : { N u m [ 2 a / ( 3 b * c ) ], N u m [ 5 / 6 ] } # O [ 1 ] : { 2 a, 5 } # I [ 2 ] : : { N u m [ ], N u m [ N [ P i ] ] } # O [ 2 ] : { 3, } D e n [ e x p r ] denominator of e x p r. # I [ 1 ] : : { D e n [ 2 a / ( 3 * b * c ) ], D e n [ 5 / 6 ] } # O [ 1 ] : { 3 b c, 6 } # I [ 2 ] : : { D e n [ ], D e n [ N [ P i ] ] } # O [ 2 ] : { 4, 1 } R a t [ e x p r, (cr i t : 1 ),(le v s p e c : I n f ),(rp t : I n f ),(do m c r i t : 1 )] combines over a common denominator terms in the domain of expr specified by levspec and domcrit [2.5], and on which application of the template c r i t does not yield 0,repeating the process until the result no longer changes, or at most r p t times. # I [ 1 ] : : t : 1 / a + 1 / b + 1 / ( a b ) # O [ 1 ] : a b a b # I [ 2 ] : : R a t [ t ] 1 + a + b # O [ 2 ] : a b C o l [ e x p r, (cr i t : 1 ),(le v s p e c : I n f ),(do m c r i t : 1 )] collects terms with the same denominator in the domain of expr specified by levspec and domcrit, but on which application of the template c r i t does not yield 0. # I [ 1 ] : : t : ( x + a ) ( x + b ) ( x + c ) / ( a * b ) + ( y + a ) ( y + b ) / b ( a + y ) ( b + y ) ( a + x ) ( b + x ) ( c + x ) # O [ 1 ] : b a b # I [ 2 ] : : u : E x [ t ] a y c x c x c x x x x y # O [ 2 ] : a + c + x + y b a b a b a b a b b # I [ 3 ] : : C o l [ u ] c x + x c x + x a y + c x + x + y # O [ 3 ] : a + c + x + y a a b b

127 7.9 SMP REFERENCE MANUAL / Structural operations 7.9 C b [ e x p r, f o r m 1, (le v s p e c : I n f ),(do m c r i t : 1 )] combines coefficients of terms matching f o r m 1, f o r m 2,... inthe domain of e x p r specified by l e v s p e c and d o m c r i t. # I [ 1 ] : : t : E x [ ( x + a + b ) ˆ 4 ] # O [ 1 ] : 4 a b + 4 a x + 4 b x + 6 a b + 6 a x + 4 a b + 4 a x # I [ 2 ] : : C b [ t, x ] b x + 4 b x a b x a b x a b x a + b + x # O [ 2 ] : 4 a b + 4 a x + 4 b x + x ( 1 2 a b a b + 4 a + 4 b ) a b + 6 a x + 4 a b + 6 b x a b x + a b + x # I [ 3 ] : : C b [ t, { b ˆ 2, a ˆ 2, b } ] # O [ 3 ] : 4 a b + 4 a x + b ( 1 2 a x + 4 a + 4 x ) + a ( 1 2 b x + 6 x ) # I [ 4 ] : : C b [ t, { x, x ˆ $ i } ] a x + b ( 1 2 a x + 6 a + 6 x ) + 4 b x + a + b + x # O [ 4 ] : 4 a b + x ( 1 2 a b a b + 4 a + 4 b ) + 6 a b + 4 a b Fac, Pf [9.1] x ( 1 2 a b + 6 a + 6 b ) + x ( 4 a + 4 b ) + a + b + x

128 7.10 SMP REFERENCE MANUAL / Structural operations Statistical expression generation and analysis R e x [ (n : 1 0 ),({ u n i t 1, (uw t 1 : 1 ),...} ),({ t e m p 1, (tw t 1 : 1 ),(n1 : 1 ),...} )] generates a pseudorandom expression containing on average n "units" selected from the uniti with statistical weights uwti,and combined by application of templates selected from the tempi with weights twti ;each tempi acts on ni expressions (or an average of - ni expressions for negative ni ). Simple defaults are provided for the u n i t i and t e m p i. R a n d [8.3] # I [ 1 ] : : R e x [ ] - 2 ( 4 + x ) # O [ 1 ] : x P i ( 1 2 y x ) x # I [ 2 ] : : R e x [ ] 2 x # O [ 2 ] : ( 8 + a ) ( z + x z ( x ) ) x y + y # I [ 3 ] : : R e x [ 5 ] 2 # O [ 3 ] : 8 + x + x # I [ 4 ] : : p [ $ n ] : : R e x [ $ n, { x, 1, - 1 }, { { M u l t, 1, - 3 }, { P l u s, 1, - 4 } } ] # O [ 4 ] : R e x [ $ n, { x, 1, - 1 }, { { M u l t, 1, - 3 }, { P l u s, 1, - 4 } } ] # I [ 5 ] : : p [ 1 0 ] # O [ 5 ] : - 4 x # I [ 6 ] : : p [ 1 0 ] # O [ 6 ] : 0 # I [ 7 ] : : p [ 1 0 ] 2 # O [ 7 ] : x ( 2 - x ) + x ( x ) ( x ) # I [ 8 ] : : p [ 2 0 ] # O [ 8 ] : x ( x ( x ) + x ( x ) ) # I [ 9 ] : : p [ 2 0 ] # O [ 9 ] : x + ( x ) ( 2 x + ( x ) ( x ) ) A e x [ e x p r 1, e x p r 2,...] performs a simple statistical analysis on the e x p r i and yields a held [3.5] R e x projection necessary to generate further expressions with the same "statistical properties". # I [ 1 ] : : A e x [ a + b ] # O [ 1 ] : R e x [ 2, { { a, 1 }, { b, 1 } }, { { P l u s, 1, 2 } } ]

129 7.10 SMP REFERENCE MANUAL / Structural operations 7.10 # I [ 2 ] : : R e x [ ] 2 # O [ 2 ] : x ( 2 + x + 2 x y z ( z ) ) # I [ 3 ] : : v : A e x [ % ] # O [ 3 ] : R e x [ 1 0, { { - 2, 1 }, { x, 3 }, { 2, 1 }, { 2, 1 }, { y, 1 }, { z, 2 }, { - 1, 1 } }, # I [ 4 ] : : R e l [ v ] { { P l u s, 3, }, { M u l t, 2, - 3 / 2 }, { P o w, 1, 2 } } ] x z x x x x x z + ( - 2 ) - 2 ( - 2 ) z # O [ 4 ] : x # I [ 5 ] : : R e l [ v ] x ( - 2 ) z y x x - 2 x y z z # O [ 5 ] : ( - 2 ) # I [ 6 ] : : A e x 5 ] # O [ 6 ] : R e x [ 2 5 / 2, { { x, 1 1 }, { - 2, 4 }, { z, 6 }, { y, 2 }, { 1, 1 }, { 2, 1 } }, { { P o w, 1 7, 2 }, { M u l t, 3, }, { P l u s, 1, 2 }, { D i v, 1, 2 } } ]

130 8. Mathematical functions 8.1 Introduction 8.2 Elementary arithmetic functions 8.3 Numerical functions 8.4 Mathematical constants 8.5 Elementary transcendental functions 8.6 Combinatorial functions 8.7 Gamma, zeta and related functions 8.8 Confluent hypergeometric and related functions 8.9 Hypergeometric and related functions 8.10 Elliptic functions 8.11 Number theoretical functions

131 8.1 SMP REFERENCE MANUAL / Mathematical functions Introduction Reductions of mathematical functions occur through simplification or numerical evaluation. Simplification yields an exact transformation; numerical evaluation is performed only in the absence of symbolic parameters, and may be approximate. Simplifications for arithmetic operations [8.2] and numerical functions [8.3] are automatically performed; elementary transcendental functions [8.5] are simplified only when the result is a rational number or multiple of a constant [8.4]. The SMP Library provides many additional relations and transformations as replacements [3.3] defined in external files and applied selectively by S projections [3.3]. Real or complex numerical values for any of the functions described below may be obtained by N projections [3.4]. Elementary arithmetic, numerical and transcendental functions, and mathematical constants may be evaluated to arbitrary numerical precision. Whenever amathematical "function" is used to represent solutions of an equation, it may take onseveral values for any particular set of arguments, as conventionally parametrized by Riemann sheets. For such multivalued "functions", numerical values are always taken on a single "principal" Riemann sheet; at the conventional positions of branch cuts, the limiting values in a counter-clockwise approach to the cut are given. Definitions of differentiation [9.4], integration [9.4], and power series expansion [9.5] for elementary arithmetic and transcendental functions are included; definitions for other functions are given inexternal files. All projections representing mathematical functions carry the property Ldist [4], as well as the properties Sys and T i e r. Definitions of mathematical functions are based primarily on four references: AS "Handbook of Mathematical Functions", ed. M.Abramowitz and I.Stegun, NBS AMS 55 (1964); Dover (1965). GR "Table of Integrals, Series and Products", I.Gradshteyn and I.Ryzhik, Academic Press (1965). MOS BMP "Formulas and Theorems for the Special Functions of Mathematical Physics", W.Magnus, F.Oberhettinger and R.P.Soni, 3rd ed, Springer-Verlag (1966). "Higher Transcendental Functions", Bateman Manuscript Project (A.Erdelyi et al.) Vols 1-3, McGraw- Hill (1953). Citations in which notations or conventions differ from those used here are indicated by.

132 8.2 SMP REFERENCE MANUAL / Mathematical functions Elementary arithmetic functions e x p r 1 + e x p r or e x p r 1 - e x p r or P l u s [ e x p r 1, e x p r 2,...] < S m p : 1, C o m m, F l a t > e x p r 1 * e x p r 2 *... or M u l t [ e x p r 1, e x p r 2,...] < S m p : 1, C o m m, F l a t > e x p r 1 / e x p r 2 or D i v [ e x p r 1, e x p r 2 ] e x p r 1 ˆ e x p r 2 or P o w [ e x p r 1, e x p r 2 ] S q r t [ e x p r ] e x p r 1. e x p r or D o t [ e x p r 1, e x p r 2,...] < F l a t > forms the inner product of e x p r 1, e x p r 2,.... For two lists x and y the inner product is a list obtained by summing x [ i [ 1 ], i [ 2 ],..., i [ n - 1 ], k ] * y [ k, j [ 2 ],..., j [ m ] ] over all values of the index k for which entries are present in both x and y. Inner [9.6] # I [ 1 ] : : { a, b, c }. { x, y, z } # O [ 1 ] : a x + b y + c z # I [ 2 ] : : { v, w }. { { a, b }, { c, d } }. { r, s } # O [ 2 ] : r ( a v + c w ) + s ( b v + d w ) # I [ 3 ] : : { [ x ] : a, [ y ] : b }. { [ x ] : { u 1, u 2 }, [ y ] : { v 1, v 2 } } # O [ 3 ] : { a u 1 + b v 1, a u 2 + b v 2 } # I [ 4 ] : : { b, c }. { a } # O [ 4 ] : { b, c }. { a } e x p r 1 * * e x p r 2 * *... or O m u l t [ e x p r 1, e x p r 2,...] < C o m m, F l a t > forms the outer product of e x p r 1, e x p r 2,.... Outer [9.6] # I [ 1 ] : : { a, b } * * { c, d } # O [ 1 ] : { { a c, a d }, { b c, b d } } # I [ 2 ] : : { { 1, 2, 3 }, { 4 } } * * { a, b } * * { c, d } # O [ 2 ] : { { { { a c, a d }, { b c, b d } }, { { 2 a c, 2 a d }, { 2 b c, 2 b d } }, { { 3 a c, 3 a d }, { 3 b c, 3 b d } } }, { { { 4 a c, 4 a d }, { 4 b c, 4 b d } } } } Multiplication of an expression by a numerical coefficient does not involve an explicit Mult projection. Such products may nevertheless be matched by a pattern in which a generic symbol representing the coefficient appears in a M u l t projection [2.6].

133 8.2 SMP REFERENCE MANUAL / Mathematical functions 8.2 # I [ 1 ] : : t : x * a # O [ 1 ] : a x # I [ 2 ] : : t [ 0 ] # O [ 2 ] : M u l t # I [ 3 ] : : u : 5 x / 6 # O [ 3 ] : 5 x / 6 # I [ 4 ] : : u [ 0 ] # O [ 4 ] : x # I [ 5 ] : : h [ $ n * x ] : j [ $ n ] # O [ 5 ] : j [ $ n ] # I [ 6 ] : : { h [ t ], h [ u ], h [ 6 ], h [ x / 3 ] } # O [ 6 ] : { j [ a ], j [ 5 / 6 ], h [ 6 ], j [ 1 / 3 ] } Plus[e x p r ] and Mult[e x p r ] are taken as e x p r ; Plus[ ] is 0 and Mult[ ] is 1. Fctl, Dfctl, Comb [8.6]

134 8.3 SMP REFERENCE MANUAL / Mathematical functions Numerical functions F l o o r [ x ] the greatest integer not larger than the real number x ("floor" of x ). C e i l [ x ] the least integer not smaller than the real number x ("ceiling" of x ). # I [ 1 ] : : { F l o o r [ 2. 4 ], F l o o r [ ], F l o o r [ - x ] } # O [ 1 ] : { 2, - 3, F l o o r [ - x ] } M o d [ n, m ] the real number n modulo the real number m. # I [ 1 ] : : { M o d [ 5, 3 ], M o d [ - 5, 3 ], M o d [ N [ P i ], 1 ] } # O [ 1 ] : { 2, 1, } S i g n [ x ] 1 or - 1 if x is a positive or neg ative real number, and 0 if x is zero. P [5] # I [ 1 ] : : { S i g n [ 2. 3 ], S i g n [ ], S i g n [ - x ] } # O [ 1 ] : { 1, - 1, S i g n [ - x ] } T h e t a [ x ] Heavyside step function θ (x ). D e l t a [ x ] Dirac s delta function δ (x ). Integrals and derivatives inv olving Theta and Delta are treated. A b s [ x ] the absolute value of a real or complex number x. # I [ 1 ] : : { A b s [ - 4 / 5 ], A b s [ 2 + I ], A b s [ a + b * I ], A b s [ - x ] } 1 / / 2 # O [ 1 ] : { 4 / 5, 5, ( a + b ), A b s [ x ] } C o n j [ e x p r ] complex conjugate. R e [ e x p r ] real part. I m [ e x p r ] imaginary part.

135 8.3 SMP REFERENCE MANUAL / Mathematical functions 8.3 # I [ 1 ] : : ( a + b * I ) * ( c + d * I ) / ( a + f * I ) a ( a c + d f ) - b ( a d - c f ) a ( a d - c f ) + b ( a c + d f ) # O [ 1 ] : * I a + f a + f # I [ 2 ] : : R e a l p [ x ] : I m a g p [ y ] : 1 # O [ 2 ] : 1 # I [ 3 ] : : { C o n j [ 2 I + 3 ], C o n j [ a ], C o n j [ a + b * I ], C o n j [ x ], C o n j [ y ], C o n j [ x + I * y ] } # O [ 3 ] : * { 3-2 I, C o n j [ a ], C o n j [ a ] + - C o n j [ b ] I, x, - y, x + y I } # I [ 4 ] : : { R e [ * I ], R e [ a + I * b ], R e [ x ], R e [ y ], R e [ x + a + y ] } # O [ 4 ] : { 3, - I m [ b ] + R e [ a ], x, 0, R e [ a + x + y ] } M a x [ x 1, x 2,...] < C o m m, F l a t > the numerically largest of x 1, x 2,... ifthis can be determined. M i n [ x 1, x 2,...] < C o m m, F l a t > the numerically smallest of x 1, x 2,... ifthis can be determined. # I [ 1 ] : : M a x [ - 2, 3, 5, 2, 1 ] # O [ 1 ] : 5 # I [ 2 ] : : M i n [ x + 2, y - 1, y + 3 ] # O [ 2 ] : M i n [ y, 2 + x ] R a n d [ (x : 1 ), ( s e e d ) ] pseudorandom number uniformly distributed between 0 and x. A number seed may be used to determine the sequence of numbers generated. # I [ 1 ] : : R a n d [ ] # O [ 1 ] : # I [ 2 ] : : R a n d [ ] # O [ 2 ] : # I [ 3 ] : : A r [ 5, ` R a n d [ ] ] # O [ 3 ] : { , , , / , }

136 8.4 SMP REFERENCE MANUAL / Mathematical functions Mathematical constants P i π = E e= E u l e r Euler-Mascheroni constant γ = [AS 6.1.3; GR 9.73; MOS 1.1] D e g π /180 = (number of radians in one degree) P h i Golden ratio φ = C a t a l a n Catalan s constant [AS ; GR 9.73] I, Inf [2.2] # I [ 1 ] : : C a t a l a n - 1 # O [ 1 ] : C a t a l a n # I [ 2 ] : : N [ % ] # O [ 2 ] : # I [ 3 ] : : N 1, 1 5 ] # O [ 3 ] : * ( )

137 8.5 SMP REFERENCE MANUAL / Mathematical functions Elementary transcendental functions E x p [ z ] L o g [ z, (ba s e : E )] Logarithm with branch cut along negative real axis [AS 4.1.1]. S i n [ z ] A s i n [ z ] S i n h [ z ] A s i n h [ z ] C o s [ z ] A c o s [ z ] C o s h [ z ] A c o s h [ z ] T a n [ z ] A t a n [ z ] T a n h [ z ] A t a n h [ z ] C s c [ z ] A c s c [ z ] C s c h [ z ] A c s c h [ z ] S e c [ z ] A s e c [ z ] S e c h [ z ] A s e c h [ z ] C o t [ z ] A c o t [ z ] C o t h [ z ] A c o t h [ z ] Trigonometric and inverse trigonometric functions with arguments in radians [AS ; AS ]. D e g [8.4] G d [ z ] A g d [ z ] Gudermannian functions gd(z), gd 1 (z) [AS ]. # I [ 1 ] : : { L o g [ 1 ], L o g [ 5 ], L o g [ - 5 ], L o g [ I ] } # O [ 1 ] : * { 0, L o g [ 5 ], L o g [ - 5 ], L o g [ I ] } # I [ 2 ] : : N [ % ] # O [ 2 ] : * { 0, , I, I } # I [ 3 ] : : { S i n [ 5 P i / 2 ], S i n [ 5 P i / 3 ], T a n [ P i / 2 ], A s i n [ 1 ], A c o s [ 6 ], A c o s [ 6 + I ] } # O [ 3 ] : * { 1, S i n [ 5 P i / 3 ], T a n [ P i / 2 ], P i / 2, A c o s [ 6 ], A c o s [ 6 + I ] } # I [ 4 ] : : N [ % ] # O [ 4 ] : * { 1, , T a n [ ], , A c o s [ 6 ], I }

138 8.6 SMP REFERENCE MANUAL / Mathematical functions Combinatorial functions n! or F c t l [ n ] Factorial [AS 6.1.6]. (B [2.1] projections are generated when necessary.) Gamma [8.7] n!! or D f c t l [ n ] Double factorial [AS (footnote); GR p.xliii]. (B [2.1] projections are generated when necessary.) C o m b [ n, m [1],(m[2],...,m[k-1],...,(m[k]:n-m[1]-m[2]-...-m[k-1]))] Multinomial coefficient (n ;m[1],m[2],..., m [k-1],m[k]) [AS ]. C o m b [ n, m ] gives binomial coefficient n [AS ; MOS 1.1]. m S t i 1 [ n, m ] First kind Stirling numbers S (m ) n [AS ]. S t i 2 [ n, m ] Second kind Stirling numbers S (m ) n [AS ]. P a r t [ n ] Partition function [AS ]. W i g [ { j 1, m 1 }, { j 2, m 2 }, { j 3, m 3 } ] Wigner 3-j symbol (Clebsch-Gordan coefficient) j 1 j 2 j 3 [AS ]. m 1 m 2 m 3 R a c [ j 1, j 2, j 3, j 4, j 5, j 6 ] Racah 6-j symbol j 1 j 4 j 2 j 5 j 3. j 6 # I [ 1 ] : : { 1 0!, 1 0 0!, 7!!, 8!! } # O [ 1 ] : * { , ( \ \ \ ), 1 0 5, } # I [ 2 ] : : { C o m b [ 1 7, 4 ], C o m b [ 1, 1 ], C o m b [ 1, 2 ] } # O [ 2 ] : { , 1, 0 } # I [ 3 ] : : { S t i 1 [ 9, 4 ], S t i 2 [ 9, 4 ] } # O [ 3 ] : { , } # I [ 4 ] : : P a r t [ 5 0 ] # O [ 4 ] : # I [ 5 ] : : W i g [ { 5, 1 }, { 4, - 2 }, { 6, 1 } ] 1 / 2 # O [ 5 ] : 1 6 /

139 8.7 SMP REFERENCE MANUAL / Mathematical functions Gamma, Zeta and related functions B e r [ n, (x : 0 )] Bernoulli numbers B n [AS ; GR 9.61; MOS 1.5.1; BMP 1.13.(1)] and polynomials B n (x )[AS ; GR 9.62; MOS 1.5.1; BMP 1.13.(2)]. B e t a [ x, y, (a : 1 )] Euler Β function Β(x, y )[AS 6.2.1; GR 8.380; MOS 1.1; BMP 1.5] and incomplete Β function Β(x, y, a ) [AS 6.6.1; GR 8.391; MOS 9.2.5; BMP 2.5.3]. C a t b [ n ] Catalan s β function β (n )[AS ]. C o s i [ z ] Cosine integral function Ci(z )[AS 5.2.2; GR ; MOS 9.2.2]. C o s h i [ z ] Hyperbolic cosine integral function Chi(z )[AS 5.2.4; MOS 9.2.2]. E i [ z ] Exponential integral Ei(z) [AS 5.1.2; GR 8.2; MOS 9.2.1; BMP (25)]. E r f [8.8] E u l [ n, (x )] Euler numbers E n [AS ; GR 9.63; MOS 1.5.2; BMP 1.14.(1)] and Euler polynomials E n (x )[AS ; MOS 1.5.2; BMP 1.14.(2)] (note relative normalization between numbers and polynomials). E x p i [ (n : 1 ),z ] Exponential integrals E n (z )[AS 5.1.4; MOS 9.2.1]. G a m m a [ z, (a : 0 )] Euler Γ function Γ(z )[AS 6.1.4; GR 8.310; MOS 1.1; BMP 1.1] and incomplete Γ function Γ(z, a )[AS 6.5.3; GR ; MOS 9.1.1; BMP ]. F c t l [8.6] L e r [ z, (s : 2 ),(a : 0 )] Lerch s transcendent Φ(z, s, α )[GR 9.55; MOS 1.6; BMP 1.11]. L i [ (n : 2 ),z ] Dilogarithm (Spence s function) Li 2 (z )[ AS27.7; MOS 1.6; BMP ] and polylogarithm function Li n (z )[BMP 1.11.(14)]. L o g i [ z ] Logarithm integral function li(z) [AS 5.1.3; GR 8.24; MOS 9.2.1]. P o c [ x, n ] Pochhammer symbol (x ) n [AS ; MOS 1.1]. P s i [ z, (n : 1 )] Digamma function ψ (z )[AS 6.3.1; GR 8.360; MOS 1.2; BMP 1.7.1] and polygamma functions ψ ( n - 1 ) (z ) [AS 6.4.1; MOS 1.2; BMP ]. S i n i [ z ] Sine integral function Si(z) [AS 5.2.1; GR ; MOS 9.2.2]. S i n h i [ z ] Hyperbolic sine integral function Shi(z) [AS 5.2.3; MOS 9.2.2]. Z e t a [ z, (a : 1 )] Riemann ζ function ζ (z )[AS 23.2; GR 9.513,9.522; MOS 1.3; BMP 1.12] and generalized ζ function ζ (z, α )[GR 9.511,9.521; MOS 1.4; BMP 1.10].

140 8.7 SMP REFERENCE MANUAL / Mathematical functions 8.7 # I [ 1 ] : : { G a m m a [ 5 / 3 ], G a m m a [ 5 / 3, 1 / 2 ], G a m m a [ - 3 ], Z e t a [ 2 ] } # O [ 1 ] : { G a m m a [ 5 / 3 ], G a m m a [ 5 / 3, 1 / 2 ], G a m m a [ - 3 ], Z e t a [ 2 ] } # I [ 2 ] : : N [ % ] # O [ 2 ] : { , , G a m m a [ - 3 ], }

141 8.8 SMP REFERENCE MANUAL / Mathematical functions Confluent hypergeometric and related functions A i r A i [ z ] Airy s function Ai(z )[AS ]. A i r B i [ z ] Airy s function Bi(z )[AS ]. A n g J [ n, z ] Anger function J n (z )[AS ; GR (1)]. B a t k [ n, z ] Bateman s function k ν (z )[AS ; MOS 6.7.2]. B e s J [ n, z ] Regular Bessel function J n (z )[AS ; GR 8.402; MOS 3.1]. B e s Y [ n, z ] Irregular Bessel function (Weber s function) Y n (z )[AS ; GR (1); MOS 3.1]. B e s j [ n, z ] Regular spherical Bessel function j n (z )[AS ; MOS 3.3]. B e s y [ n, z ] Irregular spherical Bessel function y n (z )[AS ; MOS 3.3]. B e s K [ n, z ] Modified Bessel function K n (z )[AS 9.6.2; GR (1); MOS 3.1]. B e s I [ n, z ] Modified Bessel function I n (z )[AS 9.6.3; GR 8.406; MOS 3.1]. B e s H 1 [ n, z ] Hankel function H (1) n (z )[AS 9.1.3; GR (1)]. B e s H 2 [ n, z ] Hankel function H (2) n (z )[AS 9.1.4; GR (1)]. C h g [ a, c, z ] Confluent hypergeometric (Kummer) function 1 F 1 (a ;c;z) [AS ; GR 9.210; MOS 6.1.1]. C o u F [ l, e, r ] Regular Coulomb wave function F L (η, r )[AS ]. C o u G [ l, e, r ] Irregular Coulomb wave function G L (η, r )[AS ]. E r f [ z ] Error function erf(z )[AS 7.1.1; GR (1)]. E r f c [ z ] Complementary error function erfc(z )[AS 7.1.2]. Gamma, Ei [8.7] F r e C [ z ] Fresnel s function C (z )[AS 7.3.1; GR (1)]. F r e S [ z ] Fresnel s function S (z )[AS 7.3.2; GR (2)]. H e r [ n, z ] Hermite s function H n (z )[AS ; GR 8.950]. K e l b e [ n, z ] Complex Kelvin functions ber n (z ) + i bei n (z )[AS 9.9.1; GR 8.561]. K e l k e [ n, z ] Complex Kelvin functions ker n (z ) + i kei n (z )[AS 9.9.2; GR (2)].

142 8.8 SMP REFERENCE MANUAL / Mathematical functions 8.8 K u m U [ a, b, z ] Kummer s Ufunction U (a, b, z )[AS ; GR (2); MOS 6.1.1]. L a g [ n, (a : 1 ),z ] (Generalized) Laguerre function L (a ) n (z )[AS ; GR 8.970]. L o m [ m, n, z ] Lommel s function s m,n (z )[GR (1); MOS ]. P a r [ p, z ] Parabolic cylinder functions D p (z )[ AS19.3.7; GR 9.240; MOS 8.1.1]. P c p [ n, ν, z ] Poisson-Charlier polynomials ρ n (ν, z )[AS ; MOS 6.7.2]. S t r H [ n, z ] Struve function H n (z )[AS 12.1; GR (1)]. S t r L [ n, z ] Modified Struve function L n (z )[AS ; GR (2)]. T o r [ m, n, z ] Toronto function T (m, n, z )[AS ; MOS 6.7.2]. W e b E [ n, z ] Weber s function E n (z )[AS ; GR (2)]. W h i M [ l, m, z ] Whittaker s Mfunction M l,m (z )[AS ; GR (2); MOS 7.1.1]. W h i W [ l, m, z ] Whittaker s Wfunction W l,m (z )[AS ; GR (4); MOS 7.1.1]. # I [ 1 ] : : { E r f [ 1 ], B e s I [ 1, 1 0 ], T o r [ 1. 2, 0. 3, 0. 5 ], C h g [ 5. 2, 4. 1, 3. 2 ] } # O [ 1 ] : { E r f [ 1 ], B e s I [ 1, 1 0 ], T o r [ 1. 2, 0. 3, 0. 5 ], C h g [ 5. 2, 4. 1, 3. 2 ] } # I [ 2 ] : : N [ % ] # O [ 2 ] : { , , , }

143 8.9 SMP REFERENCE MANUAL / Mathematical functions Hypergeometric and related functions C h e T [ n, x ] Chebyshef function of first kind T n (x )[AS ; MOS 5.3.1]. C h e U [ n, x ] Chebyshef function of second kind U n (x )[AS ; MOS 5.3.1]. G e g [ n, l, x ] Gegenbauer (ultraspherical) functions C (l ) n (x )[AS ; GR 8.930; MOS 5.3.1]. G h g [ p, q, { a 1, a 2,...}, { b 1, b 2,...}, z ] Generalized hypergeometric function [MOS 2.9]. H g [ a, b, c, z ] Gauss hypergeometric function 2 F 1 (a, b ;c;z) [AS ; GR 9.10; MOS 2.1]. J a c P [ n, a, b, z ] (a,b ) Jacobi functions P n (z )[AS ; GR 8.960; MOS 5.2.1]. L e g P [ l, (m : 0 ),z ] (Associated) Legendre functions P l m (z )[AS 8.1.2; GR 8.702; MOS 4.1.2, 5.4.1]. L e g Q [ l, (m : 0 ),z ] (Associated) Legendre functions of second kind Q m l (z )[AS 8.1.3; GR 8.703; MOS 4.1.2, 5.4.2]. B e t a [8.7] M a c E [ a, b, z ] MacRobert E function [GR 9.4; MOS 6.7.2]. M e i [ m, n, p, q, { a 1,..., a p }, { b 1,..., b q }, z ] Meijer G function [GR 9.30]. # I [ 1 ] : : { L e g P [ 2, 0 ], L e g P [ 2. 2, 0 ], H g [ 3, 5, 4, 2. 8 ] } # O [ 1 ] : { L e g P [ 2, 0 ], L e g P [ 2. 2, 0 ], H g [ 3, 5, 4, 2. 8 ] } # I [ 2 ] : : N [ % ] # O [ 2 ] : { , , H g [ 3, 5, 4, 2. 8 ] }

144 8.10 SMP REFERENCE MANUAL / Mathematical functions Elliptic functions E l l K [ k, (t : P i / 2 )] First kind elliptic integral K (k t )[ AS17.2.6; GR (2); MOS 10.1]. E l l E [ k, (t : P i / 2 )] Second kind elliptic integral E (k t )[ AS17.2.8; GR (3); MOS 10.1]. E l l P i [ n, k, (t : P i / 2 )] Third kind elliptic integral Π(n, k t )[ AS ; GR (4); MOS 10.1]. J a c S n [ x, m ] J a c C n [ x, m ] J a c D n [ x, m ] J a c C d [ x, m ] J a c S d [ x, m ] J a c N d [ x, m ] J a c D c [ x, m ] J a c N c [ x, m ] J a c S c [ x, m ] J a c N s [ x, m ] J a c D s [ x, m ] J a c C s [ x, m ] J a c A m [ x, m ] Jacobian elliptic functions Sn(x m) etc. [AS 16.1; GR 8.144; MOS 10.3]. J a c t h [ i, z, m ] Jacobi θ functions θ i (z m )[AS 16.27; GR 8.18; MOS 10.2]. W e i P [ u, g, h ] Weierstrass function P (u ; g, h )[AS 18; GR 8.160; MOS 10.5]. W e i z [ u, g, h ] Weierstrass ζ function ζ (u ; g, h )[GR (1); MOS 10.5]. W e i s [ u, g, h ] Weierstrass σ function σ (u ; g, h )[GR (2); MOS 10.5]. # I [ 1 ] : : { E l l K [ 1 / 4 ] } # O [ 1 ] : { E l l K [ 1 / 4 ] } # I [ 2 ] : : N [ % ] # O [ 2 ] : { }

145 8.11 SMP REFERENCE MANUAL / Mathematical functions Number theoretical functions G c d [ n 1, n 2,...] the greatest common divisor of the integers n 1, n 2,.... D i v i s [ n ] alist of the integer divisors of an integer n. M o d [8.3] N f a c [ n ] alist of the prime factors of an integer or rational number n,together with their exponents. P r i m e [ n ] the n th prime number. D i v s i g [ (k : 1 ),n ] Divisor function σ k (n )(σ 0 (n ) = d (n )) [AS ]. J a c s y m [ p, q ] Jacobi symbol p [BMP 17.5]. q J o r [ k, n ] Jordan s function J k (n )(k th totient of n )[BMP ]. L i o [ n ] Liouville s function ν (n )[BMP ]. M a n L [ n ] Mangoldt Λ function [BMP ]. M o b [ (k : 1 ),n ] Mobius µ function µ k (n )oforder k [AS ]. R r s [ n ] List containing reduced residue system modulo n. T o t i e n t [ n ] Euler s totient function φ(n )[AS ]. # I [ 1 ] : : { G c d [ 1 5, 2 5 ], G c d [ 9 / 5, 6 / 7 ] } # O [ 1 ] : { 5, 3 / 3 5 } # I [ 2 ] : : D i v i s [ 1 2 ] # O [ 2 ] : { 1, 2, 4, 3, 6, 1 2 } # I [ 3 ] : : N f a c [ ] # O [ 3 ] : { { 2, 1 }, { 3, 2 }, { 3 7, 1 } } # I [ 4 ] : : N f a c [ 3 5 / 9 9 ] # O [ 4 ] : { { 5, 1 }, { 7, 1 }, { 3, - 2 }, { 1 1, - 1 } } # I [ 5 ] : : P r i m e [ ] # O [ 5 ] : 5 4 1

146 8.11 SMP REFERENCE MANUAL / Mathematical functions 8.11 # I [ 6 ] : : { D i v s i g [ 1 2 ], D i v s i g [ P i, 1 2 ] } 3 P i 2 P i ( ) ( ) # O [ 6 ] : { 2 8, } P i P i ( ) ( ) # I [ 7 ] : : J a c s y m [ 8 8 8, ] # O [ 7 ] : - 1 # I [ 8 ] : : J o r [ P i, 1 2 ] P i - P i - P i # O [ 8 ] : 1 2 ( 1-2 ) ( 1-3 ) # I [ 9 ] : : L i o [ 1 2 ] # O [ 9 ] : - 1 # I [ 1 0 ] : : M a n L [ ] # O [ 1 0 ] : L o g [ 5 ] # I [ 1 1 ] : : { M o b [ 7 ], M o b [ 1 2 ], M o b [ 2, 1 2 ] } # O [ 1 1 ] : { - 1, 0, - 1 } # I [ 1 2 ] : : R r s [ 1 2 ] # O [ 1 2 ] : { 1, 5, 7, 1 1 } # I [ 1 3 ] : : { L e n [ % ], T o t i e n t [ 1 2 ], J o r [ 1, 1 2 ] } # O [ 1 3 ] : { 4, 4, 4 }

147 9. Mathematical operations 9.1 Polynomial manipulation 9.2 Evaluation of sums and products 9.3 Solution of equations 9.4 Differentiation and integration 9.5 Series approximations and limits 9.6 Matrix and explicit tensor manipulation

148 9.1 SMP REFERENCE MANUAL / Mathematical operations Polynomial manipulation Polynomials consist of sums of powers of "base" expressions. The bases in an expression are by default taken as the literal first filters of P o w projections. Polyp [7.6] P d i v [ e x p r 1, (e x p r 2 : 1 ),(fo r m )] the polynomial quotient of e x p r 1 and e x p r 2 with respect to the "base" f o r m. # I [ 1 ] : : P d i v [ x + a, x + b, x ] # O [ 1 ] : 1 # I [ 2 ] : : P d i v [ x + a, x + b, a ] a x # O [ 2 ] : b + x b + x # I [ 3 ] : : P d i v [ x ˆ 3, x - 1, x ] 2 # O [ 3 ] : 1 + x + x # I [ 4 ] : : P d i v [ x ˆ 4 + x ˆ 2, x + S q r t [ x ] + 2, S q r t [ x ] ] 1 / 2 3 / / 2 3 # O [ 4 ] : 6-6 x + 3 x - x - x + x # I [ 5 ] : : P d i v [ a ˆ ( 3 b ), a ˆ b - 1, a ˆ b ] b 2 b # O [ 5 ] : 1 + a + a P m o d [ e x p r 1, e x p r 2, (fo r m )] the remainder from division of e x p r 1 by e x p r 2 with respect to f o r m (polynomial modulus). M o d [8.3] # I [ 1 ] : : P m o d [ x + a, x + b, x ] # O [ 1 ] : a - b # I [ 2 ] : : P m o d [ x + a, x + b, a ] # O [ 2 ] : 0 # I [ 3 ] : : P m o d [ x + b, x + a, a ] # O [ 3 ] : b + x # I [ 4 ] : : P m o d [ x ˆ 7, x ˆ 4 + 1, x ] 3 # O [ 4 ] : - x P g c d [ e x p r 1, e x p r 2, (fo r m )] greatest common divisor of the polynomials e x p r 1 and e x p r 2 with respect to f o r m. G c d [8.11]

149 9.1 SMP REFERENCE MANUAL / Mathematical operations 9.1 # I [ 1 ] : : t 1 : E x [ ( x + 1 ) ( x + 2 ) ( x + 3 ) ] 2 3 # O [ 1 ] : x + 6 x + x # I [ 2 ] : : t 2 : E x [ ( x + 1 ) ( x + 2 ) ( x - 4 ) ] 2 3 # O [ 2 ] : x - x + x # I [ 3 ] : : P g c d [ t 1, t 2, x ] 2 # O [ 3 ] : x + 7 x # I [ 4 ] : : F a c [ % ] # O [ 4 ] : 7 ( 1 + x ) ( 2 + x ) # I [ 5 ] : : P g c d [ x + a, x + b, x ] # O [ 5 ] : a - b # I [ 6 ] : : P g c d [ x + a, x + b, a ] # O [ 6 ] : b + x R s l t [ e x p r 1, e x p r 2 ] polynomial resultant of e x p r 1 and e x p r 2 with respect to the "base" f o r m. F a c [ e x p r, (le v : 1 ),( f o r m 1 ),(cr i t : 1 ),( r ep1 )] factors polynomials appearing at or below level lev in expr (and not yielding "false" on application of the template c r i t )with respect to "bases" matching f o r m 1, f o r m 2,.... The smallest available bases are taken as default. (The replacements r ep1, r ep2,... will specify polynomial equations defining algebraic extensions to the default real integer factorization field.) Nfac [8.11] # I [ 1 ] : : F a c [ x ˆ 4-1 ] 2 # O [ 1 ] : ( x ) ( 1 + x ) ( 1 + x ) # I [ 2 ] : : t : ( 1 + x ) ( x - 7 ) ˆ 2 * ( x ˆ ) 2 2 # O [ 2 ] : ( x ) ( 1 + x ) ( 2 + x ) # I [ 3 ] : : u : E x [ t ] # O [ 3 ] : x x x x + x # I [ 4 ] : : F a c [ u ] 2 2 # O [ 4 ] : ( x ) ( 1 + x ) ( 2 + x ) # I [ 5 ] : : F a c [ x ˆ 4-1,, { x ˆ 2 } ] 2 2 # O [ 5 ] : ( x ) ( 1 + x ) # I [ 6 ] : : F a c [ x ˆ 2-1,, { x ˆ ( 1 / 3 ) } ] 1 / 3 1 / 3 1 / 3 2 / 3 1 / 3 2 / 3 # O [ 6 ] : ( x ) ( 1 + x ) ( 1 - x + x ) ( 1 + x + x )

150 9.1 SMP REFERENCE MANUAL / Mathematical operations 9.1 # I [ 7 ] : : v : ( a + 1 ) ( b + 2 ) ( c - 7 ) ˆ 2 2 # O [ 7 ] : ( c ) ( 1 + a ) ( 2 + b ) # I [ 8 ] : : w : E x [ v ] 2 2 # O [ 8 ] : a b c a b a c + 2 a c b c + b c # I [ 9 ] : : F a c [ w ] a b c + a b c + 2 c 2 # O [ 9 ] : ( c ) ( 1 + a ) ( 2 + b ) E x [7.8] Cb, Col [7.9] P f [ e x p r, (fo r m )] yields a partial fraction form of e x p r with respect to the "base" f o r m. # I [ 1 ] : : t : 1 / ( ( x - a ) ( x - b ) ) 1 # O [ 1 ] : ( - a + x ) ( - b + x ) # I [ 2 ] : : P f [ t, x ] # O [ 2 ] : ( a - b ) ( a - x ) ( a - b ) ( b - x ) # I [ 3 ] : : P f [ x ˆ 3 / ( 1 - x ), x ] 1 2 # O [ 3 ] : x x x # I [ 4 ] : : u : ( x ˆ ) / ( 1 + S q r t [ x ] + x ) x # O [ 4 ] : / x + x # I [ 5 ] : : P f [ u, x ] 1 / x 1 / 2 # O [ 5 ] : x x 1 / x + x # I [ 6 ] : : P f [ u, S q r t [ x ] ] x # O [ 6 ] : / x + x

151 9.2 SMP REFERENCE MANUAL / Mathematical operations Evaluation of sums and products S u m [ e x p r, v a r 1, (lo w e r 1 : 0 ),(up p e r 1 : v a r 1 ),(st e p 1 : 1 ),(te s t 1 : 1 ),(en d t e s t 1 : 0 ),... ] forms the sum of the values of e x p r when the symbols v a r i successively take onvalues from l o w e r i to u p p e r i with increments s t e p i. Ifthe value of t e s t i is 0,the current value of e x p r is not included in the sum. The summation terminates if projection of endtesti onto the list {vari,curexpr,cursum }, where curexpr is the current value of e x p r and c u r s u m is the current partial sum, yields true. # I [ 1 ] : : S u m [ f [ i ], { i, 1, 5 } ] # O [ 1 ] : f [ 1 ] + f [ 2 ] + f [ 3 ] + f [ 4 ] + f [ 5 ] # I [ 2 ] : : S u m [ f [ i ], { i, x, x + 5, 2 } ] # O [ 2 ] : f [ x ] + f [ 2 + x ] + f [ 4 + x ] # I [ 3 ] : : S u m [ f [ i ], { i, 1, 2 0, 2, M o d [ i, 3 ] } ] # O [ 3 ] : f [ 1 ] + f [ 5 ] + f [ 7 ] + f [ 1 1 ] + f [ 1 3 ] + f [ 1 7 ] + f [ 1 9 ] # I [ 4 ] : : S u m [ 1 / i ˆ 2, { i, 1, } ] # O [ 4 ] : # I [ 5 ] : : S u m [ f [ i ], { i, 1, n } ] # O [ 5 ] : S u m [ f [ i ], { i, 1, n } ] # I [ 6 ] : : S u m [ S [ x, $ x - > f [ $ x ], i ], { i, 1, 4 } ] # O [ 6 ] : f [ x ] + f [ f [ x ] ] + f [ f [ f [ x ] ] ] + f [ f [ f [ f [ x ] ] ] ] # I [ 7 ] : : S u m [ 1 / 3 ˆ i, { i, 1, ,,, P r [ $ [ 2 ] ] < } ] * ˆ * ˆ * ˆ - 5 # O [ 7 ] : P r o d [ e x p r, v a r 1, (lo w e r 1 : 0 ),(up p e r 1 : v a r 1 ),(st e p 1 : 1 ),(te s t 1 : 1 ),(en d t e s t 1 : 0 ),... ] forms the product of the values of expr when the symbols vari successively take on values from loweri to u p p e r i with increments s t e p i. Ifthe value of t e s t i is 0,the current value of e x p r is not included in the product. The product terminates if projection of endtesti onto the list {vari,curexpr,curprod}, where curexpr is the current value of e x p r and c u r p r od is the current partial product, yields true. # I [ 1 ] : : P r o d [ ( x - 2 i ), { i, 1, 4 } ] # O [ 1 ] : ( x ) ( x ) ( x ) ( x ) In multiple sums or products, v a r 1 is taken as the innermost summation or product variable. The default upperi yield indefinite sums or products; if no loweri is specified, it is taken as an internally-generated symbol [2.2]. After each new term is added in a sum or product, any e n d t e s t i is applied as a template to a list consisting of the current value of v a r i,the last term added, and the current partial sum or product. If the result is determined to be true, no further terms are added, and the current partial sum or product is taken as the complete sum or product.

152 9.2 SMP REFERENCE MANUAL / Mathematical operations 9.2 Sums and products with infinite limits may be evaluated numerically with an N projection [3.4]. Indefinite sums or products which cannot be performed explicitly are converted into a canonical form with internally-generated symbols for the v a r i. D o [6.2]

153 9.3 SMP REFERENCE MANUAL / Mathematical operations Solution of equations S o l [ e q n 1, f o r m 1, ( e l i m 1 )] takes the equations e q n 1,... (represented as E q projections [6]) and yields a list of simplified equations or, if possible, replacements giving solutions for forms matching f o r m 1,... after eliminating forms matching e l i m 1,... where possible. Undetermined parameters in solutions appear as indices in the resulting list. Solutions for classes of equations may be defined by assignments for the relevant Sol projections [3.2]. The assignment S o l [ f [ $ x ] = $ y, $ x ] : : S o l [ $ x = f i [ $ y ], $ x ] thus defines an "inverse" for the "function" f. M d i v [9.6] # I [ 1 ] : : S o l [ a x + b = c, x ] - b + c # O [ 1 ] : { x - > } a # I [ 2 ] : : f : E x [ ( x - 4 ) ( 2 x - 3 ) ( 5 - x ) ( x + 1 ) ] # O [ 2 ] : x x x - 2 x # I [ 3 ] : : S o l [ f = 0, x ] # O [ 3 ] : { x - > - 1, x - > 3 / 2, x - > 4, x - > 5 } # I [ 4 ] : : S o l [ x ˆ 3 = 3, x ] 1 / 3 1 / 3 1 / 3 # O [ 4 ] : * { x - > 3 E x p [ 4 P i / 3 I ], x - > 3 E x p [ 2 P i / 3 I ], x - > 3 } # I [ 5 ] : : N [ % ] # O [ 5 ] : * { x - > I, x - > I, x - > } # I [ 6 ] : : S o l [ f [ x ] = y, x ] # O [ 6 ] : { f [ x ] = y } # I [ 7 ] : : S o l [ f [ $ x ] = $ y, $ x ] : : S o l [ $ x = f i n v [ $ y ], $ x ] # O [ 7 ] : S o l [ $ x = f i n v [ $ y ], $ x ] # I [ 8 ] : : S o l [ f [ a * x + b ] = y + c, x ] - b + f i n v [ c + y ] # O [ 8 ] : { x - > } a # I [ 9 ] : : u : { 2 x + 3 y = 5, 7 y - x = 9 a } # O [ 9 ] : { 2 x + 3 y = 5, 7 y = 9 a + x } # I [ 1 0 ] : : S o l [ u, { x, y } ] 7 0 / a / ( 5 / a ) # O [ 1 0 ] : { { x - > , y - > } } # I [ 1 1 ] : : S o l [ { x ˆ x ˆ 2 * y + 2 y ( y - 2 ) x + y ˆ 2 = 4, x ˆ x * y + 2 y ˆ 2-5 y + 2 = 0 }, { x, y } ] # O [ 1 1 ] : { { x - > - 5, y - > 3 }, { x - > 0, y - > 2 }, { x - > - 4, y - > 2 } }

154 9.3 SMP REFERENCE MANUAL / Mathematical operations 9.3 # I [ 1 2 ] : : S o l [ { x = t ˆ 2 - t + 1, y = 2 t ˆ 2 + t - 3 },, t ] 2 2 # O [ 1 2 ] : { 4 ( y ) ( x ) + ( y ) + 4 ( x ) = x + 3 y }

155 9.4 SMP REFERENCE MANUAL / Mathematical operations Differentiation and integration A"variable" is an expression containing a single symbol (either on its own or in a projection; in the latter case the necessary Jacobian factors are extracted). D [ e x p r, v a r 1, (n1 : 1 ),(pt 1 : v a r 1 ), v a r 2, (n2 : 1 ),(pt 2 : v a r 2 )...] forms the partial derivative of expr successively ni times with respect to the "variables" vari, evaluating the final result at the point v a r i p t i. D t [ e x p r, v a r 1, (n1 : 1 ),(pt 1 : v a r 1 ), v a r 2, (n2 : 1 ),(pt 2 : v a r 2 )...] forms the total derivative of e x p r with respect to the variables v a r i. D t [ e x p r ] forms the total differential of e x p r. Derivatives which cannot be performed explicitly are converted into a canonical form with internally-generated symbols [2.2] for the v a r i,and explicit values for n i and p t i. Derivatives may be defined by assignments for the relevant D or D t projections. D [ f [ $x, $y], { $x, 1, $z} ] : g [ $z, $y] defines the derivative of the "function" f with respect to its first "argument". In D projections, distinct symbols are assumed independent, while in Dt projections, they are assumed to be interdependent, unless the corresponding derivative has explicitly been assigned the value 0. Symbols or projections carrying the property C o n s t [4] are assumed independent of all variables. N projections [3.4] yield when possible numerical values for derivatives with definite p t i. # I [ 1 ] : : t : a x ˆ b b # O [ 1 ] : a x # I [ 2 ] : : D [ t, x ] b # O [ 2 ] : a b x # I [ 3 ] : : D [ t, x, x ] b # O [ 3 ] : a b x ( b ) # I [ 4 ] : : D [ t, { x, 3 } ] b # O [ 4 ] : a b x ( b ) ( b ) # I [ 5 ] : : D [ t, { x, 0 } ] b # O [ 5 ] : a x # I [ 6 ] : : D [ t, { x, n } ] b # O [ 6 ] : D [ a # 1, { # 1, n, x } ] # I [ 7 ] : : D [ t, L o g [ x ] ] b # O [ 7 ] : a b x # I [ 8 ] : : D [ t, x, b ] b b # O [ 8 ] : a x + a b x L o g [ x ]

156 9.4 SMP REFERENCE MANUAL / Mathematical operations 9.4 # I [ 9 ] : : D [ t, { x, 1, y } ] b # O [ 9 ] : a b y # I [ 1 0 ] : : D [ t, { x, 0, y } ] b # O [ 1 0 ] : a y # I [ 1 1 ] : : D [ t, { x, 1, y }, { y, 1, x } ] b # O [ 1 1 ] : a b x ( b ) # I [ 1 2 ] : : D [ t, { x, 2, x ˆ 2 } ] b # O [ 1 2 ] : a b x ( b ) # I [ 1 3 ] : : D [ { x ˆ 2, x ˆ 3 }, x ] 2 # O [ 1 3 ] : { 2 x, 3 x } # I [ 1 4 ] : : D [ S i n [ E x p [ x ] ], x ] # O [ 1 4 ] : C o s [ E x p [ x ] ] E x p [ x ] # I [ 1 5 ] : : D [ E x p [ a x ] = b x ˆ 2, x ] # O [ 1 5 ] : a E x p [ a x ] = 2 b x # I [ 1 6 ] : : D [ f [ x ], x ] # O [ 1 6 ] : D [ f [ # 1 ], { # 1, 1, x } ] # I [ 1 7 ] : : D [ f [ x ˆ 2 ], x ] 2 # O [ 1 7 ] : 2 x D [ f [ # 1 ], { # 1, 1, x } ] # I [ 1 8 ] : : S [ %, f - > L o g ] 2 # O [ 1 8 ] : - x # I [ 1 9 ] : : D [ f [ g [ x ] ], x ] # O [ 1 9 ] : D [ f [ # 1 ], { # 1, 1, g [ x ] } ] D [ g [ # 1 ], { # 1, 1, x } ] # I [ 2 0 ] : : D [ f [ x, x ], x ] # O [ 2 0 ] : D [ f [ x, # 2 ], { # 2, 1, x } ] + D [ f [ # 1, x ], { # 1, 1, x } ] # I [ 2 1 ] : : D [ f [ g 1 [ x ], g 2 [ x ] ], x ] # O [ 2 1 ] : D [ f [ # 1, g 2 [ x ] ], { # 1, 1, g 1 [ x ] } ] D [ g 1 [ # 1 ], { # 1, 1, x } ] # I [ 2 2 ] : : D [ f [ x ], g [ x ] ] D [ f [ # 1 ], { # 1, 1, x } ] # O [ 2 2 ] : D [ g [ # 1 ], { # 1, 1, x } ] # I [ 2 3 ] : : D [ f [ g [ x ] ], g [ x ] ] # O [ 2 3 ] : D [ f [ # 1 ], { # 1, 1, g [ x ] } ] + D [ f [ g 1 [ x ], # 2 ], { # 2, 1, g 2 [ x ] } ] D [ g 2 [ # 1 ], { # 1, 1, x } ]

157 9.4 SMP REFERENCE MANUAL / Mathematical operations 9.4 # I [ 2 4 ] : : D [ f [ x ], x, x ] # O [ 2 4 ] : D [ f [ # 1 ], { # 1, 2, x } ] # I [ 2 5 ] : : D [ f [ x, x ], x, x ] # O [ 2 5 ] : D [ f [ x, # 2 ], { # 2, 2, x } ] + D [ f [ # 1, x ], { # 1, 2, x } ] # I [ 2 6 ] : : D [ f [ g [ x ] ], x, x ] + D [ f [ # 1, # 2 ], { # 1, 1, x }, { # 2, 1, x } ] + D [ f [ # 1, # 2 ], { # 2, 1, x }, { # 1, 1, x } ] # O [ 2 6 ] : D [ f [ # 1 ], { # 1, 1, g [ x ] } ] D [ g [ # 1 ], { # 1, 2, x } ] 2 + D [ f [ # 1 ], { # 1, 2, g [ x ] } ] D [ g [ # 1 ], { # 1, 1, x } ] # I [ 2 7 ] : : D [ p [ $ x ], { $ x, 1, $ y } ] : q [ $ y ] # O [ 2 7 ] : q [ $ y ] # I [ 2 8 ] : : D [ p [ x ], x ] # O [ 2 8 ] : q [ x ] # I [ 2 9 ] : : D [ p [ x ˆ 2 ], x ] 2 # O [ 2 9 ] : 2 x q [ x ] # I [ 3 0 ] : : D [ %, x ] # O [ 3 0 ] : 2 ( q [ x ] + 2 x D [ q [ # 1 ], { # 1, 1, x } ] ) # I [ 3 1 ] : : D [ p [ x, 2 ], x ] # O [ 3 1 ] : D [ p [ # 1, 2 ], { # 1, 1, x } ] # I [ 3 2 ] : : D [ j [ $ x, $ y ], { $ x, 1, $ z } ] : j 1 [ $ z, $ y ] # O [ 3 2 ] : j 1 [ $ z, $ y ] # I [ 3 3 ] : : D [ j [ $ x, $ y ], { $ y, 1, $ z } ] : j 2 [ $ x, $ z ] # O [ 3 3 ] : j 2 [ $ x, $ z ] # I [ 3 4 ] : : D [ j [ x, 3 ], x ] # O [ 3 4 ] : j 1 [ x, 3 ] # I [ 3 5 ] : : D [ j [ x, x ], x ] # O [ 3 5 ] : j 1 [ x, x ] + j 2 [ x, x ] # I [ 3 6 ] : : D [ j [ x ˆ 2, x ] p [ x + j [ x, x - 1 ] ], x ] 2 2 # O [ 3 6 ] : p [ x + j [ x, x ] ] ( j 2 [ x, x ] + 2 x j 1 [ x, x ] ) 2 + j [ x, x ] q [ x + j [ x, x ] ] * ( 1 + j 1 [ x, x ] + j 2 [ x, x ] )

158 9.4 SMP REFERENCE MANUAL / Mathematical operations 9.4 # I [ 1 ] : : D [ y, x ] # O [ 1 ] : 0 # I [ 2 ] : : D t [ y, x ] # O [ 2 ] : D t [ y, x ] # I [ 3 ] : : t : a x ˆ b b # O [ 3 ] : a x # I [ 4 ] : : D t [ t, x ] b b b # O [ 4 ] : a ( b x + x D t [ b, x ] L o g [ x ] ) + x D t [ a, x ] # I [ 5 ] : : D t [ a, x ] : 0 # O [ 5 ] : 0 # I [ 6 ] : : D t [ t, x ] b b # O [ 6 ] : a ( b x + x D t [ b, x ] L o g [ x ] ) # I [ 7 ] : : D t [ t ] b b b # O [ 7 ] : a ( b x D t [ x ] + x D t [ b ] L o g [ x ] ) + x D t [ a ] I n t [ e x p r, v a r 1, (lo w e r 1 ),(up p e r 1 : v a r 1 )..., ( i t e r m 1 )] forms the integral of e x p r successively with respect to the variables v a r 1,... between the limits l o w e r 1,... and u p p e r 1,.... The default u p p e r i yield indefinite integrals; if no l o w e r i is specified, it is taken as an internally-generated symbol [2.2]. Any integral whose indefinite form involves only elementary arithmetic [8.2] and transcendental [8.5] functions is performed explicitly. Any i t e r m i are taken as candidate additional terms in the integral. Integrals which cannot be performed explicitly are converted into a canonical form with internally-generated symbols for the v a r i. Integrals may be defined by assignments for the relevant I n t projections. All distinct symbols are assumed independent. N projections [3.4] yield when possible numerical values for integrals with definite limits l o w e r i and u p p e r i. # I [ 1 ] : : t : a x ˆ b b # O [ 1 ] : a x # I [ 2 ] : : I n t [ t, x ] 1 + b x # O [ 2 ] : a ( # ) 1 + b # I [ 3 ] : : I n t [ t, { x, p 1 } ] 1 + b 1 + b - p 1 x # O [ 3 ] : a ( ) 1 + b 1 + b

159 9.4 SMP REFERENCE MANUAL / Mathematical operations 9.4 # I [ 4 ] : : I n t [ t, { x, p 1, p 2 } ] 1 + b 1 + b - p 1 p 2 # O [ 4 ] : a ( ) 1 + b 1 + b # I [ 5 ] : : I n t [ x ˆ 2, { { x }, { x } } ] 4 x # O [ 5 ] : # x # # I [ 6 ] : : D [ %, x ] 3 x # O [ 6 ] : # # I [ 7 ] : : D [ %, x ] 2 # O [ 7 ] : x # I [ 8 ] : : I n t [ { x ˆ a, x ˆ b }, { x, 0, 1 } ] 1 1 # O [ 8 ] : { , } 1 + a 1 + b # I [ 9 ] : : t : ( x ˆ ) / ( x ˆ x ˆ x ) x # O [ 9 ] : x + 9 x + x # I [ 1 0 ] : : I n t [ t, { x, 0 } ] 8 5 L o g [ 3 ] L o g [ 5 ] 5 L o g [ 1 + x ] 8 5 L o g [ 3 + x ] # O [ 1 0 ] : - 9 x # I [ 1 1 ] : : D [ %, x ] L o g [ 5 + x ] x # O [ 1 1 ] : x ( 1 + x ) 4 ( 3 + x ) 8 ( 5 + x ) # I [ 1 2 ] : : R a t [ E x [ R a t [ % ] ] ] x # O [ 1 2 ] : x + 9 x + x # I [ 1 3 ] : : I n t [ t, { x, 0, 1 } ] 5 L o g [ 2 ] 8 5 L o g [ 3 ] 8 5 L o g [ 4 ] L o g [ 5 ] L o g [ 6 ] # O [ 1 3 ] : /

160 9.4 SMP REFERENCE MANUAL / Mathematical operations 9.4 # I [ 1 4 ] : : N [ % ] # O [ 1 4 ] : # I [ 1 5 ] : : I n t [ ( x + 3 ) ( x + 2 ) / ( x + 1 ), { x, 0, 1 } ] # O [ 1 5 ] : 9 / L o g [ 2 ] # I [ 1 6 ] : : I n t [ f [ x ], x ] # O [ 1 6 ] : I n t [ f [ # 3 0 ], { # 3 0, # 2 8, x } ] # I [ 1 7 ] : : I n t [ f [ x ], g [ x ] ] # O [ 1 7 ] : I n t [ f [ x ] D [ g [ # 1 ], { # 1, 1, x } ], { x, # 3 1, g [ x ] } ] # I [ 1 8 ] : : I n t [ x f [ x ], x ] # O [ 1 8 ] : I n t [ # 3 4 f [ # 3 4 ], { # 3 4, # 3 2, x } ] # I [ 1 9 ] : : I n t [ a f [ b x ] + g [ x + 1 ] + x, x ] # O [ 1 9 ] : # I n t [ g [ 1 + # 4 0 ], { # 4 0, # 3 8, x } ] 2 x + a I n t [ f [ b # 4 4 ], { # 4 4, # 4 2, x } ] # I [ 2 0 ] : : I n t [ f [ $ x, $ a ], { $ x, 0, 1 } ] : h [ $ a ] # O [ 2 0 ] : h [ $ a ] # I [ 2 1 ] : : I n t [ 3 f [ x, 2 ] + 5 a f [ x, a - 1 ] + 1 / ( x + 1 ), { x, 0, 1 } ] # O [ 2 1 ] : 3 h [ 2 ] + L o g [ 2 ] + 5 a h [ a ] # I [ 2 2 ] : : I n t [ G a m m a [ x + 1 ], { x, 0, 3 } ] # O [ 2 2 ] : I n t [ G a m m a [ 1 + x ], { x, 0, 3 } ] # I [ 2 3 ] : : N [ % ] # O [ 2 3 ] :

161 9.5 SMP REFERENCE MANUAL / Mathematical operations Series approximations and limits P s [ (e x p r : 1 ), v a r 1, p t 1, (so r d1 : 0 ),o r d1, (se r : { [ s o r d1] : 0,..., [ - 1 ] : 0, [ 0 ] : 1, [ 1 ] : 0,..., [ o r d1] : 0 } )] Power (Taylor-Laurent) series in v a r 1,... about the points p t 1,... toatmost order o r d1,.... Terms proportional to v a r 1 ˆ j 1 var2ˆj 2... are given when j 1, j 2,... lie within a simplex with vertices (d j i :s o r di), (j 1 :o r d1, j i :s o r di), (j 2 :o r d2, j i :s o r di),.... s e r [ i ] gives the coefficient of v a r 1 ˆ i in the power series. Composition of a function f with a power series will be carried out only if f carries the property L d i s t. R a [expr,var,pt, degn,(degd : degn), (crit : $ 1 = degn&$2 = degd), (se r n : { [ 0 ] : 1,..., [ d e gn]:0}),(se r d : { [ 0 ] : 1,..., [ d e gd]:0})] Rational (Pade) approximants in var about the point pt, to at most order degn in numerator and degd in denominator series. All order (m,n )approximants with m+n<degn+degd such that application of the template c r i t to m,n yields "true" are given (in a list if necessary). s e r n [ i ] is the coefficient of v a r ˆ i in the numerator series, and s e r d[j ] of v a r ˆ j in the denominator. C f [ e x p r, (va r : 1 ),(pt : 0 ), (so r d : 0 ),(or d : 0 ), (se r : { [ 0 ] : 1, [ 1 ] : 0,..., [ o r d]:0})] Continued fraction approximation in var about the point pt. ser [i] gives the coefficient of var in the ith partial quotient of the continued fraction. expr gives an overall factor for the series. Input Ps, Ra and Cf projections are simplified so that all possible terms are transferred from e x p r to coefficients in the series s e r k. Arithmetic and mathematical operations and substitutions (compositions) may be performed on series approximations: the results are taken to the highest permissible order. A x [ e x p r ] yields an ordinary expression obtained by truncating all higher order terms in the series approximation e x p r. If the expression e x p r in P s, R a and C f is a series approximation, it is converted to the specified form, maintaining the highest permissible order. Series approximations may be defined by assignments for P s projections. P s [ex p [$x ],$x,0,$n ] :Ps [1,$x,0,$n, { [$i ] :1/$i! } ] defines the power series for the exponential function around the origin. R a and C f use assignments made for P s projections. Numerical values for series approximations are obtained using N. # I [ 1 ] : : p : P s [ L o g [ 1 + x ], x, 0, 6 ] x x x x x # O [ 1 ] : * x # I [ 2 ] : : L p r [ p ] P s [ 1, x, 0, { 1, 6 }, { [ 1 ] : 1, [ 2 ] : - 1 / 2, [ 3 ] : 1 / 3, [ 4 ] : - 1 / 4, [ 5 ] : 1 / 5, \ [ 6 ] : - 1 / 6 } ] # I [ 3 ] : : E x p [ p / 5 ] x 6 x 2 1 x x x # O [ 3 ] : * 1 + x / # I [ 4 ] : : % ˆ 5 # O [ 4 ] : * 1 + x

162 9.5 SMP REFERENCE MANUAL / Mathematical operations 9.5 # I [ 5 ] : : P s [ ( 1 - x ) ˆ n, x, 0, 3 ] 2 3 # O [ 5 ] : * 1 - n x + n x ( - 1 / 2 + n / 2 ) - n x ( - 2 / 3 + n / 3 ) ( - 1 / 2 + n / 2 ) # I [ 6 ] : : P s [ S i n [ x ] / x, x, a, 1 ] S i n [ a ] ( x - a ) ( C o s [ a ] ) S i n [ a ] a # O [ 6 ] : * a a # I [ 7 ] : : E x [ % ] S i n [ a ] C o s [ a ] S i n [ a ] # O [ 7 ] : * ( x - a ) ( ) a a 2 a # I [ 8 ] : : p : P s [ E x p [ x ], x, I n f, 6 ] # O [ 8 ] : * E x p [ x ] 1 # I [ 9 ] : : p : p * E x p [ 1 / x ] x x x # O [ 9 ] : * E x p [ x ] ( 1 + x ) # I [ 1 0 ] : : s [ 0 ] : 0 ; s [ $ i ] : 1 / $ i! ˆ 2 ; s 1 # O [ 1 0 ] : { [ 0 ] : 0, [ $ i ] : } 2 ( $ i! ) # I [ 1 1 ] : : P s [ x ˆ ( n + 2 ) ( 1 - x ), x, 0, 5, s ] n 3 3 x 2 x 5 x x # O [ 1 1 ] : * x ( x ) # I [ 1 2 ] : : P s [ f [ $ x ], $ x, 0, $ n ] : P s [ 1, $ x, 0, $ n, s ] 1 # O [ 1 2 ] : * P s [ 1, $ x, 0, $ n, { [ 0 ] : 0, [ $ i ] : } ] 2 ( $ i! ) # I [ 1 3 ] : : P s [ f [ x ], x, 0, 5 ] x x x x # O [ 1 3 ] : * x # I [ 1 4 ] : : f _ : L d i s t ; f [ % ] x 1 3 x 3 1 x x # O [ 1 4 ] : * x

163 9.5 SMP REFERENCE MANUAL / Mathematical operations 9.5 # I [ 1 5 ] : : P s [ E x p [ x + y ], { x, y }, 0, 3 ] y y y 2 x # O [ 1 5 ] : * ( 1 + y ) + x ( 1 + y ) + x ( 1 / 2 + y / 2 ) # I [ 1 6 ] : : R a [ E x p [ x ], x, 0, { 3, 2 } ] x x x / # O [ 1 6 ] : * x 1-2 x / # I [ 1 7 ] : : P s [ %, x, 0, 5 ] x x x x # O [ 1 7 ] : * 1 + x # I [ 1 8 ] : : R a [ E x p [ x ], x, 0, { 3, 2, $ x = $ y + 1 } ] x 3 x x x / x / x # O [ 1 8 ] : * { , , } x / 3 2 x 1-2 x / # I [ 1 9 ] : : R a 9, x, I n f, 3 ] x x E x p [ x ] ( ) 3 6 # O [ 1 9 ] : * x # I [ 2 0 ] : : C f [ E x p [ x ], x, 0, 3 ] 1-1 x 1 / 2 x - 1 / 6 x # O [ 2 0 ] : * L i m [ e x p r, v a r, p t ] forms the limit of e x p r as v a r tends to p t. A sequence of P s projections of increasing order is formed until a definite limit is found. # I [ 1 ] : : t : S i n [ x ] / x S i n [ x ] # O [ 1 ] : x

164 9.5 SMP REFERENCE MANUAL / Mathematical operations 9.5 # I [ 2 ] : : L i m [ t, x, 0 ] # O [ 2 ] : 1 # I [ 3 ] : : S [ t, x - > 0 ] 0 # O [ 3 ] : - 0 # I [ 4 ] : : L i m [ ( x + 1 ) / S i n [ x ˆ 2 ], x, 0 ] # O [ 4 ] : * x + x

165 9.6 SMP REFERENCE MANUAL / Mathematical operations Matrix and explicit tensor manipulation O u t e r [ t e m p, l i s t 1, l i s t 2,...] forms the generalized outer "product" of the lists l i s t 1, l i s t 2,... with respect to the template t e m p. Ifentries in the lists t and u are specified as t [ i 1, i 2,.., i k ] and u [ j 1, j 2,.., j k ] then O u t e r [ f, t, u ] is a list whose entries are given by A p [ f, { t [ i 1, i 2,.., i k ], u [ j 1, j 2,.., j k ] } ]. # I [ 1 ] : : O u t e r [ f, { a, b }, { c, d } ] # O [ 1 ] : { { f [ a, c ], f [ a, d ] }, { f [ b, c ], f [ b, d ] } } # I [ 2 ] : : O u t e r [ f, { { 1, 2 }, { 3, 4 } }, { [ x ] : a, [ y ] : b, [ x ] : c } ] # O [ 2 ] : { { { [ x ] : f [ 1, a ], [ y ] : f [ 1, b ], [ x ] : f [ 1, c ] }, { [ x ] : f [ 2, a ], [ y ] : f [ 2, b ], [ x ] : f [ 2, c ] } }, { { [ x ] : f [ 3, a ], [ y ] : f [ 3, b ], [ x ] : f [ 3, c ] }, { [ x ] : f [ 4, a ], [ y ] : f [ 4, b ], [ x ] : f [ 4, c ] } } } # I [ 3 ] : : t : A r [ 3 ] # O [ 3 ] : { 1, 2, 3 } # I [ 4 ] : : O u t e r [ P l u s, t, t, t ] # O [ 4 ] : { { { 3, 4, 5 }, { 4, 5, 6 }, { 5, 6, 7 } }, { { 4, 5, 6 }, { 5, 6, 7 }, { 6, 7, 8 } }, { { 5, 6, 7 }, { 6, 7, 8 }, { 7, 8, 9 } } } # I [ 5 ] : : D i m [ % ] # O [ 5 ] : { 3, 3, 3 } # I [ 6 ] : : O u t e r [ G e, t, t ] # O [ 6 ] : { { 1, 0, 0 }, { 1, 1, 0 }, { 1, 1, 1 } } I n n e r [ (temp1 : M u l t ),list1, list2, (temp2 : P l u s )] forms the generalized inner "product" of l i s t 1 and l i s t 2 with respect to the templates t e m p 1, t e m p 2. D o t [8.2] # I [ 1 ] : : I n n e r [ f, { a, b }, { c, d }, g ] # O [ 1 ] : g [ f [ a, c ], f [ b, d ] ] # I [ 2 ] : : I n n e r [ f, { { a, b }, { c, d } }, { { x, y }, { z, t } }, g ] # O [ 2 ] : { { g [ f [ a, x ], f [ b, z ] ], g [ f [ a, y ], f [ b, t ] ] }, { g [ f [ c, x ], f [ d, z ] ], g [ f [ c, y ], f [ d, t ] ] } } # I [ 3 ] : : I n n e r [ f, { a, { c, d } }, { { x, y }, { z, t } } ] # O [ 3 ] : { f [ a, x ] + f [ { c, d }, z ], f [ a, y ] + f [ { c, d }, t ] } T r a n s [ l i s t, (le v s : 2 ),(te m p : E q )] yields a list obtained from l i s t by transposing entries between two levels specified by l e v s (the n i are positive integers):

166 9.6 SMP REFERENCE MANUAL / Mathematical operations 9.6 n 1 and n {n1, n 2 } n 1 a n d n 2 and applying the template t e m p to each entry of the resulting list. # I [ 1 ] : : m : { { a, b }, { c, d } } # O [ 1 ] : { { a, b }, { c, d } } # I [ 2 ] : : T r a n s [ m ] # O [ 2 ] : { { a, c }, { b, d } } # I [ 3 ] : : t : A r [ { 3, 2, 2 }, f ] # O [ 3 ] : { { { f [ 1, 1, 1 ], f [ 1, 1, 2 ] }, { f [ 1, 2, 1 ], f [ 1, 2, 2 ] } }, { { f [ 2, 1, 1 ], f [ 2, 1, 2 ] }, { f [ 2, 2, 1 ], f [ 2, 2, 2 ] } }, { { f [ 3, 1, 1 ], f [ 3, 1, 2 ] }, { f [ 3, 2, 1 ], f [ 3, 2, 2 ] } } } # I [ 4 ] : : T r a n s [ t ] # O [ 4 ] : { { { f [ 1, 1, 1 ], f [ 1, 1, 2 ] }, { f [ 2, 1, 1 ], f [ 2, 1, 2 ] }, { f [ 3, 1, 1 ], f [ 3, 1, 2 ] } }, { { f [ 1, 2, 1 ], f [ 1, 2, 2 ] }, { f [ 2, 2, 1 ], f [ 2, 2, 2 ] }, { f [ 3, 2, 1 ], f [ 3, 2, 2 ] } } } # I [ 5 ] : : T r a n s [ t, 3 ] # O [ 5 ] : { { { f [ 1, 1, 1 ], f [ 2, 1, 1 ], f [ 3, 1, 1 ] }, { f [ 1, 2, 1 ], f [ 2, 2, 1 ], f [ 3, 2, 1 ] } }, { { f [ 1, 1, 2 ], f [ 2, 1, 2 ], f [ 3, 1, 2 ] }, { f [ 1, 2, 2 ], f [ 2, 2, 2 ], f [ 3, 2, 2 ] } } } # I [ 6 ] : : T r a n s [ t, { 2, 3 } ] # O [ 6 ] : { { { f [ 1, 1, 1 ], f [ 1, 2, 1 ] }, { f [ 1, 1, 2 ], f [ 1, 2, 2 ] } }, { { f [ 2, 1, 1 ], f [ 2, 2, 1 ] }, { f [ 2, 1, 2 ], f [ 2, 2, 2 ] } }, { { f [ 3, 1, 1 ], f [ 3, 2, 1 ] }, { f [ 3, 1, 2 ], f [ 3, 2, 2 ] } } } T r [ l i s t, (te m p : P l u s )] the generalized trace obtained by applying t e m p to the set of entries in l i s t whose indices are all equal. # I [ 1 ] : : T r [ { { a, b }, { c, d } } ] # O [ 1 ] : a + d # I [ 2 ] : : T r [ { { a, b }, { c, d } }, f ] # O [ 2 ] : f [ a, d ] # I [ 3 ] : : A r [ { 2, 2, 2 }, q ] # O [ 3 ] : { { { q [ 1, 1, 1 ], q [ 1, 1, 2 ] }, { q [ 1, 2, 1 ], q [ 1, 2, 2 ] } }, { { q [ 2, 1, 1 ], q [ 2, 1, 2 ] }, { q [ 2, 2, 1 ], q [ 2, 2, 2 ] } } } # I [ 4 ] : : T r [ % ] # O [ 4 ] : q [ 1, 1, 1 ] + q [ 2, 2, 2 ]

167 9.6 SMP REFERENCE MANUAL / Mathematical operations 9.6 S i g [ l i s t, (ba s e : { 1, 2, 3,...} )] the signature of the permutation between base and list (0 if no permutation suffices). (If base is omitted, entries of l i s t may appear directly as filters for S i g ). A s y m [7.7] # I [ 1 ] : : { S i g [ 2, 1, 3 ], S i g [ { 2, 1, 3 } ], S i g [ 1, 1, 3 ], S i g [ 1, 4, 3, 2, 5 ] } # O [ 1 ] : { - 1, - 1, 0, - 1 } D e t [ l i s t ] the determinant of a "full" l i s t. # I [ 1 ] : : D e t [ { { a, b }, { c, d } } ] # O [ 1 ] : a d - b c M i n v [ l i s t ] the inverse of a non-singular matrix represented by l i s t. # I [ 1 ] : : m : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # O [ 1 ] : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # I [ 2 ] : : n : M i n v [ m ] # O [ 2 ] : { { - 3 / 6 5, 4 / 4 5, 3 1 / }, { 1 / 6 5, - 1 / 1 5, 1 1 / }, { 1 / 5, 1 / 4 5, - 2 / 4 5 } } # I [ 3 ] : : m. n # O [ 3 ] : { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } # I [ 4 ] : : M i n v [ { { 1, 1 }, { 2, 2 } } ] # O [ 4 ] : M i n v [ { { 1, 1 }, { 2, 2 } } ] M d i v [ l i s t 1, l i s t 2 ] yields a matrix m a t such that l i s t 2. m a t is equal to l i s t 1. # I [ 1 ] : : m : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # O [ 1 ] : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # I [ 2 ] : : v : { 1, 3, 1 } # O [ 2 ] : { 1, 3, 1 } # I [ 3 ] : : x : M d i v [ v, m ] # O [ 3 ] : { { 3 2 / }, { - 5 / 3 9 }, { 2 / 9 } } # I [ 4 ] : : m. x # O [ 4 ] : { { 1 }, { 3 }, { 1 } } T r i a n g [ l i s t ] gives the triangularized form of a matrix represented by l i s t.

168 9.6 SMP REFERENCE MANUAL / Mathematical operations 9.6 # I [ 1 ] : : m : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # O [ 1 ] : { { 1, 3, 5 }, { 7, - 5, 2 }, { 8, 1 1, 1 } } # I [ 2 ] : : T r i a n g [ m ] # O [ 2 ] : { { 8, 1 1, 1 }, { 0, / 8, 9 / 8 }, { 0, 0, 5 } } E i g [ l i s t ] yields a list of eigenvalues and normalized eigenvectors for the matrix l i s t. S i m t r a n [ l i s t ] yields the similarity transformation matrix necessary to place l i s t in diagonal or Jordan canonical form. # I [ 1 ] : : m : { { 2, 2, - 1 }, { 1, 3, - 1 }, { 1, 4, - 2 } } # O [ 1 ] : { { 2, 2, - 1 }, { 1, 3, - 1 }, { 1, 4, - 2 } } # I [ 2 ] : : E i g [ m ] # O [ 2 ] : { { 3, { , , } }, { 1, { , , } }, 1 / 2 1 / 2 1 / 2 1 / 2 1 / 2 1 / # I [ 3 ] : : S i m t r a n [ m ] { - 1, { , , } } } 1 / 2 1 / 2 1 / / / / # O [ 3 ] : { { , , }, { , , }, 1 / 2 1 / 2 1 / 2 1 / 2 1 / 2 1 / / / { , , } } 1 / 2 1 / 2 1 / /

169 10. Non-computational operations 10.1 Input and output operations 10.2 Graphical output 10.3 File input and output 10.4 Display operations 10.5 Textual operations 10.6 External operations 10.7 Code file input and generation 10.8 Resource management and analysis 10.9 Asynchronous and parallel operations Development aids

170 10.1 SMP REFERENCE MANUAL / Non-computational operations Input and output operations L p r [ expr, (filespec : T e r m i n a l )] prints e x p r to the file specified by fi l e s p e c [10.3] in a direct linear format suitable for use as input and in which labelling of parts is manifest [2.10]. The default fi l e s p e c is the standard input/output medium (usually the terminal). L p r yields N u l l as an image. # I [ 1 ] : : r : x # O [ 1 ] : x # I [ 2 ] : : R p t [ r : r ˆ r, 4 ] 1 + x 1 + x 1 + x + x 1 + x + x + x x # O [ 2 ] : x # I [ 3 ] : : L p r [ r ] x ˆ ( x ˆ ( 1 + x + x ˆ ( 1 + x ) + x ˆ ( 1 + x + x ˆ ( 1 + x ) ) ) ) # I [ 4 ] : : I # O [ 4 ] : * I # I [ 5 ] : : L p r [ % ] C x [ 4, 5 ] # I [ 6 ] : : L p r [ r, " r. o u t " ] # I [ 7 ] : : L p r [ r ˆ r, " r. o u t " ] The file r. o u t then contains: x ˆ ( x ˆ ( 1 + x + x ˆ ( 1 + x ) + x ˆ ( 1 + x + x ˆ ( 1 + x ) ) ) ) x ˆ ( x ˆ ( 1 + x + x ˆ ( 1 + x ) + x ˆ ( 1 + x + x ˆ ( 1 + x ) ) + x ˆ ( 1 + x + x ˆ ( 1 + x ) \ + x ˆ ( 1 + x + x ˆ ( 1 + x ) ) ) ) ) P r [ e x p r 1, (e x p r 2,...)] prints e x p r 1, e x p r 2,... inturn (separated by tabs) with standard two-dimensional format [2.12], and yields the last e x p r i as an image. P r [4] F m t [10.1] # I [ 1 ] : : P r [ a ˆ a, b ˆ b ] ; P r [ c, d, e ] ; P r [ ] ; P r [ 1, 2, 3, 4 ] a b a b c d e # O [ 1 ] : 4 P r h [ e x p r 1, (e x p r 2,...)] prints the unsimplified forms of the e x p r i.

171 10.1 SMP REFERENCE MANUAL / Non-computational operations 10.1 # I [ 1 ] : : P r h [ 1 + 1, a - 1 / b ] a - - b 1 # O [ 1 ] : a - - b # I [ 2 ] : : P r [ ] 2 # O [ 2 ] : 2 R d [ (prompt : N u l l ),(filespec : T e r m i n a l ),(eofval : N u l l )] prints the expression p r ompt, then reads and simplifies one line of input (terminated by n e wline )from the file specified by fi l e s p e c [10.3]. The default is input from the standard input/output medium (usually the terminal). R d yields the value e o f v a l if it encounters the end of the file. # I [ 1 ] : : { a, R d [ ] ˆ 2, R d [ " 3 r d > " ] } b + c 3 r d > 5 2 # O [ 1 ] : { a, ( b + c ), 5 } R d h [ (prompt : N u l l ),(filespec : T e r m i n a l ),(eofval : N u l l )] prints the expression prompt, then reads one line of input from the file filespec [10.3] and yields its "held" [3.5] form. The default is input from the standard input/output medium (usually the terminal). Rdh yields the value e o f v a l if it encounters the end of the file. # I [ 4 ] : : { R d h [ ], R d [ ] } # O [ 4 ] : { 1 + 1, 4 } F m t [ (prspec : N u l l ),expr1, expr2,...] when output prints the e x p r i in a format specified by p r s p e c : N u l l e x p r 1 followed immediately by e x p r 2,.... positive integer n e x p r 1 followed after n blank spaces by e x p r 2,.... negative integer - n e x p r 1, e x p r 2,... printed in tabular format, with tab positions every n spaces. list e x p r i appear with horizontal and vertical offsets defined by p r s p e c [ i ], according to h o r i, v e r i. e x p r i with equal horizontal or vertical offsets are aligned. Those with larger horizontal offsets are further to the right, and those with larger vertical offsets are higher up. If no entry exists in p r s p e c for a particular e x p r i,it appears immediately to the right of the last printed expression. A horizontal or vertical offset Inf specifies a position to the right or above all other expressions. P r s i z e [ e x p r ] yields a list of two elements, the number of horizontal character positions and the number of vertical character positions occupied by the printed form of e x p r.

172 10.1 SMP REFERENCE MANUAL / Non-computational operations 10.1 # I [ 1 ] : : F m t [, a, b + c, x ˆ 2 ] 2 # O [ 1 ] : a b + c x # I [ 2 ] : : F m t [ 3, a, b + c, x ˆ 2 ] 2 # O [ 2 ] : a b + c x # I [ 3 ] : : F m t [ - 9, a, b + c, x ˆ 2 ] 2 # O [ 3 ] : a b + c x # I [ 4 ] : : F m t [, " ", x + y, " " ] ˆ ( 1 / 2 ) 1 / 2 # O [ 4 ] : x + y # I [ 5 ] : : F m t [ { 3, 2, 1 }, a, b + c, x ˆ 2 ] 2 # O [ 5 ] : x b + c a # I [ 6 ] : : F m t [, a,,, 2 + 2, " ", " x ˆ 2 ", ] # O [ 6 ] : a x ˆ 2 # I [ 7 ] : : F m t [ { { 0, 1 }, { 0, - 1 } }, a, b ] # O [ 7 ] : a b # I [ 8 ] : : F m t [ { { 0, 1 }, { 0, - 1 } }, a ˆ 2 + b ˆ 2, x / y ] # O [ 8 ] : 2 2 a + b x - y # I [ 9 ] : : F m t [ { { 0, 0 }, { - 1, 2 }, { 1, - 2 } }, a + b, c, d ] c # O [ 9 ] : a + b d # I [ 1 0 ] : : F m t [ { { 0, 0 }, { 1, 1 } }, a, b, c, d ] b c d # O [ 1 0 ] : a # I [ 1 1 ] : : F m t [ { 0, { 1, 1 } }, a, b, c, d ] b c d # O [ 1 1 ] : a # I [ 1 2 ] : : F m t [ { [ $ x _ = E v e n p [ $ x ] ] : { $ x, 1 }, [ $ x ] : $ x }, a, b, c, d, e, f, g ] b d f # O [ 1 2 ] : a c e g # I [ 1 3 ] : : F m t [ { [ 1 ] : 0, [ 2 ] : I n f, [ $ x ] : { $ x - 2, 1 } }, o, o, " / ", " " " ", " " " ", " \ ", " _ " ] / " " \ _ # O [ 1 3 ] : o o

173 10.1 SMP REFERENCE MANUAL / Non-computational operations 10.1 # I [ 1 4 ] : : s i g m a : F m t [ { { 3, 2 }, { 2, 2 }, { 1, 2 }, { 1, 1 }, { 1, 0 }, { 1, - 1 }, { 2, - 1 }, { 3, - 1 } }, \ " - ", " - ", " - ", " \ ", " / ", " - ", " - ", " - " ] \ # O [ 1 4 ] : / # I [ 1 5 ] : : u n d e r l i n e [ $ e x p r ] : : F m t [ { { 0, 0 }, { 0, - 1 } }, $ e x p r, \ F m t [, R e p l [ " - ", P r s i z e [ $ e x p r ] [ 1 ] ] ] ] # O [ 1 5 ] : $ e x p r R e p l [ " - ", P r o j [ P r s i z e [ $ e x p r ], { 1 } ] ] # I [ 1 6 ] : : u n d e r l i n e [ a ˆ 4 + x / y ] + N [ 1 / 2 7 ] + u n d e r l i n e [ N [ 1 / 3 7 ] ] x 4 # O [ 1 6 ] : a y S x [ c c, { x 1, x 2,...}, (cl a s s : 1 ),(pr ec : 1 )] when output prints the x i in association with c c with a syntax and precedence defined by c l a s s and p r ec as specified in [2.11]. # I [ 1 ] : : S x [ " + + ", { a, b ˆ 2, c ˆ 3, d ˆ 4 }, 3, 2 ] # O [ 1 ] : a + + b + + c + + d # I [ 2 ] : : % [ 1 ] # O [ 2 ] : " + + " # I [ 3 ] : : x ˆ 2 / 2 + S x [ " ˆ ˆ ", { a, b }, 5, 1 ] 2 x # O [ 3 ] : a ˆ ˆ b 2 Special output forms may be defined by assigning a suitable printing format as the value of _ s [ P r ] [4].

174 10.2 SMP REFERENCE MANUAL / Non-computational operations Graphical output G r a p h [ (x1 ),y 1, (z1 ), u, (v ), u m i n, (vm i n ), u m a x, (vm a x ), f o r m 1, (xv : 0 ),(yv : 0 ),(zv : I n f ), u p t, (vp t ), ( (xm i n ),x m a x ), (ym i n ),y m a x, ( (zm i n ),z m a x ) ] generates a P l o t projection which prints as a plot of curves or surfaces defined by the numerical values of x i, y i and z i as functions of the parameters u and v,between u m i n and u m a x (with u p t samples), and v m i n and v m a x (with v p t samples). x v, y v, z v specify the point of observation for three-dimensional plots (contour plots by default). The f o r m i define the style of curves plotted: integer codes give standard curve styles; other formi are printed explicitly on the curves. Only points in the region bounded by xmin, xmax, ymin, ymax, z m i n, z m a x are plotted. # I [ 1 ] : : G r a p h [ S i n [ 1 / x ], x, , 0. 2 ] # O [ 1 ] : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0. 5 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # I [ 2 ] : : G r a p h [ G a m m a [ x ], x, - 5, 0,,,, { - 4, 4 } ] # O [ 2 ] : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * * * * * * * * * * * * * * * * * * * * * * _ - 4 _ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 2 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 4

175 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 3 ] : : G r a p h [ G a m m a [ x ], x, - 5, 0,,,, { - 2, 2 } ] # O [ 3 ] : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 1 * * * * * * * * * * * * * * * * * * * * * * * * * * * _ - 4 _ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 1 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - 2 # I [ 4 ] : : G r a p h [ { { S i n [ t ] }, { S i n [ 2 t ] } }, t, 0, 2 P i ] # O [ 4 ] : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0. 5 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0 _ 2 4 _ 6 _ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # I [ 5 ] : : G r a p h [ { S i n [ t ], S i n [ 2 t ] }, t, 0, 2 P i ] # O [ 5 ] : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 0. 5 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * _ _ 0. 5 _ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

176 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 6 ] : : G r a p h [ { { S i n [ t ] }, { S i n [ 2 t ] } }, t, 0, 2 P i, { " * ", " # " } ] # O [ 6 ] : # # # # # * * * * * * * * # # # # # * * * * # # # # # # * * * # * * # # # * * # * # # 0. 5 # # * # * * # # # * * # * # # # # * * # * * # # # * # * * # # # 0 _ 2 4 _ 6 _ # # # # # # # # # * * # * # # # * * # * * # # # # * # * * # # # * * # * # # # # * # * * # # # * * # * * * # # # # # # * * * * # # # # # * * * * * * * * # # # # # # I [ 7 ] : : G r a p h [ S i n [ x ], x, 0, 5, " # ",, 1 0 ] # O [ 7 ] : # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 0. 5 # # # # # # # # # # # # # # # # # # # # # # # # # # 0 _ 2 _ 4 # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

177 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 High-resolution graphics output is generated if a suitable device is available. # I [ 1 ] : : G r a p h [ S i n [ 1 / x ], x, , 0. 2 ]

178 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 2 ] : : G r a p h [ G a m m a [ x ], x, - 5, 0,,,, { - 4, 4 } ]

179 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 3 ] : : G r a p h [ G a m m a [ x ], x, - 5, 0,,,, { - 2, 2 } ]

180 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 4 ] : : G r a p h [ { { S i n [ t ] }, { S i n [ 2 t ] } }, t, 0, 2 P i ]

181 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 5 ] : : G r a p h [ { S i n [ t ], S i n [ 2 t ] }, t, 0, 2 P i ]

182 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 6 ] : : G r a p h [ { { S i n [ t ] }, { S i n [ 2 t ] } }, t, 0, 2 P i, { " * ", " # " } ]

183 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 7 ] : : G r a p h [ S i n [ x ], x, 0, 5, " # ",, 1 0 ]

184 10.2 SMP REFERENCE MANUAL / Non-computational operations 10.2 # I [ 8 ] : : G r a p h [ ( x ˆ 2 + u ˆ 2 ) / C o s [ 5 A t a n [ y / x ] ], { x, y }, { - 1 0, }, { 1 0, 1 0 } ]

ISIS/Draw "Quick Start"

ISIS/Draw Quick Start ISIS/Draw "Quick Start" Click to print, or click Drawing Molecules * Basic Strategy 5.1 * Drawing Structures with Template tools and template pages 5.2 * Drawing bonds and chains 5.3 * Drawing atoms 5.4

More information

MAINE ASSOCIATION OF MATH LEAGUES DEFINITIONS

MAINE ASSOCIATION OF MATH LEAGUES DEFINITIONS MAINE ASSOCIATION OF MATH LEAGUES DEFINITIONS 08-09 PLEASE NOTE THAT THERE IS AN ACCOMPANYING DOCUMENT AVAILABLE THAT DEFINES THE EXPECTATIONS FOR ALL THREE POINT PROBLEMS IN EACH CATEGORY. ABSOLUTE VALUES/INEQUALITIES:

More information

Introduction. How to use this book. Linear algebra. Mathematica. Mathematica cells

Introduction. How to use this book. Linear algebra. Mathematica. Mathematica cells Introduction How to use this book This guide is meant as a standard reference to definitions, examples, and Mathematica techniques for linear algebra. Complementary material can be found in the Help sections

More information

16.41 NCPOLY: Non commutative polynomial ideals

16.41 NCPOLY: Non commutative polynomial ideals 644 CHAPTER 16. USER CONTRIBUTED PACKAGES 16.41 NCPOLY: Non commutative polynomial ideals This package allows the user to set up automatically a consistent environment for computing in an algebra where

More information

Ratio of Polynomials Fit Many Variables

Ratio of Polynomials Fit Many Variables Chapter 376 Ratio of Polynomials Fit Many Variables Introduction This program fits a model that is the ratio of two polynomials of up to fifth order. Instead of a single independent variable, these polynomials

More information

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012

BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012 BCMB/CHEM 8190 Lab Exercise Using Maple for NMR Data Processing and Pulse Sequence Design March 2012 Introduction Maple is a powerful collection of routines to aid in the solution of mathematical problems

More information

Passing-Bablok Regression for Method Comparison

Passing-Bablok Regression for Method Comparison Chapter 313 Passing-Bablok Regression for Method Comparison Introduction Passing-Bablok regression for method comparison is a robust, nonparametric method for fitting a straight line to two-dimensional

More information

Linear Algebra: A Constructive Approach

Linear Algebra: A Constructive Approach Chapter 2 Linear Algebra: A Constructive Approach In Section 14 we sketched a geometric interpretation of the simplex method In this chapter, we describe the basis of an algebraic interpretation that allows

More information

Section-A. Short Questions

Section-A. Short Questions Section-A Short Questions Question1: Define Problem? : A Problem is defined as a cultural artifact, which is especially visible in a society s economic and industrial decision making process. Those managers

More information

Using MATLAB. Linear Algebra

Using MATLAB. Linear Algebra Using MATLAB in Linear Algebra Edward Neuman Department of Mathematics Southern Illinois University at Carbondale One of the nice features of MATLAB is its ease of computations with vectors and matrices.

More information

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1 Mathematics Foundation for College Lesson Number 1 Lesson Number 1 Page 1 Lesson Number 1 Topics to be Covered in this Lesson Sets, number systems, axioms, arithmetic operations, prime numbers and divisibility,

More information

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I Module 1.01 Basic Mathematics and Algebra Part 4 of 9 Radiological Control Technician Training Fundamental Academic Training Phase I Coordinated and Conducted for the Office of Health, Safety and Security

More information

ON SITE SYSTEMS Chemical Safety Assistant

ON SITE SYSTEMS Chemical Safety Assistant ON SITE SYSTEMS Chemical Safety Assistant CS ASSISTANT WEB USERS MANUAL On Site Systems 23 N. Gore Ave. Suite 200 St. Louis, MO 63119 Phone 314-963-9934 Fax 314-963-9281 Table of Contents INTRODUCTION

More information

Database Systems SQL. A.R. Hurson 323 CS Building

Database Systems SQL. A.R. Hurson 323 CS Building SQL A.R. Hurson 323 CS Building Structured Query Language (SQL) The SQL language has the following features as well: Embedded and Dynamic facilities to allow SQL code to be called from a host language

More information

Introduction to Language Theory and Compilation: Exercises. Session 2: Regular expressions

Introduction to Language Theory and Compilation: Exercises. Session 2: Regular expressions Introduction to Language Theory and Compilation: Exercises Session 2: Regular expressions Regular expressions (RE) Finite automata are an equivalent formalism to regular languages (for each regular language,

More information

Calculator Review. Ti-30xs Multiview Calculator. Name: Date: Session:

Calculator Review. Ti-30xs Multiview Calculator. Name: Date: Session: Calculator Review Ti-30xs Multiview Calculator Name: Date: Session: GED Express Review Calculator Review Page 2 Topics What type of Calculator do I use?... 3 What is with the non-calculator questions?...

More information

Title of the Book. A. U. Thor XYZ University

Title of the Book. A. U. Thor XYZ University Title of the Book A. U. Thor XYZ University ii Copyright c1997 by Author Preface Preface Head This is the preface and it is created using a TeX field in a paragraph by itself. When the document is loaded,

More information

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1 Bfh Ti Control F Ws 2008/2009 Lab Matlab-1 Theme: The very first steps with Matlab. Goals: After this laboratory you should be able to solve simple numerical engineering problems with Matlab. Furthermore,

More information

FPGA Resource Utilization Estimates for NI PXI-7854R. LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008

FPGA Resource Utilization Estimates for NI PXI-7854R. LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 FPGA Resource Utilization Estimates for NI PXI-7854R LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 Note: The numbers presented in this document are estimates. Actual resource usage for your

More information

Algebra Introduction to Polynomials

Algebra Introduction to Polynomials Introduction to Polynomials What is a Polynomial? A polynomial is an expression that can be written as a term or a sum of terms, each of which is the product of a scalar (the coefficient) and a series

More information

Algorithms Exam TIN093 /DIT602

Algorithms Exam TIN093 /DIT602 Algorithms Exam TIN093 /DIT602 Course: Algorithms Course code: TIN 093, TIN 092 (CTH), DIT 602 (GU) Date, time: 21st October 2017, 14:00 18:00 Building: SBM Responsible teacher: Peter Damaschke, Tel. 5405

More information

NCSS Statistical Software. Harmonic Regression. This section provides the technical details of the model that is fit by this procedure.

NCSS Statistical Software. Harmonic Regression. This section provides the technical details of the model that is fit by this procedure. Chapter 460 Introduction This program calculates the harmonic regression of a time series. That is, it fits designated harmonics (sinusoidal terms of different wavelengths) using our nonlinear regression

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

Appendix B Microsoft Office Specialist exam objectives maps

Appendix B Microsoft Office Specialist exam objectives maps B 1 Appendix B Microsoft Office Specialist exam objectives maps This appendix covers these additional topics: A Excel 2003 Specialist exam objectives with references to corresponding material in Course

More information

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I:

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I: Basic Basic NASA Langley Formal Methods Group lee.s.pike@nasa.gov June 3, 2005 Basic Sequents Basic Sequent semantics: The conjunction of the antecedents above the turnstile implies the disjunction of

More information

Induction and Recursion

Induction and Recursion . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Induction and Recursion

More information

ICM-Chemist How-To Guide. Version 3.6-1g Last Updated 12/01/2009

ICM-Chemist How-To Guide. Version 3.6-1g Last Updated 12/01/2009 ICM-Chemist How-To Guide Version 3.6-1g Last Updated 12/01/2009 ICM-Chemist HOW TO IMPORT, SKETCH AND EDIT CHEMICALS How to access the ICM Molecular Editor. 1. Click here 2. Start sketching How to sketch

More information

FIT100 Spring 01. Project 2. Astrological Toys

FIT100 Spring 01. Project 2. Astrological Toys FIT100 Spring 01 Project 2 Astrological Toys In this project you will write a series of Windows applications that look up and display astrological signs and dates. The applications that will make up the

More information

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60 MATH 213 Chapter 2: Basic Structures Dr. Eric Bancroft Fall 2013 Dr. Eric Bancroft MATH 213 Fall 2013 1 / 60 Chapter 2 - Basics Structures 2.1 - Sets 2.2 - Set Operations 2.3 - Functions 2.4 - Sequences

More information

DISCRETE RANDOM VARIABLES EXCEL LAB #3

DISCRETE RANDOM VARIABLES EXCEL LAB #3 DISCRETE RANDOM VARIABLES EXCEL LAB #3 ECON/BUSN 180: Quantitative Methods for Economics and Business Department of Economics and Business Lake Forest College Lake Forest, IL 60045 Copyright, 2011 Overview

More information

6.001 Recitation 22: Streams

6.001 Recitation 22: Streams 6.001 Recitation 22: Streams RI: Gerald Dalley, dalleyg@mit.edu, 4 May 2007 http://people.csail.mit.edu/dalleyg/6.001/sp2007/ The three chief virtues of a programmer are: Laziness, Impatience and Hubris

More information

VCell Tutorial. Building a Rule-Based Model

VCell Tutorial. Building a Rule-Based Model VCell Tutorial Building a Rule-Based Model We will demonstrate how to create a rule-based model of EGFR receptor interaction with two adapter proteins Grb2 and Shc. A Receptor-monomer reversibly binds

More information

2010 Autodesk, Inc. All rights reserved. NOT FOR DISTRIBUTION.

2010 Autodesk, Inc. All rights reserved. NOT FOR DISTRIBUTION. Wastewater Profiles 2010 Autodesk, Inc. All rights reserved. NOT FOR DISTRIBUTION. The contents of this guide were created for Autodesk Topobase 2011. The contents of this guide are not intended for other

More information

Fundamentals. Introduction. 1.1 Sets, inequalities, absolute value and properties of real numbers

Fundamentals. Introduction. 1.1 Sets, inequalities, absolute value and properties of real numbers Introduction This first chapter reviews some of the presumed knowledge for the course that is, mathematical knowledge that you must be familiar with before delving fully into the Mathematics Higher Level

More information

SuperCELL Data Programmer and ACTiSys IR Programmer User s Guide

SuperCELL Data Programmer and ACTiSys IR Programmer User s Guide SuperCELL Data Programmer and ACTiSys IR Programmer User s Guide This page is intentionally left blank. SuperCELL Data Programmer and ACTiSys IR Programmer User s Guide The ACTiSys IR Programmer and SuperCELL

More information

Planning Softproviding Meat User Documentation

Planning Softproviding Meat User Documentation Great ideas are always simple Softproviding simply makes them happen. Planning Softproviding Meat User Documentation Version: 1.00 Date: 24 August 2017 Release: v5.50 Softproviding AG Riehenring 175 CH-4058

More information

Experiment: Oscillations of a Mass on a Spring

Experiment: Oscillations of a Mass on a Spring Physics NYC F17 Objective: Theory: Experiment: Oscillations of a Mass on a Spring A: to verify Hooke s law for a spring and measure its elasticity constant. B: to check the relationship between the period

More information

NanoDrop One Viewer software NanoDrop One Website. NanoDrop One Website NanoDrop One Viewer software NanoDrop One Website Software System Update Update Update Software, Update Note OK Language Measure

More information

MiniMat: Matrix Language in OCaml LLVM

MiniMat: Matrix Language in OCaml LLVM Terence Lim - tl2735@columbia.edu August 17, 2016 Contents 1 Introduction 4 1.1 Goals........................................ 4 1.1.1 Flexible matrix notation......................... 4 1.1.2 Uncluttered................................

More information

Mixed Models No Repeated Measures

Mixed Models No Repeated Measures Chapter 221 Mixed Models No Repeated Measures Introduction This specialized Mixed Models procedure analyzes data from fixed effects, factorial designs. These designs classify subjects into one or more

More information

Computation Theory Finite Automata

Computation Theory Finite Automata Computation Theory Dept. of Computing ITT Dublin October 14, 2010 Computation Theory I 1 We would like a model that captures the general nature of computation Consider two simple problems: 2 Design a program

More information

Irrational Thoughts. Aim. Equipment. Irrational Investigation: Teacher Notes

Irrational Thoughts. Aim. Equipment. Irrational Investigation: Teacher Notes Teacher Notes 7 8 9 10 11 12 Aim Identify strategies and techniques to express irrational numbers in surd form. Equipment For this activity you will need: TI-Nspire CAS TI-Nspire CAS Investigation Student

More information

INFINITY: CARDINAL NUMBERS

INFINITY: CARDINAL NUMBERS INFINITY: CARDINAL NUMBERS BJORN POONEN 1 Some terminology of set theory N := {0, 1, 2, 3, } Z := {, 2, 1, 0, 1, 2, } Q := the set of rational numbers R := the set of real numbers C := the set of complex

More information

Lecture 3: Decidability

Lecture 3: Decidability Lecture 3: Decidability January 11, 2011 Lecture 3, Slide 1 ECS 235B, Foundations of Information and Computer Security January 11, 2011 1 Review 2 Decidability of security Mono-operational command case

More information

Thermal Stress Analysis of a Bi- Metallic Plate

Thermal Stress Analysis of a Bi- Metallic Plate WORKSHOP 10 Thermal Stress Analysis of a Bi- Metallic Plate MSC.Nastran 104 Exercise Workbook 10-1 10-2 MSC.Nastran 104 Exercise Workbook WORKSHOP 10 Thermal Stress Analysis of a Bi-Metallic Plate Model

More information

Refine & Validate. In the *.res file, be sure to add the following four commands after the UNIT instruction and before any atoms: ACTA CONF WPDB -2

Refine & Validate. In the *.res file, be sure to add the following four commands after the UNIT instruction and before any atoms: ACTA CONF WPDB -2 Refine & Validate Refinement is simply a way to improve the fit between the measured intensities and the intensities calculated from the model. The peaks in the difference map and the list of worst fitting

More information

This manual is Copyright 1997 Gary W. Oehlert and Christopher Bingham, all rights reserved.

This manual is Copyright 1997 Gary W. Oehlert and Christopher Bingham, all rights reserved. This file consists of Chapter 4 of MacAnova User s Guide by Gary W. Oehlert and Christopher Bingham, issued as Technical Report Number 617, School of Statistics, University of Minnesota, March 1997, describing

More information

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Part I: Basics MATLAB Environment Getting Help Variables Vectors, Matrices, and

More information

Algebra Review. Terrametra Resources. Lynn Patten

Algebra Review. Terrametra Resources. Lynn Patten Terrametra Resources Lynn Patten ALGEBRAIC EXPRESSION A combination of ordinary numbers, letter symbols, variables, grouping symbols and operation symbols. Numbers remain fixed in value and are referred

More information

CityGML XFM Application Template Documentation. Bentley Map V8i (SELECTseries 2)

CityGML XFM Application Template Documentation. Bentley Map V8i (SELECTseries 2) CityGML XFM Application Template Documentation Bentley Map V8i (SELECTseries 2) Table of Contents Introduction to CityGML 1 CityGML XFM Application Template 2 Requirements 2 Finding Documentation 2 To

More information

Tasks of lexer. CISC 5920: Compiler Construction Chapter 2 Lexical Analysis. Tokens and lexemes. Buffering

Tasks of lexer. CISC 5920: Compiler Construction Chapter 2 Lexical Analysis. Tokens and lexemes. Buffering Tasks of lexer CISC 5920: Compiler Construction Chapter 2 Lexical Analysis Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Copyright Arthur G. Werschulz, 2017. All

More information

Notater: INF3331. Veronika Heimsbakk December 4, Introduction 3

Notater: INF3331. Veronika Heimsbakk December 4, Introduction 3 Notater: INF3331 Veronika Heimsbakk veronahe@student.matnat.uio.no December 4, 2013 Contents 1 Introduction 3 2 Bash 3 2.1 Variables.............................. 3 2.2 Loops...............................

More information

TOPIC 2 Computer application for manipulating matrix using MATLAB

TOPIC 2 Computer application for manipulating matrix using MATLAB YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM TOPIC 2 Computer application for manipulating matrix using MATLAB Definition of Matrices in MATLAB

More information

Spis treści Contents List of Examples Preface to Third Edition 21

Spis treści Contents List of Examples Preface to Third Edition 21 An engineer's guide to MATLAB : with applications from mechanical, aerospace, electrical, civil, and biological systems engineering / Edward B. Magrab [et al.]. - 3rd ed. - Boston, cop. 2011 Spis treści

More information

Vectors. Vectors on the TI Creating, Storing, and Displaying Vectors Using Mathematical Functions with Vectors...

Vectors. Vectors on the TI Creating, Storing, and Displaying Vectors Using Mathematical Functions with Vectors... 12 Vectors Vectors on the TI-86... 168 Creating, Storing, and Displaying Vectors... 169 Using Mathematical Functions with Vectors... 176 TI -86 M1 M2 M3 M4 M5 F1 F2 F3 F4 F5 168 Chapter 12: Vectors Vectors

More information

Test 2. Monday, November 12, 2018

Test 2. Monday, November 12, 2018 Test 2 Monday, November 12, 2018 Instructions. The only aids allowed are a hand-held calculator and one cheat sheet, i.e. an 8.5 11 sheet with information written on one side in your own handwriting. No

More information

Esri UC2013. Technical Workshop.

Esri UC2013. Technical Workshop. Esri International User Conference San Diego, California Technical Workshops July 9, 2013 CAD: Introduction to using CAD Data in ArcGIS Jeff Reinhart & Phil Sanchez Agenda Overview of ArcGIS CAD Support

More information

Building Inflation Tables and CER Libraries

Building Inflation Tables and CER Libraries Building Inflation Tables and CER Libraries January 2007 Presented by James K. Johnson Tecolote Research, Inc. Copyright Tecolote Research, Inc. September 2006 Abstract Building Inflation Tables and CER

More information

Glossary. Glossary Hawkes Learning Systems. All rights reserved.

Glossary. Glossary Hawkes Learning Systems. All rights reserved. A Glossary Absolute value The distance a number is from 0 on a number line Acute angle An angle whose measure is between 0 and 90 Acute triangle A triangle in which all three angles are acute Addends The

More information

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120 Whitman-Hanson Regional High School provides all students with a high- quality education in order to develop reflective, concerned citizens and contributing members of the global community. Course Number

More information

SYMBOLIC AND NUMERICAL COMPUTING FOR CHEMICAL KINETIC REACTION SCHEMES

SYMBOLIC AND NUMERICAL COMPUTING FOR CHEMICAL KINETIC REACTION SCHEMES SYMBOLIC AND NUMERICAL COMPUTING FOR CHEMICAL KINETIC REACTION SCHEMES by Mark H. Holmes Yuklun Au J. W. Stayman Department of Mathematical Sciences Rensselaer Polytechnic Institute, Troy, NY, 12180 Abstract

More information

P.1. Real Numbers. Copyright 2011 Pearson, Inc.

P.1. Real Numbers. Copyright 2011 Pearson, Inc. P.1 Real Numbers Copyright 2011 Pearson, Inc. What you ll learn about Representing Real Numbers Order and Interval Notation Basic Properties of Algebra Integer Exponents Scientific Notation and why These

More information

Quantification of JEOL XPS Spectra from SpecSurf

Quantification of JEOL XPS Spectra from SpecSurf Quantification of JEOL XPS Spectra from SpecSurf The quantification procedure used by the JEOL SpecSurf software involves modifying the Scofield cross-sections to account for both an energy dependency

More information

Chapter 1: Foundations for Algebra

Chapter 1: Foundations for Algebra Chapter 1: Foundations for Algebra 1 Unit 1: Vocabulary 1) Natural Numbers 2) Whole Numbers 3) Integers 4) Rational Numbers 5) Irrational Numbers 6) Real Numbers 7) Terminating Decimal 8) Repeating Decimal

More information

A First Course on Kinetics and Reaction Engineering Example 1.4

A First Course on Kinetics and Reaction Engineering Example 1.4 Example 1.4 Problem Purpose This example illustrates the process of identifying reactions that are linear combinations of other reactions in a set and eliminating them until a mathematically independent

More information

Getting to the Roots of Quadratics

Getting to the Roots of Quadratics NAME BACKGROUND Graphically: The real roots of a function are the x-coordinates of the points at which the graph of the function intercepts/crosses the x-axis. For a quadratic function, whose graph is

More information

Thermo-Calc Console Mode User Guide Version 4.0

Thermo-Calc Console Mode User Guide Version 4.0 Thermo-Calc Console Mode User Guide Version 4.0 1995-2014 Foundation of Computational Thermodynamics Stockholm, Sweden Contents Thermo-Calc Console Mode User Guide 1 Introduction... 5 1.1 The Thermo-Calc

More information

Algebra I. abscissa the distance along the horizontal axis in a coordinate graph; graphs the domain.

Algebra I. abscissa the distance along the horizontal axis in a coordinate graph; graphs the domain. Algebra I abscissa the distance along the horizontal axis in a coordinate graph; graphs the domain. absolute value the numerical [value] when direction or sign is not considered. (two words) additive inverse

More information

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition

Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition Math 110 (S & E) Textbook: Calculus Early Transcendentals by James Stewart, 7 th Edition 1 Appendix A : Numbers, Inequalities, and Absolute Values Sets A set is a collection of objects with an important

More information

An Algebraic Characterization of the Halting Probability

An Algebraic Characterization of the Halting Probability CDMTCS Research Report Series An Algebraic Characterization of the Halting Probability Gregory Chaitin IBM T. J. Watson Research Center, USA CDMTCS-305 April 2007 Centre for Discrete Mathematics and Theoretical

More information

Linear Algebra and TI 89

Linear Algebra and TI 89 Linear Algebra and TI 89 Abdul Hassen and Jay Schiffman This short manual is a quick guide to the use of TI89 for Linear Algebra. We do this in two sections. In the first section, we will go over the editing

More information

FPGA Resource Utilization Estimates for NI crio LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008

FPGA Resource Utilization Estimates for NI crio LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 FPGA Resource Utilization Estimates for NI crio-9104 LabVIEW FPGA Version: 8.6 NI-RIO Version: 3.0 Date: 8/5/2008 Note: The numbers presented in this document are estimates. Actual resource usage for your

More information

Notes on Proving Arithmetic Equations

Notes on Proving Arithmetic Equations Massachusetts Institute of Technology Course Notes 1 6.844, Spring 03: Computability Theory of and with Scheme February 10 Prof. Albert Meyer revised February 25, 2003, 1300 minutes Notes on Proving Arithmetic

More information

E23: Hotel Management System Wen Yunlu Hu Xing Chen Ke Tang Haoyuan Module: EEE 101

E23: Hotel Management System Wen Yunlu Hu Xing Chen Ke Tang Haoyuan Module: EEE 101 E23: Hotel Management System Author: 1302509 Zhao Ruimin 1301478 Wen Yunlu 1302575 Hu Xing 1301911 Chen Ke 1302599 Tang Haoyuan Module: EEE 101 Lecturer: Date: Dr.Lin December/22/2014 Contents Contents

More information

Two Correlated Proportions Non- Inferiority, Superiority, and Equivalence Tests

Two Correlated Proportions Non- Inferiority, Superiority, and Equivalence Tests Chapter 59 Two Correlated Proportions on- Inferiority, Superiority, and Equivalence Tests Introduction This chapter documents three closely related procedures: non-inferiority tests, superiority (by a

More information

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

Introduction to Python for Biologists

Introduction to Python for Biologists Introduction to Python for Biologists Katerina Taškova 1 Jean-Fred Fontaine 1,2 1 Faculty of Biology, Johannes Gutenberg-Universität Mainz, Mainz, Germany 2 Genomics and Computational Biology, Kernel Press,

More information

Joy Allen. March 12, 2015

Joy Allen. March 12, 2015 LATEX Newcastle University March 12, 2015 Why use L A TEX? Extremely useful tool for writing scientific papers, presentations and PhD Thesis which are heavily laden with mathematics You get lovely pretty

More information

Topic: The Standard Format for Importing

Topic: The Standard Format for Importing Office of Online & Extended Learning Respondus Faculty Help Topic: The Standard Format for Importing Respondus will import the following question types: Multiple choice True or False Essay (long answer)

More information

Determining C-H Connectivity: ghmqc and ghmbc (VnmrJ-2.2D Version: For use with the new Software)

Determining C-H Connectivity: ghmqc and ghmbc (VnmrJ-2.2D Version: For use with the new Software) Determining C-H Connectivity: ghmqc and ghmbc (VnmrJ-2.2D Version: For use with the new Software) Heteronuclear Multiple Quantum Coherence (HMQC) and Heteronuclear Multiple Bond Coherence (HMBC) are 2-dimensional

More information

Fractional Polynomial Regression

Fractional Polynomial Regression Chapter 382 Fractional Polynomial Regression Introduction This program fits fractional polynomial models in situations in which there is one dependent (Y) variable and one independent (X) variable. It

More information

CHEMDRAW ULTRA ITEC107 - Introduction to Computing for Pharmacy. ITEC107 - Introduction to Computing for Pharmacy 1

CHEMDRAW ULTRA ITEC107 - Introduction to Computing for Pharmacy. ITEC107 - Introduction to Computing for Pharmacy 1 CHEMDRAW ULTRA 12.0 ITEC107 - Introduction to Computing for Pharmacy 1 Objectives Basic drawing skills with ChemDraw Bonds, captions, hotkeys, chains, arrows Checking and cleaning up structures Chemical

More information

Comparing whole genomes

Comparing whole genomes BioNumerics Tutorial: Comparing whole genomes 1 Aim The Chromosome Comparison window in BioNumerics has been designed for large-scale comparison of sequences of unlimited length. In this tutorial you will

More information

Module 2: Thermal Stresses in a 1D Beam Fixed at Both Ends

Module 2: Thermal Stresses in a 1D Beam Fixed at Both Ends Module 2: Thermal Stresses in a 1D Beam Fixed at Both Ends Table of Contents Problem Description 2 Theory 2 Preprocessor 3 Scalar Parameters 3 Real Constants and Material Properties 4 Geometry 6 Meshing

More information

Aside: Golden Ratio. Golden Ratio: A universal law. Golden ratio φ = lim n = 1+ b n = a n 1. a n+1 = a n + b n, a n+b n a n

Aside: Golden Ratio. Golden Ratio: A universal law. Golden ratio φ = lim n = 1+ b n = a n 1. a n+1 = a n + b n, a n+b n a n Aside: Golden Ratio Golden Ratio: A universal law. Golden ratio φ = lim n a n+b n a n = 1+ 5 2 a n+1 = a n + b n, b n = a n 1 Ruta (UIUC) CS473 1 Spring 2018 1 / 41 CS 473: Algorithms, Spring 2018 Dynamic

More information

A Brief Introduction To. GRTensor. On MAPLE Platform. A write-up for the presentation delivered on the same topic as a part of the course PHYS 601

A Brief Introduction To. GRTensor. On MAPLE Platform. A write-up for the presentation delivered on the same topic as a part of the course PHYS 601 A Brief Introduction To GRTensor On MAPLE Platform A write-up for the presentation delivered on the same topic as a part of the course PHYS 601 March 2012 BY: ARSHDEEP SINGH BHATIA arshdeepsb@gmail.com

More information

chapter 12 MORE MATRIX ALGEBRA 12.1 Systems of Linear Equations GOALS

chapter 12 MORE MATRIX ALGEBRA 12.1 Systems of Linear Equations GOALS chapter MORE MATRIX ALGEBRA GOALS In Chapter we studied matrix operations and the algebra of sets and logic. We also made note of the strong resemblance of matrix algebra to elementary algebra. The reader

More information

NMR Predictor. Introduction

NMR Predictor. Introduction NMR Predictor This manual gives a walk-through on how to use the NMR Predictor: Introduction NMR Predictor QuickHelp NMR Predictor Overview Chemical features GUI features Usage Menu system File menu Edit

More information

1 Introduction to Minitab

1 Introduction to Minitab 1 Introduction to Minitab Minitab is a statistical analysis software package. The software is freely available to all students and is downloadable through the Technology Tab at my.calpoly.edu. When you

More information

Induction and recursion. Chapter 5

Induction and recursion. Chapter 5 Induction and recursion Chapter 5 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms Mathematical Induction Section 5.1

More information

Table of content. Understanding workflow automation - Making the right choice Creating a workflow...05

Table of content. Understanding workflow automation - Making the right choice Creating a workflow...05 Marketers need to categorize their audience to maximize their r e a c h. Z o h o C a m p a i g n s a u t o m a t e s r e c i p i e n t c l a s s i fi c a t i o n a n d action performance to free up marketers

More information

Title. Syntax. Description. Options. stata.com. forecast estimates Add estimation results to a forecast model

Title. Syntax. Description. Options. stata.com. forecast estimates Add estimation results to a forecast model Title stata.com forecast estimates Add estimation results to a forecast model Syntax Description Options Remarks and examples References Also see Syntax Add estimation result currently in memory to model

More information

Prepared by Sa diyya Hendrickson. Package Summary

Prepared by Sa diyya Hendrickson. Package Summary Introduction Prepared by Sa diyya Hendrickson Name: Date: Package Summary Defining Decimal Numbers Things to Remember Adding and Subtracting Decimals Multiplying Decimals Expressing Fractions as Decimals

More information

Double Star Observations

Double Star Observations Double Star Observations Canopus now includes enhanced features for measurnig double stars. This includes easier setting of the reference position (the primary star) as well as recording the observations

More information

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence

Section Summary. Sequences. Recurrence Relations. Summations. Examples: Geometric Progression, Arithmetic Progression. Example: Fibonacci Sequence Section 2.4 Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations Introduction Sequences are ordered lists of elements.

More information

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB Applied Linear Algebra in Geoscience Using MATLAB (Linear equations) Contents Getting Started Creating Arrays Mathematical Operations with Arrays Using Script Files and Managing Data Two-Dimensional Plots

More information

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 1 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 2 Section 5.1 3 Section Summary Mathematical Induction Examples of

More information

Chapter P. Prerequisites. Slide P- 1. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Chapter P. Prerequisites. Slide P- 1. Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide P- 1 Chapter P Prerequisites 1 P.1 Real Numbers Quick Review 1. List the positive integers between -4 and 4.. List all negative integers greater than -4. 3. Use a calculator to evaluate the expression

More information

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software Practical Algebra A Step-by-step Approach Brought to you by Softmath, producers of Algebrator Software 2 Algebra e-book Table of Contents Chapter 1 Algebraic expressions 5 1 Collecting... like terms 5

More information

Supplementary Material

Supplementary Material Supplementary Material Contents 1 Keywords of GQL 2 2 The GQL grammar 3 3 THE GQL user guide 4 3.1 The environment........................................... 4 3.2 GQL projects.............................................

More information