interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / train / aien-train / tests / adtrain / replay / padprobe.om

32 lines · 672 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note padprobe: sign of a tape reduction whose inputs are all -0.
3note Unit order: metadata.om, tape.om (or a mutant of it), this file.
4note Sums a [1,4] leaf of -0.0 along axis 1 with tpsum. IEEE 754 RNE gives
5note -0 + -0 = -0, so with the contract's -0 lane padding the sum is -0.
6note Exits: 11 the sum is -0, 10 the sum is +0, 12 any other value,
7note 87 a tape refusal.
8fn main to int
9tpreset
10id = tpleaf 1 4 0
11if ne id 0
12ret 87
13end
14for i ulong 4
15st = tpset 0 i neg 0.0f32
16if ne st 0
17ret 87
18end
19end
20s = tpsum 0 1
21if ne s 1
22ret 87
23end
24b = bitcast uint tpval 1 0
25if eq b 2147483648
26ret 11
27end
28if eq b 0
29ret 10
30end
31ret 12
32end