Pattern-Based Constraint Satisfaction and Logic Puzzles