A learning-based Oracle for Automatic Logic Optimization