/usr/share/axiom-20170501/src/algebra/AGG.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 | )abbrev category AGG Aggregate
++ Author: Michael Monagan; revised by Manuel Bronstein and Richard Jenks
++ Date Created: August 87 through August 88
++ Date Last Updated: April 1991
++ Description:
++ The notion of aggregate serves to model any data structure aggregate,
++ designating any collection of objects, with heterogenous or homogeneous
++ members, with a finite or infinite number of members, explicitly or
++ implicitly represented. An aggregate can in principle represent
++ everything from a string of characters to abstract sets such
++ as "the set of x satisfying relation r(x)"
++ An attribute "finiteAggregate" is used to assert that a domain
++ has a finite number of elements.
Aggregate() : Category == SIG where
SIG ==> Type with
eq? : (%,%) -> Boolean
++ eq?(u,v) tests if u and v are same objects.
copy : % -> %
++ copy(u) returns a top-level (non-recursive) copy of u.
++ Note that for collections, \axiom{copy(u) == [x for x in u]}.
empty : () -> %
++ empty()$D creates an aggregate of type D with 0 elements.
++ Note that The $D can be dropped if understood by context,
++ for example \axiom{u: D := empty()}.
empty? : % -> Boolean
++ empty?(u) tests if u has 0 elements.
less? : (%,NonNegativeInteger) -> Boolean
++ less?(u,n) tests if u has less than n elements.
more? : (%,NonNegativeInteger) -> Boolean
++ more?(u,n) tests if u has greater than n elements.
size? : (%,NonNegativeInteger) -> Boolean
++ size?(u,n) tests if u has exactly n elements.
sample : constant -> %
++ sample yields a value of type %
if % has finiteAggregate then
"#" : % -> NonNegativeInteger
++ # u returns the number of items in u.
add
eq?(a,b) == EQ(a,b)$Lisp
sample() == empty()
if % has finiteAggregate then
empty? a == #a = 0
less?(a,n) == #a < n
more?(a,n) == #a > n
size?(a,n) == #a = n
|