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 / sites / found-ca_st_ok-1.om

98 lines · 2725 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in ca_st_ok (code 7)
2om2
3 note semhash fixture: the base unit every case is diffed against
4const lim ulong 7
5global buf uchar 16
6struct pt px uint py uint end
7layout lay 8
8field fa uchar at 0 little
9field fb ushort at 1 little
10end
11
12note reformatted: fn leaf a ulong b ulong to ulong
13fn leaf a ulong b ulong to ulong
14 ret add a b
15end
16
17note reformatted: fn mid x ulong to ulong
18fn mid x ulong to ulong
19 y = leaf x 3
20 ret mul y 2
21end
22
23note reformatted: fn top n ulong to ulong
24fn top n ulong to ulong
25 r = mid n
26 ret add r 1
27end
28
29note reformatted: fn other s ulong to ulong
30fn other s ulong to ulong
31 ret xor s 5
32end
33
34note reformatted: fn psub a ulong b ulong to ulong
35fn psub a ulong b ulong to ulong
36 ret sub a b
37end
38
39note reformatted: fn useconst v ulong to ulong
40fn useconst v ulong to ulong
41 ret add v lim
42end
43
44note reformatted: fn useglob i ulong to ulong
45fn useglob i ulong to ulong
46 put buf 0 uchar i
47 ret len buf
48end
49
50note reformatted: fn callargs u ulong to ulong
51fn callargs u ulong to ulong
52 ret psub u 2
53end
54
55note reformatted: fn rdlay c view lay i ulong to ulong
56fn rdlay c view lay i ulong to ulong
57 ret ulong get c i
58end
59
60note reformatted: fn sumpt p view pt to ulong
61fn sumpt p view pt to ulong
62 q = ulong get p px
63 ret add q ulong get p py
64end
65
66note reformatted: fn iseven n ulong to bool
67fn iseven n ulong to bool
68 if eq n 0
69 ret true
70end
71 ret isodd sub n 1
72end
73
74note reformatted: fn isodd n ulong to bool
75fn isodd n ulong to bool
76 if eq n 0
77 ret false
78end
79 ret iseven sub n 1
80end
81
82note reformatted: fn main to int
83fn main to int
84 c = new uchar 8 0
85 put c 1 9
86 p = new pt 3 4
87 t = add top 1 other 2
88 t = add t psub 9 4
89 t = add t useconst 1
90 t = add t useglob 2
91 t = add t callargs 5
92 t = add t rdlay c 1
93 t = add t sumpt edit p
94 if iseven t
95 t = add t 64
96end
97 ret int rem t 251
98end