Synthesis and analysis of algorithms