relation_parts

std.sets.relation_parts · Level L1

Three parts of a finite relation R from A to B (a 0/1 matrix): its domain Dom R = {a : a R b for some b} as a mask over A; the image R[C] = {b : a R b for some a ∈ C} of a subset C of A, as a mask over B; and the inverse relation R⁻¹ from B to A, the transpose. Ordered pairs keep their direction.

Dom R, R[C], R⁻¹ = {(b, a) : a R b}

Signature

relation_parts(R: f64[a, b], C: f64[a]) → f64[a], f64[b], f64[b, a]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

Rf64[a, b]Cf64[a]ReduceMaxdomReshapeCrTransposeinverse0.0MatMulimgGreaterhitReshapeimagedomf64[a]imagef64[b]inversef64[b, a]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference rows with a 1; columns reached from C; the transpose in exact rational arithmetic, on all 40 test cases.
  • All 833 float64 results are exact: the error is zero.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them exact, with zero error.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
100%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
0

Identity

Calls
—
Called by
—
sha256:400ebca2c19febe5600c2d56be1657f35f076931052534ffcdc9fa4c64e291ee

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.sets.relation_parts · Ω:relation_parts
Pins
sha256:bc5b8fddde78b6b9be49aafc6053c337b8d9e52b785ccbe5e62cba5005c243c1this graph alone
Evidence
sha256:f001f6c7b9b8aa4c4da82ac24c17bff7c11f51d4d3f33ec205c531becc2b2293the hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.