plurigrid/asi

structured-decomp

StructuredDecompositions.jl sheaves on tree decompositions for FPT algorithms with bidirectional navigation

First seen Jan 29, 2026

Installation

$ npx skills add plurigrid/asi --skill structured-decomp

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from plurigrid/asi · top by installs.

npx skills add plurigrid/asi

Browse all from plurigrid/asi

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 62
License LICENSE
Default branch main
Open issues 3
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.1.0
LicenseMIT
More metadata
source
AlgebraicJulia/StructuredDecompositions.jl + music-topos
trit
0
gf3_conserved
1
version
1.1.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,970 B
  • docs SUMMARY.md 132 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 7 installs

SKILL.md

Structured Decompositions Skill

Sheaves on tree decompositions with bidirectional navigation

Version: 1.1.0 Trit: 0 (Ergodic - coordinates decomposition)

Core Concept

StrDecomp = Functor d: ∫G → C where:

  • ∫G = category of elements of shape graph
  • C = target category (Graph, FinSet, etc.)
using StructuredDecompositions

# Create decomposition from graph
d = StrDecomp(graph)

# Access components
bags(d)           # Local substructures
adhesions(d)      # Overlaps (shared boundaries)
adhesionSpans(d)  # Span morphisms

The 𝐃 Functor

Lifts decision problems to decomposition space:

# Define problem as functor
k_coloring(G) = homomorphisms(G, K_k)

# Lift and solve
solution = 𝐃(k_coloring, decomp, CoDecomposition)
(answer, witness) = decide_sheaf_tree_shape(k_coloring, decomp)

Specter-Style Navigation for Decompositions

Bidirectional paths for navigating decomposition structures:

using SpecterACSet

# Navigate bags
select([decomp_bags, ALL, acset_parts(:V)], decomp)

# Navigate adhesions with bidirectional transform
transform([decomp_adhesions, ALL], 
          adh -> reindex_adhesion(adh, mapping), 
          decomp)

Decomposition Navigators

Navigator Select Transform
decomp_bags All bag ACSets Update bags
decomp_adhesions All adhesion ACSets Update adhesions
decomp_spans Span morphisms Reindex spans
adhesion_between(i,j) Specific adhesion Update specific

FPT Complexity

Runtime: O(f(width) × n) where width = max adhesion size

The sheaf condition ensures local solutions glue to global:

# Sheaf condition: sections over overlaps must agree
function verify_sheaf_condition(decomp, local_solutions)
    for (i, j) in adhesion_pairs(decomp)
        adh = adhesion(decomp, i, j)
        s_i = restrict(local_solutions[i], adh)
        s_j = restrict(local_solutions[j], adh)
        s_i == s_j || return false
    end
    return true
end

Integration with lispsyntax-acset

Serialize decompositions to S-expressions for inspection:

# Decomposition → Sexp
sexp = sexp_of_strdecomp(decomp)

# Navigate sexp representation
bag_names = select([SEXP_CHILDREN, pred(is_bag), SEXP_HEAD, ATOM_VALUE], sexp)

# Roundtrip
decomp2 = strdecomp_of_sexp(GraphType, sexp)

Adhesion as Colored Boundary

With Gay.jl deterministic coloring:

using Gay

struct ColoredAdhesion
    left_bag::ACSet
    right_bag::ACSet
    adhesion::ACSet
    color::String  # Deterministic from seed + index
end

function color_decomposition(decomp, seed)
    [ColoredAdhesion(
        bags(decomp)[i],
        bags(decomp)[j],
        adhesion(decomp, i, j),
        Gay.color_at(seed, idx)
    ) for (idx, (i, j)) in enumerate(adhesion_pairs(decomp))]
end

GF(3) Triads

dmd-spectral (-1) ⊗ structured-decomp (0) ⊗ koopman-generator (+1) = 0 ✓
sheaf-cohomology (-1) ⊗ structured-decomp (0) ⊗ colimit-reconstruct (+1) = 0 ✓

Time-Varying Data (Brunton + Spivak Integration)

For DMD/Koopman analysis on decomposed data:

@present SchTimeVaryingDecomp(FreeSchema) begin
    Interval::Ob
    Snapshot::Ob
    State::Ob
    
    timestamp::Hom(Snapshot, Interval)
    observable::Hom(Snapshot, State)
    
    Time::AttrType
    Value::AttrType
end

# Colimit reconstructs dynamics
# DMD = colimit of snapshot diagram over intervals

References

  • Bumpus et al. "Structured Decompositions" arXiv:2207.06091
  • algebraicjulia.github.io/StructuredDecompositions.jl
  • Nathan Marz: Specter inline caching patterns