A logic inference engine and family tree visualizer written in Rust. This project reimplements basic concepts from the Cyc artificial intelligence project, focusing on rule-based inference for family relationships.
- Rule-Based Inference: Automatically deduces relationships (Child, Sibling, Grandparent, Uncle, Aunt, etc.) based on a minimal set of parent-child facts.
- Forward Chaining: Applies rules iteratively until no new facts can be derived.
- Visualization: Generates a visual family tree (
family_tree.png) using the inferred relationships.
src/knowledge.rs: The core inference engine. Manages the knowledge base (atoms, rules) and runs the inference loop. Also handles the image generation.src/rules.rs: Defines the logic rules (e.g., "If X is parent of Y, then Y is child of X").src/people.rs: Defines the entities (People) and the initial set of facts (Parent-Child relationships).src/main.rs: Entry point that initializes the knowledge base, runs inference, and generates the output image.
- Rust (latest stable version)
-
Clone the repository:
git clone https://github.com/lazarcloud/rust-cyc.git cd rust-cyc -
Run the application:
cargo run
This will:
- Print the inference steps to the console, showing derived facts.
- Generate a
family_tree.pngfile in the project root visualizing the family tree.
