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 / ng / bench / slice / wl3.awk.txt

27 lines · 1356 bytes Raw Blame History
1# ngbench v2 rows -> Wolfram data (reformatting only, no arithmetic):
2# d = <|{"case","arm"} -> <|block -> {wall1, wall2}, ..|>, ..|> (measured blocks: warm = 0)
3# r = the same with INPROC_NS
4# cont = {{block, "case"}, ..} (v3 K rows with contaminated=1 or busy=1; busyl: busy=1 only; contl: contaminated=1 only)
5$1 == "T" && $3 == 0 {
6 k = $4 "|" $5
7 if (!(k in seen)) { seen[k] = 1; order[++nk] = k }
8 kb = k SUBSEP $2
9 if (!(kb in w)) { blist[k] = blist[k] " " $2 }
10 w[kb] = (kb in w) ? w[kb] "," $7 : $7
11 r[kb] = (kb in r) ? r[kb] "," $10 : $10
12}
13$1 == "K" && ($6 == "contaminated=1" || $7 == "busy=1") { cont = cont (cont == "" ? "" : ",") "{" $2 ",\"" $3 "\"}" }
14$1 == "K" && $7 == "busy=1" { busyl = busyl (busyl == "" ? "" : ",") "{" $2 ",\"" $3 "\"}" }
15$1 == "K" && $6 == "contaminated=1" { contl = contl (contl == "" ? "" : ",") "{" $2 ",\"" $3 "\"}" }
16function emit(name, arr, i, k, p, n, b, j, s) {
17 printf "%s = <|", name
18 for (i = 1; i <= nk; i++) {
19 k = order[i]; split(k, p, "|")
20 printf "%s{\"%s\",\"%s\"}-><|", (i > 1 ? "," : ""), p[1], p[2]
21 n = split(blist[k], b, " "); s = ""
22 for (j = 1; j <= n; j++) { printf "%s%s->{%s}", s, b[j], arr[k SUBSEP b[j]]; s = "," }
23 printf "|>"
24 }
25 print "|>;"
26}
27END { emit("d", w); emit("r", r); print "cont = {" cont "};"; print "busyl = {" busyl "};"; print "contl = {" contl "};" }