The Lyrics framework allows to inject logic knowledge into a learner using the Semantic Based Regularization framework:
Semantic-based regularization for learning and inference, M Diligenti, M Gori, C Sacca, Artificial Intelligence 244, 143-165
LYRICS: A General Interface Layer to Integrate Logic Inference and Deep Learning G Marra, F Giannini, M Diligenti, M Gori, Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 283-298, 2019
LYRICS is a TensorFlow library, which defines a declarative language to express the prior knowledge about a learning task, which can be injected into any tensorflow learner. The declarative language allows to define any many–sorted logical theory, namely you can declare some domains of different sort, with constants, functions and relations on them.