An Automata-Theoretic Approach to Synthesizing Binarized Neural Networks