Skip to content

Rust checker: propagate the additive-& / multiplicative-⊗ product split #109

Closed

Description

@hyperpolymath

Context

The mechanised solo-core now distinguishes two linear products (ADR-007):

intro elim usage
& TWith With t1 t2 Fst / Snd shared
⊗ TTensor Tensor t1 t2 let (x,y)=e split

The Rust type checker (crates/my-lang/src/types.rs) predates this split. To keep the implementation faithful to its spec (the mechanised kernel leads the checker, per proofs/ALIGNMENT-PLAN.md §2), the checker should gain the same distinction.

Task

  • Add the two product type formers to Ty (additive & and multiplicative ⊗), replacing/clarifying any single "pair" type.
  • Introduction: & shares the usage context across both components; ⊗ splits it.
  • Elimination: & → projections (Fst/Snd); ⊗ → a two-binder let (x,y) = e form.
  • Unit tests mirroring the kernel rules (T_With/T_Fst/T_Snd and T_Tensor/T_LetPair), in the style of the existing Echo tests.

Notes

  • Surface syntax for ⊗ / let-pair is a separate concern (parser slice); this issue is the type-checker core.
  • Echo handling (Ty::Echo, is_assignable_from) is unaffected.

Acceptance

  • Ty carries both products; assignability/usage-splitting matches the kernel; tests green.

Activity

  1. hyperpolymath commented on Aug 12, 2026

    @hyperpolymath
    OwnerAuthor

    DESIGN DECISION REQUIRED. Issue tracks alignment of Rust type checker with mechanised solo-core's two linear products (additive & TWith vs multiplicative ⊗ TTensor). Requires: (1) choosing product discipline, (2) updating Ty enum, (3) implementing introduction/elimination forms, (4) adding unit tests. Blocked on ADR-007 clarification and F1.4 preservation proof strategy. Cannot be auto-resolved; needs human design input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions