Deep Learning with Logical Constraints