list2
http://www.openmath.org/cd
http://www.openmath.org/cd/list2.ocd
2006-03-30
2004-03-30
4
1
experimental
Several basic list functions are given in this CD.
list_selector
application
This symbol takes a positive integer n and a list, and represents the n-th
element of that list.
2
1
1
first
application
This symbol represents a function which returns the first elements of
its argument, which should be a list.
Specification of the first element of the list [1,2,3]
1
2
3
rest
application
This symbol represents a function which returns a list made up of all
the elements except the first of its argument, which should be a list.
Specification of the list [1,2,3], apart from the first element
1
2
3
cons
application
This symbol represents the cons list function. It takes 2 arguments:
the second must be a list, where the elements have the same type as
the type of the first. The function denotes a new list which has
the first argument as its first element followed by the elements of
the second argument.
cons(first(lst),rest(lst))=lst
nil
constant
The empty list
append
application
The operation of joining one list to another
reverse
application
The reverse of a list
size
application
This symbol is used to denote the number of elements in a list. It is
either a non-negative integer.
The size of the list (3,6,9) = 3
3
6
9
3
in
application
This symbol has two arguments, an element and a list. It is used to
denote that the element is in the given list.