Commit graph

2 commits

Author SHA1 Message Date
Maximus Gorog
951f86a74f Implement slice computation methods in diagram.rs
Add the core slice computation functionality for n-diagrams:

- Rewrite::apply_forward/apply_backward: Apply rewrites to transform
  diagrams in either direction
- RewriteN::apply_forward/apply_backward: Handle n-dimensional rewrites
  by modifying cospan structure via cone contraction/expansion
- DiagramN::regular_slice(h): Compute regular slice at height h by
  traversing cospans, applying forward then backward rewrites
- DiagramN::singular_slice(h): Compute singular slice (cospan apex)
  by applying forward rewrite to the corresponding regular slice
- DiagramN::target(): Now properly computes the last regular slice
- DiagramN::slices(): Iterator yielding all slices in order r0,s0,r1,...
- DiagramN::regular_slices()/singular_slices(): Filtered iterators

All 48 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 02:56:31 -06:00
Maximus Gorog
cd4b951f78 Scaffold zigzag-engine library
Initial structure implementing the zigzag construction for associative
n-categories (LICS 2022 paper). Includes:

- monotone.rs: MonotoneMap with Wraith's R equivalence (complete)
- zigzag.rs: Zigzag<T>, ZigzagMap<S> with composition
- diagram.rs: Diagram, DiagramN, Cospan, Rewrite, Cone types
- signature.rs: Generator, Signature (complete)
- degeneracy.rs: Degeneracy detection stubs
- normalise.rs: Construction 17 algorithm structure
- typecheck.rs: Type checking against signatures
- explosion.rs: k-points and Poset for layout
- layout.rs: SpringConstraint API surface

All 33 unit tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 02:42:06 -06:00