摘要 |
Methods, systems, and apparatus, including computer programs encoded on computer storage media, for expressing and evaluating aggregation functions, including aggregation functions in the context of recursive aggregates, in data languages that implement fixed point semantics. One of the methods includes receiving input specifying, explicitly or implicitly, an aggregation function agg having an input type and an output type, a relation s that has a domain and a range and that represents one or more entities to be aggregated over, and a relation t that is a relation from the range of s to the input type of the aggregation function agg; and evaluating an aggregation construct agg* to calculate a relation between the domain of s and the output type of the aggregation function agg according to agg*(s, t)={(m, agg(n))|∃d: (m,d)εs,nεπ{|t(y)|yεs(m)|}}. |
主权项 |
1. A system comprising:
one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:
receiving program input specifying an aggregation function agg having an input type and an output type, a relation s that has a domain and a range, wherein s represents one or more entities to be aggregated over, and a relation t that is a relation from the range of s to the input type of the aggregation function agg; evaluating an aggregation construct agg* to calculate a relation between the domain of s and the output type of the agg function according to
agg*(s,t)={(m,agg(n))|∃d:(m,d)εs,nεπ{|t(y)|yεs(m)|}}wherein agg* returns a relation and is monotonic in the relation t;
receiving program input in which the aggregation construct agg* is within a recursive term of a recursive relation definition; and evaluating the recursive relation definition. |