# Re: Idempotence and "Replication Insensitivity" are equivalent ?

Date: 22 Sep 2006 08:29:13 -0700

Message-ID: <1158938953.346259.299510_at_i42g2000cwa.googlegroups.com>

Jan Hidders ha scritto:

*> pamelafluente_at_libero.it wrote:
**> >
*

> > But the real world objection to this is that, sometimes,

*> > the user ORDERs the record and would like to compute aggregate
**> > functions that depends on such order. So does not really make sense
**> > to restrict to ass/comm functions.
**>
**> Actually, also in that case it does.
**>
**> Let's say we use the "free monoid" formalism to define aggregates. That
**> means we define our aggregation function over collections with elements
**> of type T1 and resulting in a aggregate of type T2 by giving (E, S, A):
**> - E ; a value of type T1 for the result of the empty collection
**> - S : T1 -> T2 ; a function for the result of the singleton collection
**> - A : T2 x T2 -> T2 ; the aggregation / combination function
**> such that the function A is associative and E the unit of A.
**>
**> If the collections are bags (or sets) then we require A also to be
**> commutative (and idempotent).
**>
**> Now supose we are talking about sets (and require A to be associative,
**> commutative and idempotent), the it is clear
*

Sounds fashinating :)

...but not really clear to me.

Could you make an example to make us understand ? Let's assume a Datetime field and this aggregate function:

Central date = minDate + Half length of total time interval

-P

that you can still give a

> triple (E,S,A) such that it computes for example the top 5 of the set

*> according to some ordering.
**>
**> Figuring out the exact trio is left to the reader as an exercise. :-)
**>
**> -- Jan Hidders
*

Received on Fri Sep 22 2006 - 17:29:13 CEST