program optimization theory