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 / control_nostruct.om
| 1 | note control_nostruct.om: the same bool logic as local_value.om and func_value.om with NO struct: |
| 2 | note bool locals, not, comparison and a bool-returning function. It works with the current |
| 3 | note compiler, so the bool operations are sound and only the struct field is at fault. |
| 4 | note t u a b = true false true false read back as 1 + 2 + 4 + 8 = 15. |
| 5 | fn big x uint to bool |
| 6 | ret gt x 3 |
| 7 | end |
| 8 | fn main to uint |
| 9 | x = uint 2 |
| 10 | t = lt x 3 |
| 11 | u = not t |
| 12 | a = big 5 |
| 13 | b = big 2 |
| 14 | r = uint 0 |
| 15 | if eq t true |
| 16 | r = add r 1 |
| 17 | end |
| 18 | if eq u false |
| 19 | r = add r 2 |
| 20 | end |
| 21 | if eq a true |
| 22 | r = add r 4 |
| 23 | end |
| 24 | if eq b false |
| 25 | r = add r 8 |
| 26 | end |
| 27 | ret r |
| 28 | end |