SAT-Based Logic Optimization and Resynthesis