7. A computer-implemented method comprising: receiving an original recursive expression that defines tuples belonging to an output relation, wherein the original recursive expression has a recursive aggregation construct, the recursive aggregation construct having a range and a recursive term; receiving an original recursive expression that defines tuples belonging to an output relation, wherein the original recursive expression has a recursive aggregation construct, the recursive aggregation construct having a range and a recursive term; generating an initial delta expression from the original recursive expression; generating a final delta expression including repeatedly applying one or more differential rules to the initial delta expression, including applying an aggregates delta rule to generate a conjunction of: (i) an existential term having a subterm that is a conjunction of the range and a delta term that is the recursive term of the aggregation construct, and (ii) a gamma term having a subterm that is the aggregation construct; evaluating the original recursive expression on an initial condition to generate one or more tuples; computing an initial delta relation as a difference between the one or more tuples and the initial condition; and until the final delta expression generates no new tuples, performing operations comprising: evaluating the existential term to generate tuples related by the range and tuples in the delta relation, evaluating the aggregation construct using tuples generated by the existential term as the range of the aggregation construct, and updating the output relation including adding to the output relation any tuples newly generated by evaluating the final delta expression.
7. A computer-implemented method comprising: receiving an original recursive expression that defines tuples belonging to an output relation, wherein the original recursive expression has a recursive aggregation construct, the recursive aggregation construct having a range and a recursive term; receiving an original recursive expression that defines tuples belonging to an output relation, wherein the original recursive expression has a recursive aggregation construct, the recursive aggregation construct having a range and a recursive term; generating an initial delta expression from the original recursive expression; generating a final delta expression including repeatedly applying one or more differential rules to the initial delta expression, including applying an aggregates delta rule to generate a conjunction of: (i) an existential term having a subterm that is a conjunction of the range and a delta term that is the recursive term of the aggregation construct, and (ii) a gamma term having a subterm that is the aggregation construct; evaluating the original recursive expression on an initial condition to generate one or more tuples; computing an initial delta relation as a difference between the one or more tuples and the initial condition; and until the final delta expression generates no new tuples, performing operations comprising: evaluating the existential term to generate tuples related by the range and tuples in the delta relation, evaluating the aggregation construct using tuples generated by the existential term as the range of the aggregation construct, and updating the output relation including adding to the output relation any tuples newly generated by evaluating the final delta expression. 8. The method of claim 7 , wherein evaluating the aggregation construct comprises evaluating the aggregation construct if and only if the existential term generates one or more tuples.