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 / sec / s5s7 / v6-sum.om

26 lines · 549 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note contract 6 lines 169-170 and erratum E2: unsized `view uchar *` parameters receive sized arrays of
3note length 10 and 3; `len v` is the run-time length. stdout 10, 315, 3, 15 (exp/v6-sum.out, python3).
4om2
5fn vsum v view uchar * to ulong
6x = ulong 0
7for i ulong len v
8x = add x ulong get v i
9end
10ret x
11end
12fn plen v view uchar * to ulong
13ret len v
14end
15fn main to int
16a = new uchar 10 0
17for i ulong 10
18put a i uchar mul i 7
19end
20b = new uchar 3 5
21putd plen a
22putd vsum a
23putd plen b
24putd vsum b
25ret 0
26end