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 / ng / front / cases / nom_abstract_op_order.om
| 1 | note Nominal operator operands: xor of two constructor calls evaluates the left operand first. The trace |
| 2 | note global records the order in decimal digits (left 1, right 2): 12. Exit is the trace. |
| 3 | om2 |
| 4 | abstract dup32 ulong ops xor |
| 5 | holds dup32 dup32 |
| 6 | global tr ulong 1 |
| 7 | fn dup32mk x uint to dup32 |
| 8 | ret seal dup32 or shl ulong x 32 ulong x |
| 9 | end |
| 10 | fn left to dup32 |
| 11 | put tr 0 add mul get tr 0 10 1 |
| 12 | ret dup32mk 3 |
| 13 | end |
| 14 | fn right to dup32 |
| 15 | put tr 0 add mul get tr 0 10 2 |
| 16 | ret dup32mk 5 |
| 17 | end |
| 18 | fn main to int |
| 19 | v = xor left right |
| 20 | if ne open v 0x0000000600000006 |
| 21 | ret 1 |
| 22 | end |
| 23 | ret int get tr 0 |
| 24 | end |