Learning and reasoning in logic tensor networks: Theory and application to semantic image interpretation