A Recognizer and Post-Recognizer for Optimizing Execution Times of Programs