Injecting domain knowledge in neural networks: A controlled experiment on a constrained problem