A Framework for Integrating Artificial Neural Networks and Logic Programming