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 / tests / one_layer / generalization / records / raw / raw-spread4.rec

47 lines · 1698 bytes Raw Blame History
1gen-record 1
2id raw-spread4
3kind raw
4split probe
5family gs1-1fd45a53360ad17c
6entry spread4
7params u32 u32 u32 u32
8ret u64
9signature fn spread4 a uint b uint c uint d uint to ulong
10desc four times the largest of four values minus their sum, with max4 and sum4 helpers
11receipt b4b552f2bd368ce241a94ab7ca5022228c55cdb3af8bc3718edd1fb043eefa78
12validity verified
13ancestry spread4 8f086e170868181ef9b984cfc67ad95b54cb99d594b17725c15afa2578d0cbd2
14source tests/one_layer/generalization/corpus/META 179c34c50f6d843d41b10aabdbd69c425248a3107e107c64630836199e15ab0b
15source tests/one_layer/generalization/corpus/PROBES 26e6c6269103dfb9a6b12a99c0702896291211b850993e75a7d4ac90965b2f96
16source tests/one_layer/generalization/corpus/tasks/spread4/desc f6f911895f1e97abca1220584ee3b3be475e43e0aa96806b488a4c322035a95c
17source tests/one_layer/generalization/corpus/tasks/spread4/expected 60f3654946ccef20645f11af76dbb0f329e6b361ca91820c764561e65395375e
18source tests/one_layer/generalization/corpus/tasks/spread4/inputs 792f751acee6771df4071b7424035913f3913927e77633d6f4c49d866c541ce8
19source tests/one_layer/generalization/corpus/tasks/spread4/requirement 3891e78cd612ae6d3e91a68015c51527612bdc1d7be38bda7866591831fcd2a1
20source tests/one_layer/generalization/corpus/tasks/spread4/solution.omegese 8f086e170868181ef9b984cfc67ad95b54cb99d594b17725c15afa2578d0cbd2
21body
22fn max4 v view uint 4 to uint
23m = get v 0
24for i uint 4
25if gt get v i m
26m = get v i
27end
28end
29ret m
30end
31fn sum4 v view uint 4 to ulong
32s = ulong 0
33for i uint 4
34s = add s ulong get v i
35end
36ret s
37end
38fn spread4 a uint b uint c uint d uint to ulong
39v = new uint 4 0
40put v 0 a
41put v 1 b
42put v 2 c
43put v 3 d
44r = sub mul ulong max4 v 4 sum4 v
45free v
46ret r
47end