Constraint-based planning