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 / bridge / shlib / imp.tsv

37 lines · 1341 bytes Raw Blame History
1# SPDX-License-Identifier: Apache-2.0
2# bridge/shlib/imp.tsv: the gate's import library: imports from libomshdep.so.1 (dep.tsv, found beside it
3# through $ORIGIN) and the C library, three states, and a lock taken with pthread_mutex_trylock, so a lock left
4# held makes the next call answer its TRAP value instead of waiting.
5soname libomshimp.so.1
6needed libomshdep.so.1
7needed libc.so.6
8runpath $ORIGIN
9state ImpS 64
10state ImpT 4096
11state ImpL 64
12lock ImpL pthread_mutex_trylock pthread_mutex_unlock
13import omega_dep_sub s1 s0
14import omega_dep_rd s0+8
15export omega_imp_live 999 frame
16export omega_imp_count 999 frame ImpS
17export omega_imp_trap 999 frame
18export omega_imp_dirty 999 frame
19export omega_imp_swap 999 frame
20export omega_imp_off 999 frame ImpT
21export omega_imp_strlen 999 frame ImpT
22export omega_imp_frame 999 frame
23# live: a = 10: c..f 12..15, twice 10 and 11 = 20 and 22, b 11: 12+13+14+15+20+22+11 = 107
24call omega_imp_live 107 10
25call omega_imp_count 1
26call omega_imp_count 2
27# a trap (division by 0) answers 999 and releases the lock: the next call runs
28call omega_imp_trap 999 1 0
29call omega_imp_count 3
30call omega_imp_trap 3 9 3
31call omega_imp_dirty 6
32# swap: dep's sub gets (b, a): 5 - 3
33call omega_imp_swap 2 3 5
34call omega_imp_off 77 77
35call omega_imp_strlen 300 300
36call omega_imp_frame 55 1 55
37call omega_imp_count 4