From 7aeb74ff23e7f43dbb17735c2fd4cafbe5606508 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 18 May 2013 18:20:17 +0000 Subject: * algebra/aggcat.spad.pamphlet (HomogeneousAggregate): Move defaults for = and coerce to FiniteAggregate. Remove the rest. --- src/ChangeLog | 5 +++++ src/algebra/aggcat.spad.pamphlet | 24 +++++------------------- 2 files changed, 10 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b9f8eea0..fb3870bb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-05-18 Gabriel Dos Reis + + * algebra/aggcat.spad.pamphlet (HomogeneousAggregate): Move + defaults for = and coerce to FiniteAggregate. Remove the rest. + 2013-05-18 Gabriel Dos Reis * algebra/aggcat.spad.pamphlet (FiniteAggregate) [reduce]: Add diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index 118ac45a..8f1df760 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -125,25 +125,6 @@ HomogeneousAggregate(S:Type): Category == Aggregate with if S has Evalable S then eval(u:%,l:List Equation S):% == map(eval(#1,l),u) - if % has finiteAggregate then - #c == # members c - any?(f, c) == or/[f x for x in members c] - every?(f, c) == and/[f x for x in members c] - count(f:S -> Boolean, c:%) == +/[1 for x in members c | f x] - - if S has BasicType then - x = y == - #x = #y and (and/[a = b for a in members x for b in members y]) - - if S has BasicType then - count(s:S, x:%) == count(s = #1, x) - member?(e, c) == any?(e = #1,c) - - if S has CoercibleTo(OutputForm) then - coerce(x:%):OutputForm == - bracket - commaSeparate [a::OutputForm for a in members x]$List(OutputForm) - @ \section{Aggregates of finite extent} @@ -219,6 +200,11 @@ FiniteAggregate(S: Type): Category == Exports where count(s:S, x:%) == count(s = #1, x) member?(e, x) == any?(e = #1,x) reduce(f,x,e,z) == reduce(f,members x,e,z) + x = y == members x = members y + if S has CoercibleTo OutputForm then + coerce(x:%):OutputForm == + bracket + commaSeparate [a::OutputForm for a in members x]$List(OutputForm) @ -- cgit v1.2.3