From cce7d65c61cebb1d0817752b53aeac56dbb6d0c2 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 16 Jul 2026 04:30:58 +0000 Subject: [PATCH] Dissolve v2.std.algebra fork onto std.algebra single authority. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace duplicate Magma/Semigroup/Monoid/Group/Ring/Lattice/Ordering type definitions in v2.std.algebra with imports from std.algebra (ยง3 nicknaming dissolve). v2-specific helpers (fold_list, bag_eq, etc.) remain in-module. Co-authored-by: Cursor --- src/v2/std/algebra.dag | 81 ++++++++++++------------------------------ 1 file changed, 22 insertions(+), 59 deletions(-) diff --git a/src/v2/std/algebra.dag b/src/v2/std/algebra.dag index fa89532e109..1ef6b27d26f 100644 --- a/src/v2/std/algebra.dag +++ b/src/v2/std/algebra.dag @@ -1,48 +1,28 @@ module v2.std.algebra import v2.std.node { Atom, Arrow, Conj, Disj, Edge, Named, Node, Positional, Symbol, TypeNode, SyntheticOccurrence } -import std.algebra { FreeMonoid, Empty, Cons } -type Magma { - op: fn(T, T) -> T -} -type Semigroup { - magma: Magma -} -type Monoid { - semigroup: Semigroup - identity: T -} -type CommutativeMonoid { - monoid: Monoid -} -type Group { - monoid: Monoid - inverse: fn(T) -> T -} -type AbelianGroup { - group: Group -} -type Semiring { - add: CommutativeMonoid - mul: Monoid -} -type CommutativeSemiring { - semiring: Semiring -} -type Ring { - add: AbelianGroup - mul: Monoid -} -type CommutativeRing { - ring: Ring -} -type OrderedRing { - ring: Ring - compare: fn(T, T) -> Ordering -} -type Field { - commutative_ring: CommutativeRing - reciprocal: fn(T) -> T +import std.algebra { + AbelianGroup, + BooleanAlgebra, + BoundedLattice, + CommutativeMonoid, + CommutativeSemiring, + Cons, + Empty, + Equal, + Field, + FreeMonoid, + Greater, + Group, + Lattice, + Less, + Magma, + Monoid, + OrderedRing, + Ordering, + Ring, + Semigroup, + Semiring, } type ApproximateField { @@ -53,19 +33,6 @@ type ApproximateField { one: T compare: fn(T, T) -> Ordering } -type Lattice { - meet: fn(T, T) -> T - join: fn(T, T) -> T -} -type BoundedLattice { - lattice: Lattice - top: T - bottom: T -} -type BooleanAlgebra { - bounded_lattice: BoundedLattice - complement: fn(T) -> T -} type Equivalence { eq: fn(T, T) -> Bool @@ -812,10 +779,6 @@ type PointwisePower { member: fn(T) -> Bool } -type Ordering - = Less - | Equal - | Greater type Homomorphism { source: C target: C