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 / qualification / security673 / game / io.om

126 lines · 2506 bytes Raw Blame History
1note SC1-G transport only. No transition or invariant code is shared.
2global wire uchar 4096
3global pos ulong 1
4global avail ulong 1
5global digits uchar 32
6global samples ulong 101
7text nl "\n"
8text sp " "
9text tags "construct_ns=\nsolve_ns=\ncheck_ns=\nstates=\nedges=\nwinning=\nrounds=\narray_bytes=\nPASS SC1-G-v3 finite model only\nFAIL QUANTIFIER_CLOSURE\nFAIL OMITTED_DISTURBANCE_CLOSURE\nFAIL FRESHNESS_AT_RENAME\nFAIL UNCERTAIN_REFUND\nFAIL SELECTED_NOT_SAFE\nFAIL EARLY_STOP_CLOSURE\nFAIL CERTIFICATE\nPASS certified serial witnesses empty-set costs\nFAIL PAIRED_PRODUCT\ndistinct_hidden_states=\ndistinct_hidden_edges=\nsample_ns=\np50_ns=\np95_ns=\np99_ns=\nidentical_zero_states=\nidentical_zero_edges=\nWITNESS source action disturbance raw effective\nFAIL TRANSITION_CONFORMANCE\nFAIL CLOSURE\nFAIL SOURCE_INVARIANT\nFAIL DISABLED_ACTION\nFAIL EXACTNESS\nFAIL SELECTION_COST\n"
10fn label id uint to void
11p = ulong 0
12n = uint 0
13for j ulong len tags
14if eq get tags j 10
15if eq n id
16r = write 2 tags p add sub j p 1
17if ne r long add sub j p 1
18exit 90
19end
20ret
21end
22n = add n 1
23p = add j 1
24end
25end
26exit 90
27end
28fn number n ulong to void
29p = ulong 0
30while ge n 10 bound 32
31put digits p uchar add rem n 10 48
32n = div n 10
33p = add p 1
34end
35put digits p uchar add n 48
36p = add p 1
37for j ulong p
38r = write 2 digits sub sub p j 1 1
39if ne r 1
40exit 90
41end
42end
43r = write 2 nl 0 1
44if ne r 1
45exit 90
46end
47end
48fn mode to uint
49if eq argcnt 1
50ret 0
51end
52if ne argcnt 2
53exit 90
54end
55if ne argread 1 wire 0 1 1
56exit 90
57end
58m = get wire 0
59if or lt m 48 gt m 56
60exit 90
61end
62ret sub uint m 48
63end
64fn flush to void
65n = get pos 0
66if ne write 1 wire 0 n long n
67exit 90
68end
69put pos 0 0
70end
71fn sendword x uint to void
72for i ulong 4
73p = get pos 0
74put wire p uchar and shr x mul uint i 8 255
75put pos 0 add p 1
76if eq get pos 0 4096
77flush
78end
79end
80end
81fn recvword to uint
82x = uint 0
83for i ulong 4
84if eq get pos 0 get avail 0
85n = read 0 wire 0 len wire
86if le n 0
87exit 90
88end
89put avail 0 ulong n
90put pos 0 0
91end
92p = get pos 0
93x = or x shl uint get wire p mul uint i 8
94put pos 0 add p 1
95end
96ret x
97end
98fn endinput to void
99if ne get pos 0 get avail 0
100exit 90
101end
102if ne read 0 wire 0 len wire 0
103exit 90
104end
105end
106fn percentiles to void
107for i ulong 101
108label 20
109number get samples i
110end
111for i ulong 101
112for j ulong 100
113if gt get samples j get samples add j 1
114t = get samples j
115put samples j get samples add j 1
116put samples add j 1 t
117end
118end
119end
120label 21
121number get samples 50
122label 22
123number get samples 95
124label 23
125number get samples 99
126end