Skip to content

pstlab/CoCo

Repository files navigation

CoCo: Combined Deduction and Abduction Reasoner

Rust License Build Status codecov

CoCo (Combined deduCtiOn and abduCtiOn) is a dual-process cognitive architecture written in Rust. It combines a CLIPS-based rule engine with timeline planning to support both deduction and abduction in dynamic environments.

Highlights

  • Hybrid reasoning: deduction + abduction
  • Rust core for performance and safety
  • CLIPS integration for rules and pattern matching
  • Simple web interface for interaction and visualization

Quick start

Run the server locally:

cargo run --features="server"

By default the server listens on http://0.0.0.0:3000 and serves the web UI.

Installation

Prerequisites

CoCo links to the CLIPS v6.4.2 C library. Install CLIPS as follows:

  1. Download and unpack:
wget -O clips_core_source_642.zip https://sourceforge.net/projects/clipsrules/files/CLIPS/6.4.2/clips_core_source_642.zip/download
unzip clips_core_source_642.zip
  1. Build the core library:
cd clips_core_source_642/core
make release
  1. Either point CLIPS_SOURCE_DIR at the extracted source, or install the static library system-wide:
export CLIPS_SOURCE_DIR=$(pwd)
# or
sudo cp libclips.a /usr/local/lib/
sudo ldconfig

Examples: loading Classes, Objects and Rules

Below are minimal examples that show JSON payloads (useful for APIs or config files).

  1. Class example (JSON)
{
   "name": "Person",
   "parents": ["Agent"],
   "static_properties": {
      "age": { "type": "int", "default": 30, "min": 0, "max": 150 },
      "name": { "type": "string", "default": "Unknown" }
   },
   "dynamic_properties": {
      "mood": { "type": "symbol", "allowed_values": ["happy", "neutral", "sad"], "default": "neutral" }
   }
}
  1. Object example (JSON)
{
   "classes": ["Person"],
   "properties": {
      "age": 28,
      "name": "Alice"
   }
}
  1. Rule example (JSON)
{
   "name": "greet",
   "content": "(defrule greet (Person (name ?n)) => (printout t \\\"Hello \\\" ?n \\\"!\\\" crlf))"
}

Contributing

Contributions are welcome! Please open issues for bugs or feature requests, and submit pull requests for improvements.

License

CoCo is licensed under the MIT License. See LICENSE for details.

About

Combined deduCtiOn and abduCtiOn logical reasoner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors