code wiki / _hdl_build / nx_geo_union_gate.nx
nx_geo_union_gate.nx
buildroot/runtime/_hdl_build/nx_geo_union_gate.nx
about
nx_geo_union_gate.nx -- GATE for GEO-016 polygon union/intersection measure (inclusion-exclusion).
A = [0,4e6]^2 (doubled area 3.2e13). Three B polygons prove inclusion-exclusion exactly:
overlap B=[2e6,6e6]^2 : A n B = 8e12 -> union = 3.2e13+3.2e13-8e12 = 5.6e13; iou = 8e12/5.6e13 = 142permil
disjoint B=[10e6,14e6]^2 : A n B = 0 -> union = 6.4e13 (purely additive); iou = 0
contain B=[1e6,3e6]^2 : A n B = 8e12 = area(B) -> union = 3.2e13 (= area(A)); iou = 8e12/3.2e13 = 250permil
Evidence -> knowledge/status/geo_union.log (GEOUNIONGATE authored=organ ... verdict=GREEN).
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_geo_union.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const GU_LOG: *u8 = "knowledge/status/geo_union.log" |
functions
| 14 | func gu_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 15 | func gu_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 17 | func gu_set(p: *i64, i: i64, lat: i64, lon: i64) -> i64 { p[i * 2] = lat; p[i * 2 + 1] = lon; return 0 } called by 1: gu_square |
| 18 | func gu_square(p: *i64, lo: i64, hi: i64) -> i64 { gu_set(p, 0, lo, lo); gu_set(p, 1, lo, hi); gu_set(p, 2, hi, hi); gu_set(p, 3, hi, lo); return 0 } |
| 20 | func gu_emit(fd: i64, uO: i64, iouO: i64, uD: i64, uC: i64, iouC: i64, ok: i64) -> i64 |
| 30 | func main() -> i64 |