Learning with Logical Constraints but without Shortcut Satisfaction