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 / qualification / om2 / candidates / s4 / mutants / part-order.from

54 lines · 1271 bytes Raw Blame History
1note arrpart (OM-2, spec 6): `part A o k` as argument pi of function f (index + 1); md 57 / 58 when `view` /
2note `edit` was written before it. A is a name (a global is error 19, a fresh array 27); o, then k, are
3note ulong values. Checks, in this order: o <= len A (CMP Xo, Xlen; B.HI trap 3), then k <= len A - o (SUB,
4note CMP, B.HI trap 3); the wrapped o + k is never formed. The part is a view of A + o * size with count k:
5note an edit when A is writable (local or edit) and no `view` was written, else a view. It goes only to an
6note unsized parameter (error 7). Out as arrarg; rt is A, so for error 19 the part counts as its base.
7fn arrpart f ulong pi ulong md ulong to void
8p = add mul sub f 1 6 pi
9e = arrname
10i = sub e 1
11k = ulong get nm_kind i
12if ge k 6
13fail 7
14end
15if eq k 4
16fail 19
17end
18fz_arg e
19if eq get fn_pk p 3
20if eq md 57
21fail 20
22end
23if and ne k 1 ne k 3
24fail 20
25end
26else
27if eq md 58
28fail 7
29end
30end
31if ne ulong get nm_type i ulong get fn_pt p
32fail 7
33end
34if ne get fn_pl p 0
35fail 7
36end
37rdval 0 5 255 0
38if ne get rt 0 5
39fail 7
40end
41ro = matreg get rk 0 get rv 0 5
42rdval 0 5 255 0
43if ne get rt 0 5
44fail 7
45end
46rn = matreg get rk 0 get rv 0 5
47d = partck i ro rn
48ux = add mul get depth 0 6 pi
49put ul_k ux 1
50put ul_v ux rn
51put rt 0 e
52put rk 0 5
53put rv 0 d
54end