interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / omc / tests / struct-bool / control_nostruct.om

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