Flix datalog

From plurigrid/asi · View interactive version

Flix datalog is an AI agent skill from the GitHub repository plurigrid/asi. Flix-based Datalog reasoning with lattice semantics and GF(3) coloring. Use for declarative rule-based routing, lattice fixed-point computation, and skill composition with derangement properties.

How to use this skill

Skill file

flix-datalog

Purpose

Flix-as-a-stepping-stone for plurigrid/asi Datalog reasoning.

Exists to be destroyed: the Flix JVM runtime is a clarity layer

that will be subsumed by GPU-accelerated Datalog (Sun et al. 2023, arXiv:2311.02206).

Core Properties

Derangeable

No element ends up in the same position it started.

A permutation σ is a derangement iff ∀i: σ(i) ≠ i.

In skill composition: after routing through consensus,

every agent must have shifted roles. Prevents fixed-point stagnation.

Already implemented: soft-machine/server/src/cluster/providers/rope.ts

get isDerangable(): boolean {
  return this.length !== 1;
}

Colorable

Elements are comparable via a partial order (lattice).

Flix's key extension to Datalog: first-class lattice semantics.

In skill composition: skills have a color (GF(3) trit) and

you can compare them — finding optimal/minimal fixed points.

Flix Essentials

// Datalog as first-class values
let rules = #{
    Path(x, y) :- Edge(x, y).
    Path(x, z) :- Path(x, y), Edge(y, z).
};

// Lattice semantics: find shortest path (not just reachability)
lat ShortestPath(node: String, dist: Int32)

ShortestPath(src; 0).
ShortestPath(dst; d + w) :- ShortestPath(src; d), Edge(src, dst, w).

Destruction Trajectory

Flix (JVM, single-node)
  → Soufflé (C++, parallel, specialized)
    → GPU-Datalog (CUDA, 45x over Soufflé)
      → FPGA/photonic Datalog (future)

Each layer destroys the previous by being faster at the same semantics.

The Flix skill captures the meaning; the runtime is disposable.

GPU-Accelerated Datalog (Sun et al.)

parallel primitives (hash join, union, difference)

Integration with plurigrid/asi

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│ Flix Datalog  │ ──▶ │ GF(3) Lattice │ ──▶ │ Consensus    │
│ (rules)       │     │ (coloring)    │     │ (derangement)│
└─────────────┘     └──────────────┘     └─────────────┘

Dependencies

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.