Is this not almost how logic programming (prolog, etc.) works? You tell the language some things which are true, and then it'll be able to infer answers to "questions" you ask:
Sounds like NN training that could be achievable. The problem comes with unit testing, because the minimal testable unit could be more complex than a function.