aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/data.spad.pamphlet1
-rw-r--r--src/algebra/tree.spad.pamphlet19
2 files changed, 8 insertions, 12 deletions
diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet
index ed78eba4..db84d244 100644
--- a/src/algebra/data.spad.pamphlet
+++ b/src/algebra/data.spad.pamphlet
@@ -311,7 +311,6 @@ ByteBuffer(): Public == Private where
setLength!: (%,NNI) -> NNI
++ setLength!(buf,n) sets the number of active bytes in the
++ `buf'. Error if `n' is more than the capacity.
- finiteAggregate ++ A ByteBuffer object is a finite aggregate
Private == add
import %bytevec2str: PrimitiveArray Byte -> String
from Foreign Builtin
diff --git a/src/algebra/tree.spad.pamphlet b/src/algebra/tree.spad.pamphlet
index 5a56673f..403f7351 100644
--- a/src/algebra/tree.spad.pamphlet
+++ b/src/algebra/tree.spad.pamphlet
@@ -350,15 +350,14 @@ BinaryTreeCategory(S: SetCategory): Category == BinaryRecursiveAggregate(S) with
map!(f,left t)
map!(f,right t)
t
- if % has finiteAggregate then
- treeCount : (%, NonNegativeInteger) -> NonNegativeInteger
- #t == treeCount(t,0)
- treeCount(t,k) ==
- empty? t => k
- k := k + 1
- k = cycleTreeMax and cyclic? t => error "cyclic binary tree"
- k := treeCount(left t,k)
- treeCount(right t,k)
+ treeCount : (%, NonNegativeInteger) -> NonNegativeInteger
+ #t == treeCount(t,0)
+ treeCount(t,k) ==
+ empty? t => k
+ k := k + 1
+ k = cycleTreeMax and cyclic? t => error "cyclic binary tree"
+ k := treeCount(left t,k)
+ treeCount(right t,k)
@
\section{domain BTREE BinaryTree}
@@ -419,7 +418,6 @@ BinaryTree(S: SetCategory): Exports == Implementation where
BinarySearchTree(S: OrderedSet): Exports == Implementation where
Exports == BinaryTreeCategory(S) with
shallowlyMutable
- finiteAggregate
binarySearchTree: List S -> %
++ binarySearchTree(l) \undocumented
insert!: (S,%) -> %
@@ -499,7 +497,6 @@ BinaryTournament(S: OrderedSet): Exports == Implementation where
++ by at most leaf node.
BalancedBinaryTree(S: SetCategory): Exports == Implementation where
Exports == BinaryTreeCategory(S) with
- finiteAggregate
shallowlyMutable
-- BUG: applies wrong fnct for balancedBinaryTree(0,[1,2,3,4])
-- balancedBinaryTree: (S, List S) -> %