/usr/lib/open-axiom/input/algaggr.input is in open-axiom-test 1.4.1+svn~2626-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | --Copyright The Numerical Algorithms Group Limited 1991.
)clear all
-- lists are constructed explicitly by using square brackets
l := [1,4,2,-6,0,3,5,4,2,3]
-- "listify" an element by using the "list" function
m := list 555555
-- use "concat" to add an item to the front of a list
concat(5,l)
-- "concat" concatenates 2 lists
concat(m,l)
-- to remove all duplicates, issue
removeDuplicates l
-- use "first" to get the first element, and "rest" to get the
-- list of remaining elements
first l
rest l
-- "last" extracts the last element
last l
-- to find the number of elements, use "#"
#l
-- "first" and "rest" extract or remove leading or trailing
-- parts of the list
l
first(l,3)
rest(l,3)
-- individual elements may be extracted as follows
-- notice that list indexing goes from 1 to the size of the list
l.1
l.2
l.(#l)
-- individual elements may be set (destructively) in a similar manner
l.1 := 1000000000
l
-- "insert" is used to add an element to a specific position in the list
insert(10,l,4)
insert(2,l,1)
-- "position" determines the first index of an element in a list
-- if the element is not in the list, 0 is returned.
position(-6,l)
-- to reverse a list
reverse l
-- the following functions demonstrate some functions on sets
l
m := [4,2,3,6,5,7,-9,1,2,3,2]
sl:SET(INT) := brace l
sm:SET(INT) := brace m
difference(sl, sm)
intersect(sl,sm)
union(sl,sm)
|