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-vt-fget-1.om
| 1 | note sites: found by a one-token change of a tracked program; reaches the omc error site in vt-fget (code 16) |
| 2 | note SPDX-License-Identifier: AGPL-3.0-only |
| 3 | note Combined gate: a struct value drives a native file operation in one program. |
| 4 | struct H x uint y ulong end |
| 5 | text path "structfile.tmp" |
| 6 | text body "ok\n" |
| 7 | fn main to int |
| 8 | h = new H 7 9 |
| 9 | put h y 42 |
| 10 | fd = int fopen path 0 len path 577 420 |
| 11 | if lt fd 0 |
| 12 | ret 1 |
| 13 | end |
| 14 | n = write fd body 0 len body |
| 15 | r = fclose fd |
| 16 | u = unlink path 0 len path |
| 17 | if ne n long len body |
| 18 | ret 2 |
| 19 | end |
| 20 | if ne r 0 |
| 21 | ret 3 |
| 22 | end |
| 23 | if ne u 0 |
| 24 | ret 4 |
| 25 | end |
| 26 | if eq get h 9999999 7 |
| 27 | if eq get h y 42 |
| 28 | ret 0 |
| 29 | end |
| 30 | end |
| 31 | ret 5 |
| 32 | end |