There is only one calculus form: the monoid comprehension. It is described in detail in the paper: "Optimizing Object Queries Using an Effective Calculus". It takes the form:

compr( monoid, head, q1, ..., qn )where

- a generator of the form
`iterate(variable,expr)`, or - a predicate
`expr`.

select distinct struct( E: e.name, M: ( select c.name from c in e.children where c.age > 18 ) ) from e in Employees where e.name = "Smith";has the following form in the calculus:

compr( set, struct( bind( E, project(e,name) ), bind( M, compr( bag, project(c,name), iterate(c,project(e,children)), gt(project(c,age),18) ) ) ), iterate(e,Employees), eq(project(e,name),"Smith") )

Last modified: 1/20/99 by Leonidas Fegaras