Skip to content

Research / INVALIDATION-TYPES-01: InvalML inference vs Own.NET ownership states (MLstruct / SEBAS prior art, kill-first) #466

Open

Description

@PhysShell

Classification / purpose

RESEARCH / P3 / REUSE-FIRST / KILL-FIRST / READ-ONLY PREFLIGHT / NOT ADOPTED / NO IMPLEMENTATION AUTHORIZED (2026-11-23).

Evaluate one specific semantic question: can InvalML's inference of permanent/temporary invalidation help express or independently check one real Own.NET ownership / borrowing / protocol-state edge better than existing transfer/join and tests?

Not a request to port a compiler, build a new type-system framework, implement typestate, or add a new analyzer. Detailed research Page.

Upstream: three different related research artifacts

Artifact Verified sources Relevant contribution Boundary
MLstruct, OOPSLA 2022 README, ConstraintSolver.scala, NormalForms.scala, Paper.mls Principal type inference in a Boolean algebra of structural types: union, intersection, complement, DNF/CNF constraint solving; Scala 2.13, MIT. Last main-branch commit 2024-12-09 General Boolean types and structural subtyping ≠ ownership/invalidation soundness; paper proof ≠ error-free Scala implementation. Workflow CI follows branch mlscript, not default mlstruct
InvalML, OOPSLA 2025 Artifact README, web demo Distinct type-and-effect system with permanent and temporary invalidation and proposed sound/complete inference algorithm; implemented as alternative experimental Scala type-checker, test examples include exceptions, staged scopes, stack memory, GUI, solver. Repo MIT Not a Roslyn/C# checker, not universal Rust borrow checking; explicitly map aliases, mutable regions, exception/async flows before claiming comparable semantics
SEBAS, POPL 2026 Artifact README, demo Independent Boolean-algebraic subtyping decision method including equi-recursive types, with Scala test artifacts Subtyping is not the full inference/effect engine. Authors say worst-case complexity claim cannot be verified by running tests. License of this repo must be confirmed before any code reuse

The actively developed MLscript hkmc2 explicitly notes its new compiler does not yet have a full replacement type checker beyond experimental InvalML. Do not treat it as shipped MLstruct vNext.

Existing Own.NET work: preserve ownership and avoid duplicate infra

  • #433: independent concrete-state oracle, transfer/join soundness, mutation and fail-closed behavior. Reuse its corpus/oracle; this issue must not implement another one.
  • #451: narrow machine-checked operator proof with existing Rocq/MathComp by default. InvalML is semantic prior art, not a default extra proof assistant or toolchain.
  • #392: real affine terminal protocol token defect and expected OWN001→clean for that resource kind. Do not alter that implementation scope. Use as a contrasting case if its actual semantics overlaps.
  • #438: SPDS / field-sensitive alias provenance; invalidation constraints alone cannot recover alias identity/heap flow not represented by OwnIR.
  • #430: C#→OwnIR semantic fidelity and loss of data through lowering.

Kill-first protocol

  1. Gate 0 — current-state overlap (read-only): pin Own.NET SHA and exact Rust transfer/join + OwnIR vocabulary. Compare existing tests in State protocols: affine tokens — an unspent (terminal) state token must not be OWN001 #392/Research: IKOS-inspired abstract-state soundness oracle and operator audit (bounded spike) #433/Research: SPDS field-stack reachability for ownership aliasing (bounded spike) #438/Research: independent formal cross-check and Rust-level soundness verification (Rocq / Verus / Aeneas / Isabelle) #451. State precisely which invalidation operations Own.NET already models, what it does not (exception/unknown effects, heap aliasing, path joins), and why the candidate is not already covered. If duplicated, STOP.
  2. Gate 1 — tiny semantic exercise: re-use 8–12 existing, synthetic own-code cases: acquire/use/release; borrow while state changes; mutable alias; branch merge; terminal affine token; use-after-transition/double use; unknown or opaque call; exception path only if faithfully modeled. Independently annotate the actual C# observable outcome and potential expected analyzer state. Distinguish SAFE, ERROR, UNKNOWN, UNMODELED. Do not force correspondences where InvalML's formal language lacks the C# concept.
  3. Baseline A: current Own.NET transfer/join and existing corpus, with the same source facts and oracle. Candidate B: write down the minimal InvalML-like Boolean/effect constraints as an optional reference semantics for one valuable edge, only if step 1 exposes a distinct gap. SEBAS only for an independently useful subtyping judgement; not a mandatory third benchmark or framework.
  4. Negative controls (must be observed by a real, non-self-referential test): forget an invalidating effect, propagate alias to wrong object, allow use after invalidation, treat UNKNOWN as FALSE, invert union/intersection in branch join. At least one existing expected-red mutant; do not claim mutation coverage unless run.
  5. Cost & benefit: count genuine false-SAFE / false-ERROR differences with evidence and first divergence, lost expressivity/unmodeled proportion, type-constraint solver cost (incl. normal-form blow-up), reviewer minutes, replay cost, and C#→OwnIR gap. If a plain typed transition table/decision table covers all, KEEP SIMPLE.

Acceptance / stop

Non-goals

No rewriting Own.NET into Scala, deploying MLscript/InvalML, adopting a global Boolean type lattice, replacing C# structural typing, new CI service, importing third-party Docker images into corporate environments, web demo with private source, or claiming rule applicability / legal truth from Boolean type checks.

See research Page for exact code paths, limitations and the separate low-priority AI-Assistent structural-schema context.

Activity

  1. PhysShell commented on Nov 23, 2026

    @PhysShell
    OwnerAuthor

    2026-11-23 — Bader/Jay combinatory-types: separate inference calculus (reference only)

    Johannes Bader research Page · olydis/combinatory-types · MLstruct · InvalML.

    Simple Types for Polymorphic Functions (2026) studies type inference for combinatory programs, with an OCaml/Dune implementation. It is not MLstruct's Boolean structural type inference, InvalML's invalidation type-and-effect system or Own.NET's C# ownership semantics. Optional research comparison: expressibility, type constraints, inference completeness and correspondence of terms to accepted real-language programs. Only if a specific current Own.NET invalidation/typestate test exposes a gap not handled by #466's baseline; otherwise keep theoretical reference and STOP. No new type checker or compiler dependency.

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