diff options
author | dos-reis <gdr@axiomatics.org> | 2013-05-16 13:54:22 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-05-16 13:54:22 +0000 |
commit | 0520bd59f6b9d9294a73cc88a1fa34a32678d7e5 (patch) | |
tree | 6553b6850ae0603415fc87567fa7f2b3d4203d2c /src/algebra/tree.spad.pamphlet | |
parent | f5ca9521817b2953e4420ca39ec7a5124d721fb8 (diff) | |
download | open-axiom-0520bd59f6b9d9294a73cc88a1fa34a32678d7e5.tar.gz |
* algebra/data.spad.pamphlet (Byte): Remove redundant
finiteAggregate attribute.
* algebra/tree.spad.pamphlet (BinaryTreeCategory): Likewise.
(BinarySearchTree): Likewise.
(BalancedBinaryTree): Likewise.
Diffstat (limited to 'src/algebra/tree.spad.pamphlet')
-rw-r--r-- | src/algebra/tree.spad.pamphlet | 19 |
1 files changed, 8 insertions, 11 deletions
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) -> % |