FWIW, there's the entire field of Inductive Logic Programming focussed on learning/training (propositional or predicate logic) theories in Prolog syntax from examples presented as Prolog facts, with established packages such as Aleph and ProGolem also implemented in Prolog. See eg [1] for an ISO Prolog port and recent optimization/parallelization of Aleph.
[1]: https://quantumprolog.sgml.io/bioinformatics-demo/part1.html