Pattern Synthesis