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
omega-mv / seed / qualification / om2 / sec / s5s7 / om1 / t-sum.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note OM-1 twin of v6-sum.om: the same sums over sized views of length 10 and 3. |
| 3 | note Expected stdout oracle/s5s7/exp/v6-sum.out (python3). |
| 4 | fn s10 v view uchar 10 to ulong |
| 5 | x = ulong 0 |
| 6 | for i ulong len v |
| 7 | x = add x ulong get v i |
| 8 | end |
| 9 | ret x |
| 10 | end |
| 11 | fn s3 v view uchar 3 to ulong |
| 12 | x = ulong 0 |
| 13 | for i ulong len v |
| 14 | x = add x ulong get v i |
| 15 | end |
| 16 | ret x |
| 17 | end |
| 18 | fn main to int |
| 19 | a = new uchar 10 0 |
| 20 | for i ulong 10 |
| 21 | put a i uchar mul i 7 |
| 22 | end |
| 23 | b = new uchar 3 5 |
| 24 | putd len a |
| 25 | putd s10 a |
| 26 | putd len b |
| 27 | putd s3 b |
| 28 | ret 0 |
| 29 | end |