datalog-core

Explain Datalog fundamentals with termination guarantees for finite relations.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/hafley66/claude-research --skill datalog-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: datalog-core
Source: https://github.com/hafley66/claude-research/tree/main/skills/datalog-core
Command: npx skills add https://github.com/hafley66/claude-research --skill datalog-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Datalog provides a safe, termination-guaranteed framework for reasoning over finite relations using Horn clauses and recursion. It supports bottom-up evaluation, semi-naive optimization, stratified negation, and rigorous safety/termination guarantees, making it ideal for education, research, and database theory.

Core Features & Use Cases

  • Horn clause fundamentals and bottom-up evaluation
  • Semi-naive evaluation to avoid redundant derivations
  • Stratified negation, safety, and termination guarantees
  • Education and research use cases: exploring recursive queries and formal semantics

Quick Start

Provide a small Datalog program and run the bottom-up evaluation to derive all reachable facts.

Frequently Asked Questions about datalog-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is Datalog and how does bottom-up evaluation guarantee termination?

Datalog is a logic programming language for reasoning over finite relations using Horn clauses. Bottom-up evaluation guarantees termination by deriving all reachable facts from base relations until a fixpoint is reached.

How does semi-naive evaluation avoid redundant derivations in recursive queries?

Semi-naive evaluation avoids redundant derivations in recursive Datalog queries by tracking only newly derived facts between iterations, ensuring that rules fire solely on incremental data to reach a fixpoint efficiently.

How do I apply stratified negation to design safe recursive rules?

Apply stratified negation to design safe recursive rules by partitioning rules into strata, ensuring negation only references predicates defined in lower strata. This preserves safety and guarantees termination of fixpoint derivations.

Does this approach support exploring formal semantics for academic research?

Yes, this Datalog approach supports academic research and database theory by providing a framework to explore recursive queries, formal semantics, and bottom-up evaluation with rigorous safety and termination guarantees.

What are the limitations of Datalog for recursive logic programming?

Datalog limitations include restricting recursion to finite relations and requiring stratified negation for safe rules. It cannot handle unbounded domains or non-stratified negation without losing its termination guarantees.