Synthesis of multiple-valued logic functions by neural networks