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 / omc / tests / struct-bool / adjacent.om
| 1 | note adjacent.om: three bool fields in a row hold independent values. x y z = true false true |
| 2 | note reads as bits 1 + 4 = 5 (checked first); after put y true, put x false it reads 2 + 4 = 6. |
| 3 | struct B x bool y bool z bool end |
| 4 | fn main to uint |
| 5 | b = new B true false true |
| 6 | r = uint 0 |
| 7 | if eq get b x true |
| 8 | r = add r 1 |
| 9 | end |
| 10 | if eq get b y true |
| 11 | r = add r 2 |
| 12 | end |
| 13 | if eq get b z true |
| 14 | r = add r 4 |
| 15 | end |
| 16 | if ne r 5 |
| 17 | ret 90 |
| 18 | end |
| 19 | put b y true |
| 20 | put b x false |
| 21 | r = uint 0 |
| 22 | if eq get b x true |
| 23 | r = add r 1 |
| 24 | end |
| 25 | if eq get b y true |
| 26 | r = add r 2 |
| 27 | end |
| 28 | if eq get b z true |
| 29 | r = add r 4 |
| 30 | end |
| 31 | ret r |
| 32 | end |