list3 http://www.openmath.org/cd/list3.ocd 2004-11-01 2004-03-02 1 1 experimental quant1 relation1 list1 Several basic list functions related to length are given in this CD. Initiated by Arjeh M. Cohen 2004-03-02 length This symbol represents a function whose argument should be a list. It returns the length of its argument. The length of the list [1,2,3] is 3. 1 2 3 3 list_of_lengthn This symbol represents a function with two arguments, the first of which is a natural number and the second of which is a list. The first argument is the length of the list. A list L of length 3: 3 entry This symbol represents a binary function whose first argument should be a list L and whose second argument should be a positive integer i such that the absolute value of i is in the interval [1..n], where n is the length of L. If i is positive, it returns the i-th entry L[i] of L, if i is negative it returns the (n+1-i)-th entry of L. The second entry of the list [1,2,3] is 2. 1 2 3 2 2 Specification of the second element of the list [1,..,6] counted from the end. 1 2 3 4 5 6 -2 5 difference This symbol takes two arguments both a list. It represents a function which returns a list made up of all the elements of the first list which are not in the second. Specification of the list [1,..,6], apart from the first 3 elements. 1 2 3 4 5 6 1 2 3 4 5 6 select This symbol takes two lists as arguments, L and M say. The second argument is a list containing only entries from [1..n], where n is the length of L. The symbol represents the function which returns a list whose length is equal to the length of M, and having at position k the value of L at position M_k. 4 5 6 7 8 9 3 5 2 2 6 8 5 5