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 / selftest / cat-bad.om

27 lines · 491 bytes Raw Blame History
1note Harness self-test program (deliberately wrong): copy standard input to standard output, but
2note add 1 (wrapping) to the byte at offset 5. The gate must report FAIL, stdout differs at byte 5.
3fn main to int
4b = new uchar 4096 0
5pos = ulong 0
6go = true
7while go
8r = read 0 b 0 4096
9if lt r 0
10ret 91
11end
12if eq r 0
13go = false
14else
15n = ulong r
16if and le pos 5 lt 5 add pos n
17put b sub 5 pos add get b sub 5 pos 1
18end
19pos = add pos n
20w = write 1 b 0 n
21if ne w r
22ret 92
23end
24end
25end
26ret 0
27end