Bdd Based Logic Synthesis Of Mem Relay Circuits