/usr/share/axiom-20170501/src/algebra/SKAGG.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 | )abbrev category SKAGG StackAggregate
++ Author: Michael Monagan; revised by Manuel Bronstein and Richard Jenks
++ Date Created: August 87 through August 88
++ Date Last Updated: April 1991
++ Description:
++ A stack is a bag where the last item inserted is the first item extracted.
StackAggregate(S) : Category == SIG where
S : Type
SIG ==> BagAggregate S with
finiteAggregate
push_! : (S,%) -> S
++push!(x,s) pushes x onto stack s, that is, destructively changing s
++ so as to have a new first (top) element x.
++ Afterwards, pop!(s) produces x and pop!(s) produces the original s.
++
++X a:Stack INT:= stack [1,2,3,4,5]
++X push! a
++X a
pop_! : % -> S
++pop!(s) returns the top element x, destructively removing x from s.
++ Note that Use \axiom{top(s)} to obtain x without removing it from s.
++ Error: if s is empty.
++
++X a:Stack INT:= stack [1,2,3,4,5]
++X pop! a
++X a
top : % -> S
++top(s) returns the top element x from s; s remains unchanged.
++ Note that Use \axiom{pop!(s)} to obtain x and remove it from s.
++
++X a:Stack INT:= stack [1,2,3,4,5]
++X top a
depth : % -> NonNegativeInteger
++depth(s) returns the number of elements of stack s.
++ Note that \axiom{depth(s) = #s}.
++
++X a:Stack INT:= stack [1,2,3,4,5]
++X depth a
|