Skip to content

Add compiler-visible constrained value domains #58

Description

@isomorphisms

isomorphisms/Idric-Net now supplies the first concrete systems-library requirement for first-class value constraints.

The language needs a surface approximately equivalent to:

DestinationPort : ℕ where
  1 ≤ number
  number ≤ 65535

HTTPStatusCode : ℕ where
  100 ≤ number
  number ≤ 599

This must be more than a library wrapper. Required compiler behavior:

  • reject invalid literals during elaboration;
  • allow runtime parsing/checking to produce a constrained result once;
  • carry exact constants such as not_found = 404 as library-declared facts;
  • propagate mechanically decidable arithmetic ranges;
  • refine ranges after comparisons and finite-choice cases;
  • erase checking-only evidence when execution does not need it;
  • preserve bounded-range / exact-value / finite-cardinality information through ANF and IR;
  • let ARM/Thumb and follower backends widen only physically, without turning a finite domain into an unconstrained machine word;
  • support dependent relations such as index < length and body byte length = Content-Length.

Odriç can start with the decidable subset: scalar bounds, finite cardinality, equality to constants, named-value inequalities, lengths/index bounds, and simple arithmetic range propagation.

Acceptance should use Idric-Net rather than only toy examples: 443 is a valid DestinationPort; 0 and 70000 are not; HTTP status is 100..599; not_found remains exactly 404 and 4xx; the eight-case transport result retains cardinality 8 / a three-bit semantic tag domain into backend lowering; ICU consumes the same definitions.

The design note is being added on branch language/constrained-values-idric-net as docs/constrained-values.md.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions