Nested Aggregates in Answer Sets: An Application to a Priori Optimization