Maple "Sets" and "Lists" notation ( based on Maple response to "?sets" )

Sets and Lists

Calling Sequence:

     {es}

     [es]

Parameters:

     es - an expression sequence

Description:

·        A set is an unordered sequence of distinct expressions enclosed in braces, representing a set in the mathematical sense. The user should not assume that the expressions will be maintained in any particular order because Maple uses an ordering convenient for its implementation.

·        A list is an ordered sequence of expressions enclosed in square brackets. The ordering of the expressions is the ordering of es.

·        Note that es may be empty so that the empty set is represented by {} and the empty list is represented by [].

·        The elements of a set or list may be extracted via the selection operation. Thus, if S is a set or list then the ith to jth elements of S can be obtained by: S[i..j] or equivalently, op(i..j,S). Negative selectors can also be used. The -1th element is the last, the -2th the second last, and so on.

·        Lists and sets can be nested, in which case selection can be done in one of two ways: S[i][j]..[n] or S[i,j,..n].

·        Appending an element x to a list L is done by [op(L),x]. Inserting an element x to a set S is done using the union operator S union {x}.

·        Replacing the i-th element of a list L by x can be done by subsop(i=x,L). Deleting the i-th element of a list L is subsop(i=NULL,L). Deleting an element x from a set S is done using the minus operator S minus {x}.

Examples:

> {x,y,y};

> {y,x,y};

> [x,y,y];

> [y,x,y];

> L := [seq(x[i],i=1..4)];

> L[2];

> L := [op(L),x[5]];

> L[-3..-2];

> L := subsop(2=NULL,L);

> L := [1,[2,3],[4,[5,6],7],8,9];

> L[3,2,1];

> L[3][2][1];

See Also:

type[set], type[list], selection, op, nops, union, intersect, minus, member, convert, seq 


 
back

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu