Three-Level Logic Minimization Based on Function Regularities