logic gates simplification rules - Search