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 / seed / ng / front / cases / nom_abstract_order.om

42 lines · 992 bytes Raw Blame History
1note Nominal seal: the operand calls run in source order before the holds check, and a failing check
2note traps 10 (exit 110) after both calls ran. The first constructor call passes (trace 21: hi32 then
3note lo32); the boundary values 0 and 0xffffffff pass; one byte is written to stdout (so a check that fires
4note early is visible); the second call breaks the invariant and traps.
5om2
6abstract dup32 ulong ops xor
7holds dup32 dup32
8global tr ulong 1
9global bump ulong 1
10fn hi32 x uint to ulong
11put tr 0 add mul get tr 0 10 2
12ret ulong x
13end
14fn lo32 x uint to ulong
15put tr 0 add mul get tr 0 10 1
16ret add ulong x get bump 0
17end
18fn dup32mk x uint to dup32
19ret seal dup32 or shl hi32 x 32 lo32 x
20end
21fn main to int
22a = dup32mk 7
23if ne get tr 0 21
24ret 1
25end
26if ne open a 0x0000000700000007
27ret 2
28end
29z = dup32mk 0
30m = dup32mk 0xffffffff
31if ne open xor z m 0xffffffffffffffff
32ret 3
33end
34if ne open xor m m 0
35ret 4
36end
37buf = new uchar 1 79
38w = write 1 buf 0 1
39put bump 0 1
40b = dup32mk 5
41ret 5
42end