Deep Learning With Hard Logical Constraints