Injecting Domain Knowledge in Neural Networks: a Controlled Experiment on a Constrained Problem