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 / security673 / resources / oracle.om
| 1 | note R3 independent enumeration. No reserve.om calls. State code u*9+r1*3+r2. |
| 2 | note Frozen capacity3, reserve1/2, commit0..q, release1, whole-service crash. |
| 3 | global seen uchar 36 |
| 4 | global edges uchar 1296 |
| 5 | global arg uchar 16 |
| 6 | text edgearg "--edges" |
| 7 | text pass "PASS R3 states=18 edges=78 whole-service-effectfree-crash\n" |
| 8 | text fail "FAIL R3 states18_edges78\n" |
| 9 | fn edge a ulong b ulong to void |
| 10 | put edges add mul a 36 b 1 |
| 11 | put seen b 1 |
| 12 | end |
| 13 | fn expand a ulong to void |
| 14 | u = div a 9 |
| 15 | x = rem div a 3 3 |
| 16 | y = rem a 3 |
| 17 | edge a mul u 9 |
| 18 | if gt u 0 |
| 19 | edge a sub a 9 |
| 20 | end |
| 21 | for j ulong 2 |
| 22 | q = x |
| 23 | scale = ulong 3 |
| 24 | if eq j 1 |
| 25 | q = y |
| 26 | scale = 1 |
| 27 | end |
| 28 | if eq q 0 |
| 29 | for k ulong 2 |
| 30 | want = add k 1 |
| 31 | if le add add u x add y want 3 |
| 32 | edge a add a mul want scale |
| 33 | end |
| 34 | end |
| 35 | else |
| 36 | for c ulong add q 1 |
| 37 | edge a add sub a mul q scale mul c 9 |
| 38 | end |
| 39 | end |
| 40 | end |
| 41 | end |
| 42 | fn main to int |
| 43 | put seen 0 1 |
| 44 | for round ulong 36 |
| 45 | for a ulong 36 |
| 46 | if ne get seen a 0 |
| 47 | expand a |
| 48 | end |
| 49 | end |
| 50 | end |
| 51 | n = ulong 0 |
| 52 | e = ulong 0 |
| 53 | for a ulong 36 |
| 54 | n = add n ulong get seen a |
| 55 | end |
| 56 | for a ulong 1296 |
| 57 | e = add e ulong get edges a |
| 58 | end |
| 59 | if or ne n 18 ne e 78 |
| 60 | w = write 1 fail 0 len fail |
| 61 | ret 1 |
| 62 | end |
| 63 | if eq argcnt 2 |
| 64 | if ne argread 1 arg 0 len arg long len edgearg |
| 65 | ret 2 |
| 66 | end |
| 67 | for i ulong len edgearg |
| 68 | if ne get arg i get edgearg i |
| 69 | ret 2 |
| 70 | end |
| 71 | end |
| 72 | w = write 1 edges 0 len edges |
| 73 | if ne w long len edges |
| 74 | ret 3 |
| 75 | end |
| 76 | ret 0 |
| 77 | end |
| 78 | if ne argcnt 1 |
| 79 | ret 2 |
| 80 | end |
| 81 | w = write 1 pass 0 len pass |
| 82 | ret 0 |
| 83 | end |