Skip to content
Agentmart
Submit a tool

constraint-generalization

Generalization and composition of constraints across navigators

Skill by plurigrid

IndexedMIT★ 70
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/plurigrid-constraint-generalization

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Generalization and composition of constraints across navigators

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/constraint-generalization

What's inside

Skill name
constraint-generalization
Description
Generalization and composition of constraints across navigators
License
MIT
Instructions
373 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Constraint Generalization

## Core Concept

Given proven constraints on individual paths, **synthesize new constraints** that hold across composed paths. This skill moves from "validation" (rejecting bad paths) to "generation" (creating better paths).

Example: If path A proves outputs are even, and path B proves outputs are positive, the **composed path AB proves outputs are both even AND positive**.

## Why Constraint Generalization?

Without it, constraints are lost during composition:

```julia
nav_even = @late_nav([ALL, pred(iseven)])      # proves: even
nav_positive = @late_nav([ALL, pred(x > 0)])   # proves: positive

# Compose them:
nav_composed = compose_navigators(nav_even, nav_positive)
# What can we prove about the result?
# Without generalization: nothing! Constraints are forgotten.

# With generalization:
# => Proves: even(x) ∧ positive(x)
# => More refined type: EvenPositiveInt
```

This **refinement typing** enables:
- **Automatic constraint propagation** downstream
- **Fewer re-checks** (prove once, use many times)
- **Smarter composition** (know which paths can combine)
- **Proof generation** (formal certificates for constraints)

## Architecture

### Constraint Representation

```julia
struct Constraint
    predicate::Function           # The boolean test
    name::Symbol                  # :even, :positive, :non_null, ...
    arity::Int                    # 1 for unary, 2 for binary, etc.
    proof::Proof                  # Evidence constraint holds
    refinement_type::RefinementType  # Int → EvenInt
end
```

### Constraint Composition

**CNF (Conjunctive Normal Form)** for constraint composition:

```
C₁ ∧ C₂ ∧ C₃ = (iseven AND positive AND nonzero)

Satisfiable? Check via 3-MATCH:
  - Find x where iseven(x) ∧ positive(x) ∧ nonzero(x)
  - If no x exists → constraints are contradictory
  - If x exists → constraints compose validly
```

### Constraint Lattice

```
        ⊤ (True, no constraint)
       / \
    even  odd
     / \   / \
    ... ∧ ... (conjunctions)
     \ /   \ /
     ⊥ (False, unsatisfiable)
```

Generalization works upward in this lattice: from specific constraints to general ones.

## API

### Constraint Extraction

**`extract_constraints(navigator::Navigator) :: Vector{Constraint}`**
Pulls constraints from a compiled Navigator.

```julia
nav = @late_nav([ALL, pred(x -> iseven(x) && x > 0)])
constraints = extract_constraints(nav)
# => [
#      Constraint(:even, iseven, proof=...),
#      Constraint(:positive, x > 0, proof=...)
#    ]
```

**`named_constraint(name::Symbol, predicate::Function) :: Constraint`**
Creates a named, reusable constraint.

```julia
constraint_even = named_constraint(:even, iseven)
constraint_gt5 = named_constraint(:gt5, x -> x > 5)
constraint_string = named_constraint(:string, x -> isa(x, String))
```

### Constraint Composition

**`compose_constraints(c1::Constraint, c2::Constraint) :: ComposedConstraint`**
Combines two constraints, proving they're satisfiable together.

```julia
c_even = named_constraint(:even, iseven)
c_positive = named_constraint(:positive, x > 0)

c_composed = compose_constraints(c_even, c_positive)
# => ComposedConstraint(
#     name: :even_and_positive,
#     predicate: x -> iseven(x) && x > 0,
#     proof: (satisfiable evidence),
#     refinement_type: EvenPositiveInt
#   )
```

**`compose_constraints(constraints::Vector) :: ComposedConstraint`**
Composes multiple constraints at once.

From plurigrid/asi, MIT.

More from plurigrid/asi

Signals

Stars
70
Forks
13
Open issues
3
Last commit (this folder)
Dec 27, 2025 (10 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from plurigrid

Cite this page

constraint-generalization skill. Agent Mart. https://agentmart.dev/skills/plurigrid-constraint-generalization (last updated 2026-10-24)