Re: Idempotence and "Replication Insensitivity" are equivalent ?

From: Jan Hidders <hidders_at_gmail.com>
Date: 22 Sep 2006 09:22:29 -0700
Message-ID: <1158942149.683309.123640_at_d34g2000cwd.googlegroups.com>


pamelafluente_at_libero.it wrote:
> 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 ?

Us? There's more than one of you? :-)

> Let's assume a Datetime field and this aggregate function:
>
> Central date = minDate + Half length of total time interval
>
> what would (E, S, A) be?

You'd split that into computing (minDate, maxDate) and then do some post-processing. For (minDate, maxDate) you get:

- E = (null, null)
- S(d) = (d,d)
- A((d1, d2), (d3, d4)) = (MIN(d1, d3), MAX(d2, d4))
with MIN and MAX defined such that MIN(d, null) = MIN(null, d) = MAX(d, null) = MAX(null, d) = d.
  • Jan Hidders
Received on Fri Sep 22 2006 - 18:22:29 CEST

Original text of this message