diff options
author | dos-reis <gdr@axiomatics.org> | 2007-12-02 18:04:48 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-12-02 18:04:48 +0000 |
commit | 343269a2cb9ba10117847c36636dc31bad7404ab (patch) | |
tree | bd1ca5251637386b706eaadaf2f5dc9d4e7b6fa4 /src/algebra/bags.spad.pamphlet | |
parent | 0a95a6448e71e1d2dae08cafab5bf33426f17e61 (diff) | |
download | open-axiom-343269a2cb9ba10117847c36636dc31bad7404ab.tar.gz |
* bags.spad.pamphlet (Stack): Relax requirement element type S.
(coerce$Stack: % -> OutputForm): Define only if S has CoercibleTo
OutputForm.
(=$Stack: (%, %) -> Boolean): Define only if S has SetCategory.
Diffstat (limited to 'src/algebra/bags.spad.pamphlet')
-rw-r--r-- | src/algebra/bags.spad.pamphlet | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/algebra/bags.spad.pamphlet b/src/algebra/bags.spad.pamphlet index 8e1c3356..a00b49e6 100644 --- a/src/algebra/bags.spad.pamphlet +++ b/src/algebra/bags.spad.pamphlet @@ -14,7 +14,7 @@ )abbrev domain STACK Stack ++ Author: Michael Monagan and Stephen Watt ++ Date Created:June 86 and July 87 -++ Date Last Updated:Feb 92 +++ Date Last Updated: December 02, 2007 ++ Basic Operations: ++ Related Domains: ++ Also See: @@ -27,14 +27,21 @@ ++ Linked List implementation of a Stack --% Dequeue and Heap data types -Stack(S:SetCategory): StackAggregate S with +Stack(S: Type): StackAggregate S with stack: List S -> % ++ stack([x,y,...,z]) creates a stack with first (top) ++ element x, second element y,...,and last element z. == add Rep := Reference List S - s = t == deref s = deref t - coerce(d:%): OutputForm == bracket [e::OutputForm for e in deref d] + + if S has CoercibleTo OutputForm then + coerce(d:%): OutputForm == + bracket [e::OutputForm for e in deref d] + + if S has SetCategory then + s = t == + deref s = deref t + copy s == ref copy deref s depth s == # deref s # s == depth s |