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 / local_value.om
| 1 | note local_value.om: bool values held in locals (a comparison, a not, a read back from the field) |
| 2 | note go into new and put. t = lt x 3 with x = 2 (true), u = not t (false), v = get w f. Result 1 + 2 + 4. |
| 3 | struct W a uint f bool end |
| 4 | fn main to uint |
| 5 | x = uint 2 |
| 6 | t = lt x 3 |
| 7 | u = not t |
| 8 | w = new W 1 t |
| 9 | r = uint 0 |
| 10 | if eq get w f true |
| 11 | r = add r 1 |
| 12 | end |
| 13 | put w f u |
| 14 | v = get w f |
| 15 | if eq v false |
| 16 | r = add r 2 |
| 17 | end |
| 18 | put w f t |
| 19 | v = get w f |
| 20 | if eq v true |
| 21 | r = add r 4 |
| 22 | end |
| 23 | ret r |
| 24 | end |