Expand description
Patch Algebra — the mathematical heart of Suture.
This module implements the core patch theory:
- Patches as typed operations with touch sets
- Commutativity detection based on disjoint touch sets
- Merge computation via set-union of independent patches
- Conflict detection and first-class conflict nodes
§Formal Foundation
See YP-ALGEBRA-PATCH-001 for the mathematical proofs:
- THM-COMM-001: Disjoint touch sets imply commutativity
- THM-MERGE-001: Merging produces a deterministic, unique result
- THM-CONF-001: Conflict nodes preserve all information from both branches
Re-exports§
pub use conflict::Conflict;pub use conflict::ConflictClass;pub use conflict::ConflictNode;pub use merge::MergeError;pub use merge::MergeResult;pub use merge::merge;pub use types::Operation;pub use types::OperationType;pub use types::Patch;pub use types::PatchId;pub use types::TouchSet;
Modules§
- conflict
- Conflict types for non-commutative patch pairs.
- merge
- Three-way merge algorithm for patch sets.
- types
- Core patch types.
Structs§
- Compose
Result - Result of composing two patches.
Enums§
- Commute
Result - Result of a commutativity check.
- Compose
Error
Functions§
- commute
- Check if two patches commute.
- compose
- Compose two patches into a single equivalent patch.
- compose_
chain - Compose a sequence of patches into a single equivalent patch.