The Logic Of Chemical Synthesis