Logic-inspired Deep Neural Networks