Cleanly connecting NNs to contracts / rules is indeed a hard problem, which many people would like to see solved. Please see my post about that [1], and the corresponding HN comment thread [2].
[1] http://blog.foretellix.com/2017/07/06/where-machine-learning...