Logic Synthesis For Networks Of Four-Terminal Switches.