Applying Constraint Programming to the View Selection Problem