Previous Home Contents Next

Chapter 25: The base library categories

25.1 Abelian Group

25.2 AbelianMonoid

25.3 Aggregate S

25.4 ArithmeticSystem

25.5 ArrayCategory S

25.6 BasicType

25.7 Condition

25.8 ElementaryFunctions

25.9 EuclideanDomain

25.10 Field

25.11 Finite

25.12 FiniteAggregate S

25.13 FiniteField

25.14 FiniteLinearAggregate S

25.15 FloatingPointNumberSystem

25.16 Group

25.17 IntegerNumberSystem

25.18 LinearAggregate S

25.19 ListCategory S

25.20 Logic

25.21 Monoid

25.22 Order

25.23 OrderedAbelianGroup

25.24 OrderedAbelianMonoid

25.25 OrderedFinite

25.26 OrderedRing

25.27 Ring

25.28 Steppable

A number of types are provided by a ``Base Aldor Library'', supplied with the compiler for Aldor. Their definitions can be made accessible to a program by the system command #include "aldor".

This chapter describes the categories defined in the base library, and the next chapter describes the domains. We have made a number of choices to try to make certain specific information readily accessible while minimizing redundancy. The full set of exports is listed both for categories and domains. This makes it easy to see at a glance what operations a type provides. The detailed descriptions of the operations, however, are not repeated in each type to which they are inherited. For that information, it is necessary to follow the reference to the place where the export is originally defined.

As an example, consider the category FiniteLinearAggregate S, in which the empty? operation has the entry:

empty?% -> Boolean[default] from Aggregate(S)

The notation ``from Aggregate(S)'' means that empty? has its original declaration in that inherited category. To see a description of what empty? does, you should turn to the section for Aggregate S.

The notation ``[default]'' means that empty? has a default definition. This may be supplied either by the category itself or by one of the categories from which it inherits. In this case, the default definition is inherited from FiniteAggregate S.

The default information is given for categories only, since it is a private matter whether a domain supplies an export directly, or via its category's defaults.

Some values supplied by the base library have publicly visible definitions, that is, they are given values with define ... == .... When this is the case, the entire definition is shown in the corresponding section.


25.1 : AbelianGroup

Descriptions
`AbelianGroup' provides additive arithmetic with subtraction.

Exports:
  • 0: %
    Identity for addition.
  • +: % -> %
    Identity function
  • [default]
  • +: (%, %) -> %
    Addition
  • zero?: % -> Boolean
    Test whether value equals 0.
  • [default]
  • -: % -> %
    Negation.
  • -: (%,%) -> %
    Subtraction.
  • [default]
  • =: (%, %) -> Boolean
  • from BasitType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • [default] from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.2 : AbelianMonoid

    Description:
    `AbelianMonoid' provides additive arithmetic.

    Derectly inherits:
    BasicType

    Exports:
  • 0: %
    Identity for addition
  • +: % -> %
    Identity function.
  • [default]
  • +: (%, %) -> %
    Addition.
  • zero?: %->Boolean
    Test whether value equals 0.
  • [default]
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default]from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> textWriter
  • [default]BasitType
  • sample: %
  • [default]from BasicType
  • hash: % -> SingleInteger
  • [default from BasicType

    Definition:

    25.3 : Aggregate S

    Description:
    `Aggregate(S)' provides opterations for manipulating structures representing collections of values of type 'S'.

    Parameter:

  • S: Type

    Directly inherits:
    BasicType

    Exports:
  • empty?: % -> Boolean
    Is the element count zero?
  • generator: % 0> Generator(S)
    Generic traversal of an aggregate.
  • map: (S -> S, %) -> %
    Form new aggregate using function.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%,%) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.4 : ArithmeticSystem

    Description:
    `ArithmeticSystem' provides the basic aritmetic operations, without implying associativity, commutativity, etc.

    Directly inherits:
    (none)

    Exports::
  • 0: %
    Indentiyt for `+'.
  • +: % -> %
    Identity function.
  • +: (%, %) -> %
    Addition.
  • -: % -> %
    Negation.
  • -: (%, %) -> % Substraction.
  • 1: %
    Identity for `*'
  • *: (%, %) -> %
    Multiplication
  • ^: (%, Integer) -> %
  • coerce: Integer -> %;
  • coerce: SingleInteger -> %

  • Definition:


    25.5 : ArrayCategory S

    Parameter:

  • S: Type

    Directly inherits:
    FiniteLinearAggregate(S)

    Exports:
  • set!: (%, SingleInteger, S) -> S
    `set!(a,n,s)' sets the nth element of `a' to `s'.
  • dispose!: % -> ()
    `dispose!(a)' indicates that `a' will no longer be used.
  • Definition:


    25.6 : BasicType

    Directly inherits:
    (none)

    Exports:
  • =: (%, %) -> Boolean
  • ~=: (%, %) -> Boolean
    Equality and inequality test.
  • [default]
  • <<: (TextWriter, %) -> TextWriter
  • <<: % 0> TextWriter -> TextWriter
    Basic output.
  • [default]
  • sample: %
    Example element.
  • hash: % -> SingleInteger
    Hashing function.
  • [default]

    Definition:


    25.7 : Conditional

    Description:
    `Conditional' allows values to be used in conditional context, such as in an `if' or in a `while'.

    Directly inherits:
    BasitType

    Exports:
  • test: % -> Boolean
    Test used in conditional context.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.8 : ElementaryFunctions

    Description:
    `ElementaryFunctions' provides the basic trigonometric and exponential function and their inverses.

    Directly inherits:
    (none)

    Exports:
  • ^: (%, %) -> %
    General exponentiation.
  • exp: % -> %
    Exponential of `e'.
  • log: % -> %
    Natural logarithm.
  • log10: % -> %
    Logarithm base 10.
  • sin, cos, tan: % -> %
    Circular trigonometric sine, cosine, tangent.
  • sinh, cosh, tanh: % -> %
    Hyperbolic trigonometric sine, cosine, tangent.
  • asin, acos, atan: % -> %
    Functional inverse of `sin', `cos', `tan'.
  • asinh, acosh, atanh: % -> %
    functional inverse of `sinh', `cosh', `tanh'.
  • sqrt: % -> %
    Square root.
  • root: (%, SingleInteger) -> %
    General surd.
  • Definition:


    25.9 : EuclideanDomain

    Description:
    `ElementaryFunctions' provides the basic trigonometric and exponential

    Directly inherits:
    Ring

    Exports:
  • 0: %
  • from ArithmeticSystem
  • 1: %
  • from ArithmeticSystem
  • +: % -> %
  • [default]from ArithmeticSystem
  • +: (%, %) -> %
  • from ArithmeticSystem
  • -: % -> %
  • from ArithmeticSystem
  • -: (%, %) -> %
  • [default] from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • gcd: (%, %) -> %
    Greatest common divisor.
  • quo: (%, %) -> %
    Quotient leaving remainder.
  • rem: (%, %) -> %
    Remainder.
  • divide: (%, %) -> (%, %)
    Quotient-remainder pair.
  • [default]
  • sample: %
  • [default] from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.10 : Field

    Description:
    `Field' prvides arithmetic with division.

    Directly inherits:
    EuclideanDomain, Group

    Exports:
  • /: (%, %) -> %
    Division: a / b = a * inv(b).
  • [default]
  • \: (%, %) -> %
    Division: a \ b = inv(a) * b.
  • [default]
  • inv: % -> %
    Inverse.
  • 0: %
  • from ArithmeticSystem
  • 1: %
  • from ArithmeticSystem
  • +: % -> %
  • [default]from ArithmeticSystem
  • +: (%, %) -> %
  • from ArithmeticSystem
  • -: % -> %
  • from ArithmeticSystem
  • -: (%, %) -> %
  • [default] from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • gcd: (%, %) -> %
  • [default] from EuclideanDomain
  • quo: (%, %) -> %
  • [default] from EuclideanDomain
  • rem: (%, %) -> %
  • [default] from EuclideanDomain
  • divide: (%, %) -> (%, %)
  • [default] from EuclideanDomain
  • sample: %
  • [default] from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.11 : Finite

    Description:
    `Finite' indicates that a type has only a finite number of values

    Directly inherits:
    BasicType

    Exports:
  • #: Integer
    Number of values in the type.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definitoin:


    25.12 : FiniteAggregateS

    Description:
    `FiniteAggregate(S)' provides operations for manipulating structures representing finite collections of values of type `S'.

    Parameter:

  • S: Type

    Directly inherits:
    Aggregate(S)

    Exports:
  • #: % -> SingleInteger
    Count of the number of elements.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • empty?: % -> Boolean
  • [default] from Aggregate(S)
  • generator: % -> Generator(S)
  • from Aggregate(S)
  • map: (S -> S, %) -> %
  • from Aggregate(S)

    Definition:


    25.13 : FiniteField

    Description:
    `FiniteField provides arithmetic on a finite set.

    Directly inherits:
    Finite, Field

    Exports:
  • integer: Literal -> %
  • reduce: SingleInteger -> %
  • lift: % -> SingleInteger
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • [default] from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • #: Integer
  • from Finite
  • 0: %
  • from ArithmeticSystem
  • +: % -> %
  • [default] from ArithmeticSystem
  • +: (%, %) -> %
  • from ArithmeticSystem
  • -: % -> %
  • from ArithmeticSystem
  • -: (%, %) -> %
  • [default] from ArithmeticSystem
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • gcd: (%, %) -> %
  • [default] from EuclideanDomain
  • quo: (%, %) -> %
  • [default] from EuclideanDomain
  • rem: (%, %) -> %
  • [default] from EuclideanDomain
  • divide: (%, %) -> %
  • [default] from EuclideanDomain
  • /: (%, %) -> %
  • [default] from Group
  • \: (%, %) -> %
  • [default] from Group
  • inv: % -> %
  • from Group

    Definition:


    25.14 : FiniteLinearAggregate S

    Description:
    `FiniteLinearAggregate(S)' provides operations for manipulating structures representing finite linear collections of values of type `S'.

    Parameter:

  • S: Type

    Direclty inherits:
    FiniteAggregate(S), Linear Aggregate(S)

    Exports:
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • empty?: % -> Boolean
  • [default] from Aggregate(S)
  • generator: % -> Generator(S)
  • from Aggregate(S)
  • map: (S -> S, %) -> %
  • from Aggregate(S)
  • #: % -> SingleInteger
  • from FiniteAggregate(S)
  • empty: () -> %
  • [default] from LinearAggregate(S)
  • bracket: Generator(S) -> %
  • LinearAggregate(S)
  • bracket: Tuple(S) -> %
  • LinearAggregate(S)
  • map: ((S, S) -> S, %, %) -> %
  • [default] LinearAggregate(S)
  • apply: (%, SingleInteger) -> S
  • LinearAggregate(S)

    Definition:


    25.15 : FloatingPointNumberSystem

    Description:
    `FloatingPointNumberSystem' provides the basic operations for a type which approximates the real n8umbers as a floating point system.

    Directly inherits:
    OrderedRing, Field

    Exports:
  • float: Literal -> %
    Floating point-style literals.
  • <<: (%, %) -> Boolean
    Insignificance: a << b => a + b = b
  • >>: (%, %) -> Boolean
    Dominance: a >> b => a + b = a
  • step: SingleInteger -> (%, %) -> Generator(%)
    `step(n)(a,b)' yields `n' evenly separated values on `a, b'
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • -: % -> %
  • from AbelianGroup
  • -: (%, %) -> %
  • [default] from AbelianGroup
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • abs: % -> %
  • [default] from OrderedRing
  • sign: % -> %
  • [default] from OrderedRing
  • negative?: -> Boolean
  • [default] from OrderedRing
  • positive?: % -> Boolean
  • [default] from OrderedRing
  • gcd: (%, %) -> %
  • [default] from EuclideanDomain
  • quo: (%, %) -> %
  • [default] from EuclideanDomain
  • rem: (%, %) -> %
  • [default] from EuclideanDomain
  • divide: (%, %) -> (%, %)
  • [default] from EuclideanDomain
  • /: (%, %) -> %
  • [default] from Group
  • \: (%, %) -> %
  • [default] from Group
  • inv: % -> %
  • from Group

    Definition:


    25.16 : Group

    Description:
    `Group' provides multiplicative arithmetic with division.

    Directly inherits:
    Monoid

    Exports:
  • /: (%, %) -> %
    Division: a / b = a*inv(b).
  • [default]
  • \: (%, %) -> %
    Division: a \ b = inv(a)*b.
  • [default]
  • inv: % -> %
    Inverse.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • 1: %
  • from Monoid
  • *: (%, %) -> %
  • from monoid
  • ^: (%, Integer) -> %
  • from Monoid

    Definition:


    25.17 : IntegerNumberSystem

    Description:
    `IntegerNumberSystem' provides the basic operations for a type which represents a range of integers.

    Directly inherits:
    OrderedRing, EuclideanDomain

    Exports:
  • integer: Literal -> %
    Integer-style literals.
  • even?: % -> Boolean
  • odd?: % -> Boolean
    Tests whether the value is even or odd.
  • single?: % -> Boolean
    `single?(v) returns true if a SingleInteger can hold the value `v'.
  • prev: % -> %
  • next: % -> %
    Decrement/increment the value by 1.
  • mod: (%, %) -> %
    Modulus.
  • length: % -> SingleInteger -> %
    Length in bits.
  • shift: (%, SingleInteger) -> %
    Shift by the a number of bits.
  • bit: (%, SingleInteger) -> Boolean
    Extract the desired bit.
  • retract: % -> SingleInteger
    Covert to SingleInteger, if can.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • -: % -> %
  • from AbelianGroup
  • -: (%, %) -> %
  • [default] from AbelianGroup
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • abs: % -> %
  • [default] from OrderedRing
  • sign: % -> %
  • [default] from OrderedRing
  • negative?: -> Boolean
  • [default] from OrderedRing
  • positive?: % -> Boolean
  • [default] from OrderedRing
  • gcd: (%, %) -> %
  • [default] from EuclideanDomain
  • quo: (%, %) -> %
  • [default] from EuclideanDomain
  • rem: (%, %) -> %
  • [default] from EuclideanDomain
  • divide: (%, %) -> (%, %)
  • [default] from EuclideanDomain

    Definition:


    25.18 : LinearAggregate S

    Description:
    `LinearAggregate(S)' provides operations for manipulating structures representing linear collections of values of type `S'.

    Parameter:

  • S: Type

    Directly inherits:
    Aggregate(S)

    Exports: from BasicType
  • empty: () -> %
    Construction with no values.
  • [default]
  • bracket: Generator(S) -> %
    Construction from a generator.
  • bracket: Tuple(S) -> %
    Construction from a tuple.
  • map: ((S, S) -> S, %, %) -> %
    Element-wise combination.
  • [default]
  • apply: (%, SingleInteger) -> S
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • hash: % -> SingleInteger
  • [default] from BasicType
  • empty?: % -> Boolean
  • from Aggregate(S)
  • generator: % -> Generator(S)
  • from Aggregate(S)
  • map: (S -> S, %) -> %
  • [default]from Aggregate(S)

    Definition:


    25.19 : ListCategory S

    Description:
    `ListCategory' provides the basic operations for linked lists.

    Parameter:

  • S: Type

    Directly inherits:
    FiniteLinearAggregate(S), Conditional

    Exports:
  • nil: %
    nil is a literal constant that is an empty list.
  • cons: (S, %) -> %
    `cons(s,k)' appends `s' to the front of the list `k'.
  • list: Tuple(S) -> %
  • list: Generator(S) -> %
    Generates a list from a tuple or a generator of `S'.
  • first: % -> S
  • rest: % -> %
    `first(k)' returns the first element of the list `k'. `rest(k)' returns the list consisting of all elements of k after the first.
  • setFirst!: (%, S) -> S
  • setRest!: (%, %) -> %
    `setFirst!(k, s)' destructively modifies the list `k' so that the first element is `s'. `setRest!(k1, k2) destructively modifies the list `k1' so that rest(k1) = k2.
  • apply: (%, 'first') -> S
  • apply: (%, 'rest') -> %
    `l.first' is equivalent to `first(l)'. `l.rest' is equivalent to `rest(l)'.
  • set!: (%, 'first', S) -> S
  • set!: (%, 'rest', %) -> %
    `l.first := v' is equivalent to `setFirst!(l,v)'. `l.rest := t' is equivalent to `setRest!(l, v, t)'.
  • copy: % -> %
    `copy(k)' returns a copy of the list `k'.
  • last: % -> S
    `last(k)' returns the last element of the list `k'.
  • reverse: % -> %
  • reverse!: % -> %
    `reverse(k)' non-destructively reverses the elements of `k'. `reverse!(k)' destructively reverses the elements of k.
  • concat: (%, %) -> %
  • concat!: (%, %) -> %
    `concat(k1,k2)' returns a new list that contains the elements of `k1' appended to the front of`k2'. `concat!(k1,k2)' destructively (to `k1') appends `k1' to the front of `k2'.
  • reduce: ((S, S) -> S, %, S) -> S
    `reduce(fun,k,s)' computes `r1 = fun(first k, s)', then `r2 = (fun first rest k, r1)' and so, returning the final value computed.
  • member?: (S, %) -> Boolean
    `member?(s,k)' returns true if `s' is contained in `k', false otherwise.
  • rest: (%, SingleInteger) -> %
    `rest(k,i)' drops the first `i' elements from `k'.
  • tails: % -> Generator(%)
    `tails(k)' returns the successive tails of `k'. Clients are allowed to call setFirst! and setRest! on the generated values.
  • dispose!: % -> ()
  • disposeHead!: % -> %
    `dispose!(1)' indicates the list `l' will no longer be used.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • empty?: % -> Boolean
  • from Aggregate(S)
  • generator: % -> Generator(S)
  • from Aggregate(S)
  • map: (S -> S, %) -> %
  • [default]from Aggregate(S)
  • #: % -> SingleInteger
  • from FiniteAggregate(S)
  • empty: () -> %
  • [default] from LinearAggregate(S)
  • bracket: Generator(S) -> %
  • from LinearAggregate(S)
  • bracket: Tuple(S) -> %
  • from LinearAggregate(S)
  • map: ((S, S) -> S, %, %) -> %
  • [default] from LinearAggregate(S)
  • apply: (%, SingleInteger) -> S
  • from LinearAggregate(S)
  • test: % -> Boolean
  • from Conditional

    Definition:


    25.20 : Logic

    Description:
    `Logic' provides the basic operations for lattices, e.g. Booleal algebra.

    Directly inherits:
    BasicType

    Exports:
  • ~: % -> %
    Logical complement
  • /\: (%, %) -> %
    Locical `meet', e.g. `and'
  • \/: (%, %) -> %
    Logical `join', e.g. `or'.
  • [default]
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType

    Definition:


    25.21 : Monoid

    Description:
    `Monoid' provides multiplicative arithmetic.

    Directly inherits:
    BasicType

    Exports:
  • 1: %
    Identity for multiplication.
  • *: (%, %) -> %
    Multiplication.
  • ^: (%, Integer) -> %
    Exponentiation or error.
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> TextWriter
  • from BasicType

    Definition:


    25.22 : Order

    Description:
    `Order' provides operations for an order relation, `>', and its dual, `<'.

    Direclty inherits:
    BasicType

    Exports:
  • >: (%, %) -> Boolean
  • <: (%, %) -> Boolean
  • [default]
  • >=: (%, %) -> Boolean
  • [default]
  • <=: (%, %) -> Boolean
  • [default]
  • max: (%, %) -> %
  • [default]
  • min: (%, %) -> %
    Maximum and minimu argument.
  • [default]
  • >: (%, %) -> Cross(Boolean, %)
    Greater than test.
  • [default]
  • <: (%, %) -> Cross(Boolean, %)
    Less tahn test.
  • [default]
  • >=: (%, %) -> Cross(Boolean, %)
    Greater tahn or equal test.
  • [default]
  • <=: (%, %) -> Cross(Boolean, %)
    Less than or equal test.
  • [default]
  • >: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default]
  • <: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default]
  • >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default]
  • <=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default]
  • >: (Cross(Boolean, %), %) -> Boolean
  • [default]
  • <: (Cross(Boolean, %), %) -> Boolean
  • [default]
  • >=: (Cross(Boolean, %), %) -> Boolean
  • [default]
  • <=: (Cross(Boolean, %), %) -> Boolean
  • [default]
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> TextWriter
  • from BasicType

    Definition:


    25.23 : OrderedAbelianGroup

    Description:
    `OrderedAbelianGroup' provides group operations consitent with an order.

    Directly inherits:
    OrderedAbelianMonoid, AbelianGroup

    Exports:
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> TextWriter
  • from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • -: % -> %
  • from AbelianGroup
  • -: (%, %) -> %
  • [default] from AbelianGroup

    Definition:


    25.24 : OrderedAbelianMonoid

    Description:
    `OrderedAbelianMonoid' provides an addition consitent with an order.

    Directly inherits:
    Order, AbelianMonoid

    Exports:
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> TextWriter
  • from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid

    Definition:


    25.25 : OrderedFinite

    Description:
    `OrderedFinite' provides the minimum and maximum valoues for a finite type.

    Directly inherits:
    Finite, Order

    Exports:
  • min: %
  • max: %
    Minimum and maximum value belonging to the type
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> TextWriter
  • from BasicType
  • #: Integer
  • from Finite
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order

    Definition:


    25.26 : OrderedRing

    Description:
    `OrderedRing' provides arithmetic consitent with an ordering.

    Directly inherits:
    OrderedAbelianGroup, Ring

    Exports:
  • abs: % -> %
    Absolute value.
  • [default]
  • sign: % -> %
    -1, 0 or 1.
  • [default]
  • negative?: % -> Boolean
    Test whether value is negative.
  • [default]
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • -: % -> %
  • from AbelianGroup
  • -: (%, %) -> %
  • [default] from AbelianGroup
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem

    Definition:


    25.27 : Ring

    Description:
    `Ring' provides the basic arithmetic operations of addition, subtraction and multiplication.

    Directly inherits:
    Arithmeticsystem, Monoid, AbelianGroup

    Exports:
  • 0: %
  • from ArithmeticSystem
  • +: % -> %
  • [default] from ArithmeticSystem
  • +: (%, %) -> %
  • from ArithmeticSystem
  • -: % -> %
  • from ArithmeticSystem
  • -: (%, %) -> %
  • [default] from ArithmeticSystem
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • coerce: SingleInteger -> %
  • from ArithmeticSystem
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) -> TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • [default] from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • zero?: % -> Boolean
  • [default] from AbelianMonoid

    Definition:


    25.28 : Steppable

    Description:
    `Steppable' provides skuposrt for segments: discrete sets of values hwich can be stepped over in order.

    Directly inherits
    OrderedRing

    Exports:
  • stepsBetween: (%, %, %) -> SingleInteger
    `stepsBetween(a,b,n)' returns the number os steps between a and b at intervals of n.
  • stepsBetween
    `stepsBetween(a,b)' returns the number of steps between a and b
  • [default]
  • =: (%, %) -> Boolean
  • from BasicType
  • ~=: (%, %) -> Boolean
  • [default] from BasicType
  • <<: (TextWriter, %) => TextWriter
  • from BasicType
  • <<: % -> TextWriter -> TextWriter
  • [default] from BasicType
  • sample: %
  • from BasicType
  • hash: % -> SingleInteger
  • [default] from BasicType
  • <, >, <=, >=: (%, %) -> Boolean
  • from Order
  • <, >, <=, >=: (%, %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Cross(Boolean, %)
  • [default] from Order
  • <, >, <=, >=: (Cross(Boolean, %), %) -> Boolean
  • [default] from Order
  • min, max: (%, %) -> %
  • [default] from Order
  • 0: %
  • from AbelianMonoid
  • +: % -> %
  • [default from AbelianMonoid
  • +: (%, %) -> %
  • from AbelianMonoid
  • zero?: % -> Boolean
  • [default] from AbelianMonoid
  • -: % -> %
  • from AbelianGroup
  • -: (%, %) -> %
  • [default] from AbelianGroup
  • 1: %
  • from ArithmeticSystem
  • *: (%, %) -> %
  • from ArithmeticSystem
  • ^: (%, Integer) -> %
  • from ArithmeticSystem
  • coerce: Integer -> %
  • from ArithmeticSystem
  • abs: %-> %
  • [default] from OrderedRing
  • sign: % -> %
  • [default] from OrderedRing
  • negative?: % -> Boolean
  • [default] from OrderedRing
  • positive?: % -> Boolean
  • [default] from OrderedRing

    Definition:


    Previous Home Contents Next