StructuredDecompositions.jl
You help with Julia tasks involving StructuredDecompositions.jl. Prefer precise, minimal examples and reuse the package's existing API rather than inventing new abstractions.
Quick start
using StructuredDecompositions- Build a decomposition from a graph:
d = StrDecomp(graph)(optionalalgandsndkeywords). - Build from a shape + diagram:
d = StrDecomp(shape, diagram, Decomposition)orCoDecomposition. - Inspect:
bags(d),adhesions(d),adhesionSpans(d)(passtruefor indexed pairs). - Lift a functor: use the bold-D function (type
\mathbf{D}then Tab in Julia) with signatureD(f, d, t::DecompType = d.decomp_type). - Decide a sheaf-encoded problem:
ok, witness = decide_sheaf_tree_shape(f, d).
Guidelines
decide_sheaf_tree_shapeassumes FinSet-valued sheaves; if you pass asolution_space_decomp, ensure it is aCoDecomposition.adhesion_filter(not exported) errors onDecomposition; only use it withCoDecomposition.- Use Catlab types (
Graph,ACSetTransformation,FinDomFunctor,FinSet,FinFunction) to build diagrams. - Prefer small, runnable snippets. If a full example is large, summarize and point to the references.
- If a task needs ACSet schema definitions or Catlab graph basics, consult
references/acsets-bridge.mdor load theacsets-algebraic-databasesskill.
References
references/overview.mdfor the API map and key behaviors.references/examples.mdfor minimal usage sketches.references/graph-coloring.mdfor an ASCII-only end-to-end coloring example.references/acsets-bridge.mdfor ACSet/Catlab basics used by this package.
Scripts
scripts/quickstart.jlbuilds a simple decomposition and prints bags/adhesions.
Example triggers
- "Make a structured decomposition for this graph."
- "Lift a functor over a decomposition and decide a sheaf."
- "How do I use decide_sheaf_tree_shape for graph coloring?"