diff options
author | dos-reis <gdr@axiomatics.org> | 2013-05-17 10:50:09 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-05-17 10:50:09 +0000 |
commit | fd52eb1ee7ab42be1fdc73d9fc91d79abd0abd25 (patch) | |
tree | 8826031bbc15074f25d2d3c50b2696f494d7868f /src | |
parent | 1e6db8d4424e63a8992d7fc04917ddfd6ce94378 (diff) | |
download | open-axiom-fd52eb1ee7ab42be1fdc73d9fc91d79abd0abd25.tar.gz |
* algebra/aggcat.spad.pamphlet (FiniteAggregate): More defaults.
(Aggregate): Remove default implementation of empty?
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/algebra/aggcat.spad.pamphlet | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 45f8edf2..8f1158c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2013-05-17 Gabriel Dos Reis <gdr@integrable-solutions.net> + * algebra/aggcat.spad.pamphlet (FiniteAggregate): More defaults. + (Aggregate): Remove default implementation of empty? + +2013-05-17 Gabriel Dos Reis <gdr@integrable-solutions.net> + * algebra/aggcat.spad.pamphlet (FiniteAggregate): Add default implementation for empty?. diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index ebbf2f97..2d539d44 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -56,8 +56,6 @@ Aggregate: Category == Type with add eq?(a,b) == %peq(a,b)$Foreign(Builtin) sample() == empty() - if % has finiteAggregate then - empty? a == #a = 0 @ @@ -199,6 +197,14 @@ FiniteAggregate(S: Type): Category == Exports where ++ \axiom{member?(x,u) = reduce(or,[x=y for y in u],false)}. add empty? x == #x = 0 + #x == # members x + any?(f, x) == or/[f e for e in members x] + every?(f, x) == and/[f e for e in members x] + count(f:S -> Boolean, x:%) == +/[1 for e in parts x | f e] + if S has BasicType then + count(s:S, x:%) == count(s = #1, x) + member?(e, x) == any?(e = #1,x) + @ |