Automated design of multiple-valued logic circuits by automated theorem proving techniques