Skip to main content

Learning interpretable logical rules from examples combining symbolic reasoning with machine learning

Project description

💰 Support This Research - Please Donate!

🙏 If this library helps your research or project, please consider donating to support continued development:

💳 DONATE VIA PAYPAL - CLICK HERE

CI PyPI version Python 3.9+ License


Inductive Logic Programming

🔍 Learning from examples

Muggleton, S. (1991) - "Inductive logic programming"

📦 Installation

pip install inductive-logic-programming

🚀 Quick Start

import inductive_logic_programming

# Create training examples
examples = [
    inductive_logic_programming.Example("parent(tom, bob)", True),
    inductive_logic_programming.Example("parent(bob, ann)", True), 
    inductive_logic_programming.Example("parent(tom, liz)", True),
    inductive_logic_programming.Example("parent(bob, pat)", True),
    inductive_logic_programming.Example("parent(pat, jim)", True),
    inductive_logic_programming.Example("grandparent(tom, ann)", True),
    inductive_logic_programming.Example("grandparent(tom, pat)", True),
]

# Use FOIL learner to discover rules
foil = inductive_logic_programming.FOILLearner()
learned_rules = foil.learn(examples)

print("✅ Learned rules:")
for rule in learned_rules:
    print(f"   {rule}")

# Alternative: Use Progol system
progol = inductive_logic_programming.ProgolSystem()
progol.set_examples(examples)
hypothesis = progol.learn()
print(f"✅ Progol hypothesis: {hypothesis}")

🎓 About the Implementation

Implemented by Benedict Chen - bringing foundational AI research to modern Python.

📧 Contact: benedict@benedictchen.com

📖 Citation

If you use this implementation in your research, please cite the original paper:

Muggleton, S. (1991) - "Inductive logic programming"

📜 License

Custom Non-Commercial License with Donation Requirements - See LICENSE file for details.


💰 Support This Work - Donation Appreciated!

This implementation represents hundreds of hours of research and development. If you find it valuable, please consider donating:

💳 DONATE VIA PAYPAL - CLICK HERE

Your support helps maintain and expand these research implementations! 🙏

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inductive_logic_programming-1.1.0.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inductive_logic_programming-1.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file inductive_logic_programming-1.1.0.tar.gz.

File metadata

File hashes

Hashes for inductive_logic_programming-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a5ad9ece8d758b4e0e8035590ffe84c21d357b590a4ca6f3f7dfd26579ec8cfd
MD5 b9f991a3b57a3d8a92c5d3f20329ff8a
BLAKE2b-256 71fbdbe4987298ae18adec81f291383ba96ce603ae00562ed2656184e64f9b04

See more details on using hashes here.

File details

Details for the file inductive_logic_programming-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for inductive_logic_programming-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b62c65619b761bbda0dd1151f4f3cd6b7521d26cf3a12b888b439b8ad35c2822
MD5 64a375af74707cb6a4609d8eb69404f4
BLAKE2b-256 90faec5c7e6e6b4dd7e7a0f333bc08622500179678b254bc0a991426b5c225f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page