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 / omc / sites / found-arrpart-3.om
| 1 | note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in arrpart (code 7) |
| 2 | note S4 part (spec 6): parts of a local (an edit), of an unsized edit, of an unsized view and of a |
| 3 | note text; `view part` of an edit; an empty part at the end; a part passed to an inline function; o and k |
| 4 | note from calls. The callee sees len = k and elements o .. o+k-1. Exit 0 when every check holds. |
| 5 | om2 |
| 6 | text msg "0123456789" |
| 7 | fn plen v view uchar * to ulong |
| 8 | ret len v |
| 9 | end |
| 10 | fn first v view uchar * to ulong |
| 11 | ret ulong get v 0 |
| 12 | end |
| 13 | fn fill e edit uchar * c uchar to ulong |
| 14 | for i ulong len e |
| 15 | put e i c |
| 16 | end |
| 17 | ret add plen edit part e 1 1 len e |
| 18 | end |
| 19 | fn ifirst v view uchar * to ulong inline |
| 20 | ret ulong get v 0 |
| 21 | end |
| 22 | fn sub2 v view uchar * o ulong to ulong |
| 23 | ret first part v o 2 |
| 24 | end |
| 25 | fn two to ulong |
| 26 | ret 2 |
| 27 | end |
| 28 | fn main to int |
| 29 | a = new uchar 10 46 |
| 30 | if ne fill part a 3 4 88 5 |
| 31 | ret 1 |
| 32 | end |
| 33 | if ne get a 2 46 |
| 34 | ret 2 |
| 35 | end |
| 36 | if ne get a 6 88 |
| 37 | ret 3 |
| 38 | end |
| 39 | if ne get a 7 46 |
| 40 | ret 4 |
| 41 | end |
| 42 | if ne first part msg 7 3 55 |
| 43 | ret 5 |
| 44 | end |
| 45 | if ne sub2 msg 4 52 |
| 46 | ret 6 |
| 47 | end |
| 48 | if ne plen part a 10 0 0 |
| 49 | ret 7 |
| 50 | end |
| 51 | if ne ifirst part msg 9 1 57 |
| 52 | ret 8 |
| 53 | end |
| 54 | if ne plen part a two add two 1 3 |
| 55 | ret 9 |
| 56 | end |
| 57 | if ne ifirst view part a 6 two 88 |
| 58 | ret 10 |
| 59 | end |
| 60 | ret 0 |
| 61 | end |