Logic Synthesis of MEM Relay Circuits