| Crates.io | foras |
| lib.rs | foras |
| version | 0.0.5 |
| created_at | 2025-10-17 06:48:58.039846+00 |
| updated_at | 2025-10-17 06:48:58.039846+00 |
| description | First-Order Reasoner |
| homepage | https://github.com/cryptopatrick/foras |
| repository | https://github.com/cryptopatrick/foras |
| max_upload_size | |
| id | 1887231 |
| size | 94,185 |
First-Order Reasoner
A Rust crate implementing a first-order reasoner (also known as a first-order logic reasoner or FOL reasoner), which automatically draws logical conclusions from statements expressed in first-order logic (FOL).
First-order logic (FOL) builds on propositional logic by introducing:
Loves(Alice, Bob)).x, y).Example:
∀x (Human(x) → Mortal(x))
Human(Socrates)
⟹ Mortal(Socrates)
This crate can automatically derive Mortal(Socrates) from these premises.
This crate allows you to:
Key capabilities include:
Add this crate to your Cargo.toml:
[dependencies]
fol-reasoner = "0.1.0" # Replace with the latest version
Basic example:
use fol_reasoner::{Formula, Reasoner};
fn main() {
let mut reasoner = Reasoner::new();
// Add premises
reasoner.add(Formula::parse("∀x (Human(x) → Mortal(x))").unwrap());
reasoner.add(Formula::parse("Human(Socrates)").unwrap());
// Query
let query = Formula::parse("Mortal(Socrates)").unwrap();
if reasoner.entails(&query) {
println!("Query is entailed!");
}
}
This implementation draws inspiration from established systems like Prover9, Vampire, E Prover, Z3, and the TPTP library, adapted for efficient Rust-based reasoning.
fol-reasoner is an automated tool for applying formal inference rules to first-order logic statements, producing proofs or countermodels as needed. Ideal for AI, verification, and logical computing tasks in Rust.Contributions are welcome! Please see our contributing guidelines for details on:
This project is licensed under MIT. See LICENSE for details.