Queries involving aggregation are typical in a number of database research areas, such as data warehousing, global information systems and mobile computing. One of the main ideas to optimize the execution of an aggregate query is to reuse results of previously answered queries. This leads to the problem of rewriting aggregate queries using views. More precisely, given a set of queries, called views," and a new query, the task is to reformulate the new query with the help of the views in such a way that executing the reformulated query over the views yields the same result as executing the original query over the base relations. Due to a lack of theory, so far algorithms for this problem were rather ad-hoc. They were sound, but were not proven to be complete. Previously we have given syntactic characterizations for the equivalence of aggregate queries, and applied them to decide when there exist rewritings. However, these decision procedures are nondeterministic and do not lend th...