Learning Compositional Rules via Neural Program Synthesis