/usr/share/axiom-20170501/src/algebra/DQAGG.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 | )abbrev category DQAGG DequeueAggregate
++ Author: Michael Monagan; revised by Manuel Bronstein and Richard Jenks
++ Date Created: August 87 through August 88
++ Date Last Updated: April 1991
++ Description:
++ A dequeue is a doubly ended stack, that is, a bag where first items
++ inserted are the first items extracted, at either the front or
++ the back end of the data structure.
DequeueAggregate(S) : Category == SIG where
S : Type
SIG ==> Join(StackAggregate S,QueueAggregate S) with
dequeue : () -> %
++ dequeue()$D creates an empty dequeue of type D.
dequeue : List S -> %
++ dequeue([x,y,...,z]) creates a dequeue with first (top or front)
++ element x, second element y,...,and last (bottom or back) element z.
height : % -> NonNegativeInteger
++ height(d) returns the number of elements in dequeue d.
++ Note that \axiom{height(d) = # d}.
top_! : % -> S
++ top!(d) returns the element at the top (front) of the dequeue.
bottom_! : % -> S
++ bottom!(d) returns the element at the bottom (back) of the dequeue.
insertTop_! : (S,%) -> S
++ insertTop!(x,d) destructively inserts x into the dequeue d, that is,
++ at the top (front) of the dequeue.
++ The element previously at the top of the dequeue becomes the
++ second in the dequeue, and so on.
insertBottom_! : (S,%) -> S
++ insertBottom!(x,d) destructively inserts x into the dequeue d
++ at the bottom (back) of the dequeue.
extractTop_! : % -> S
++ extractTop!(d) destructively extracts the top (front) element
++ from the dequeue d.
++ Error: if d is empty.
extractBottom_! : % -> S
++ extractBottom!(d) destructively extracts the bottom (back) element
++ from the dequeue d.
++ Error: if d is empty.
reverse_! : % -> %
++ reverse!(d) destructively replaces d by its reverse dequeue, that is,
++ the top (front) element is now the bottom (back) element, and so on.
|