/usr/share/axiom-20170501/src/algebra/FLAGG.spad is in axiom-source 20170501-3.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | )abbrev category FLAGG FiniteLinearAggregate
++ Author: Michael Monagan; revised by Manuel Bronstein and Richard Jenks
++ Date Created: August 87 through August 88
++ Date Last Updated: April 1991
++ Description:
++ A finite linear aggregate is a linear aggregate of finite length.
++ The finite property of the aggregate adds several exports to the
++ list of exports from \spadtype{LinearAggregate} such as
++ \spadfun{reverse}, \spadfun{sort}, and so on.
FiniteLinearAggregate(S) : Category == SIG where
S : Type
SIG ==> LinearAggregate S with
finiteAggregate
merge : ((S,S)->Boolean,%,%) -> %
++ merge(p,a,b) returns an aggregate c which merges \axiom{a} and b.
++ The result is produced by examining each element x of \axiom{a}
++ and y of b successively. If \axiom{p(x,y)} is true, then x is
++ inserted into the result; otherwise y is inserted. If x is
++ chosen, the next element of \axiom{a} is examined, and so on.
++ When all the elements of one aggregate are examined, the
++ remaining elements of the other are appended.
++ For example, \axiom{merge(<,[1,3],[2,7,5])} returns
++ \axiom{[1,2,3,7,5]}.
reverse : % -> %
++ reverse(a) returns a copy of \axiom{a} with elements
++ in reverse order.
sort : ((S,S)->Boolean,%) -> %
++ sort(p,a) returns a copy of \axiom{a} sorted using total ordering
++ predicate p.
sorted? : ((S,S)->Boolean,%) -> Boolean
++ sorted?(p,a) tests if \axiom{a} is sorted according to predicate p.
position : (S->Boolean, %) -> Integer
++ position(p,a) returns the index i of the first x in \axiom{a}
++ such that \axiom{p(x)} is true, and \axiom{minIndex(a) - 1}
++ if there is no such x.
if S has SetCategory then
position : (S, %) -> Integer
++ position(x,a) returns the index i of the first occurrence of
++ x in a, and \axiom{minIndex(a) - 1} if there is no such x.
position : (S,%,Integer) -> Integer
++ position(x,a,n) returns the index i of the first occurrence of
++ x in \axiom{a} where \axiom{i >= n}, and \axiom{minIndex(a) - 1}
++ if no such x is found.
if S has OrderedSet then
OrderedSet
merge : (%,%) -> %
++ merge(u,v) merges u and v in ascending order.
++ Note that \axiom{merge(u,v) = merge(<=,u,v)}.
sort : % -> %
++ sort(u) returns an u with elements in ascending order.
++ Note that \axiom{sort(u) = sort(<=,u)}.
sorted? : % -> Boolean
++ sorted?(u) tests if the elements of u are in ascending order.
if % has shallowlyMutable then
copyInto_! : (%,%,Integer) -> %
++ copyInto!(u,v,i) returns aggregate u containing a copy of
++ v inserted at element i.
reverse_! : % -> %
++ reverse!(u) returns u with its elements in reverse order.
sort_! : ((S,S)->Boolean,%) -> %
++ sort!(p,u) returns u with its elements ordered by p.
if S has OrderedSet then
sort_! : % -> %
++ sort!(u) returns u with its elements in ascending order.
add
if S has SetCategory then
position(x:S, t:%) == position(x, t, minIndex t)
if S has OrderedSet then
sorted? l == sorted?((x,y) +-> x < y or x = y, l)
merge(x, y) == merge(_<$S, x, y)
sort l == sort(_<$S, l)
if % has shallowlyMutable then
reverse x == reverse_! copy x
sort(f, l) == sort_!(f, copy l)
if S has OrderedSet then
sort_! l == sort_!(_<$S, l)
|