Learning and Reasoning in Logic Tensor Networks: Theory and Application to Semantic Image Interpretation