Abstract analysis and optimization of scheme