← All examples
18

Canonical Grid model

Predicate Knowledge

One language for model truth, graph relationships, inference, reachability, and explanation.

Scale
Small
Source
18-predicate-knowledge.grid
Length
47 lines
Collection
Explainability & trust
Level
Intermediate
Runtime
Portable
Version
1.0.0

Watch it in Grid

See this model in motion.

Watch the model respond in the product, then inspect the exact source and checkpoints on this page.

What this model gives you

A release-readiness model that unifies structured symbol facts, property-graph evidence, recursive policy, reachability, and WHY.

20 min to study · Source reviewed 2026-08-25

Continue with guided practice

What to notice

  • Structured unary predicates
  • Graph-to-knowledge projection
  • Transitive inference and modalities
  • Reachability and explanation

Requirements

  • Predicate and Graph runtime
  • WHY inspector or gridctl
  • No network

Expected checkpoint

A known state for this walkthrough.

After loading three reviewed services and the release→api→database architecture graph.

Release releasable
TRUER1C1
Reviewer
:samR1C2
Release depends on database
TRUER1C3, inferred
Dependency evidence
supportedR1C4
01 · Describe

Facts retain payload and model identity

Each reviewed predicate stays attached to the symbol and carries its reviewer and score.

02 · Project

A property graph becomes a logical source without copying

The two architecture edges support transitive dependency inference and reachable-node queries.

03 · Explain

The result retains its witnesses

WHY on R1C3 should name both stable graph edges behind the inferred dependency.

18-predicate-knowledge.grid
Get Grid
MODEL "Predicate Knowledge"
DESCRIPTION "One language for model truth, graph relationships, inference, reachability, and explanation."
VERSION "1.0.0"
TAGS "predicate", "knowledge", "graph", "inference", "explain"

predicate reviewed(by: symbol, score: number)

predicate releasable means
  reviewed
  AND NOT blocked
  AND EVERY dependency IS :releasable

# Unary predicates describe model symbols and remain reactive with their cells.
database is :reviewed(:ada, 0.99) = 1
api is :reviewed(:lin, 0.98) = database + 1
release is :reviewed(:sam, 0.97) = api + 1

# Ordinary authored relationships share the same extensional Predicate graph.
release governed_by policy

# Existing property graphs become logical fact sources without copying edges.
graph architecture = GRAPH(
  [
    ["edge_id", "from", "to", "relation"],
    ["release-api", "release", "api", "depends_on"],
    ["api-database", "api", "database", "depends_on"]
  ] AS edges,
  "edge_id" AS edge_id,
  "from" AS from,
  "to" AS to,
  ["relation"] AS edge_properties,
  TRUE AS directed
)

KNOWLEDGE GRAPH architecture VIA edge.relation
predicate depends_on is transitive

R1C1 = MUST(release IS :releasable)
R1C2 = release.predicates.reviewed.by
R1C3 = MUST("release" depends_on "database")
R1C4 = EVIDENCE("release" depends_on "database")
R1C5 = REACHABLE VIA depends_on* FROM "release"
R1C6 = MODEL.PREDICATES.EDGE_COUNT()

# `gridctl cell why <model-id> R1C3` retains both stable graph edges.

END MODEL