You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

853 B

Aggregations

Aggregations in Cozo can be thought of as a function that acts on a string of values and produces a single value (the aggregate). Due to Datalog semantics, the stream is never empty.

There are two kinds of aggregations in Cozo, meet aggregations and normal aggregations. Meet aggregations satisfy the additional properties of idempotency: the aggregate of a single value a is a itself, commutivity: the aggregate of a then b is equal to the aggregate of b then a, and commutivity: it is immaterial where we put the parentheses in an aggregate application. They are implemented differently in Cozo, with meet aggregations faster and more powerful (only meet aggregations can be recursive).

Meet aggregations can be used as normal ones, but the reverse is impossible.

Meet aggregations

Normal aggregations