Analysis-by-Synthesis