code wiki / _hdl_build / nx_geo_h3_gate.nx

nx_geo_h3_gate.nx

buildroot/runtime/_hdl_build/nx_geo_h3_gate.nx

4357 B103 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic geo
docsdependenciesstructsconstsfunctions

about

nx_geo_h3_gate.nx -- GATE for GEO-018 H3-class hexagonal cell index. Proves correctness AND the integer-exact uniform-adjacency exceed over a square grid: cube : axial (2,-1) -> cube (2,-1,-1), q+r+s == 0 distance : dist((0,0),(0,0))=0, dist((0,0),(1,0))=1 (neighbour), dist((0,0),(2,-1))=2 UNIFORM : all 6 hex neighbours have norm2 == 1 (hex_minN==hex_maxN==1) -- equidistant exceed : square Moore-8 neighbours have norm2 in {1,2} (sq_minN=1, sq_maxN=2) -- NON-uniform ring/disk : ring(0)=1, ring(2)=12, disk(1)=7, disk(2)=19 (centered hexagonal numbers) Evidence -> knowledge/status/geo_h3.log (GEOH3GATE authored=organ ... verdict=GREEN). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_geo_h3.nx nx_syscalls.nx nx_geo_h3_gate.nx

imports: nx_geo_h3.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap geo_hex_axial_to_cube geo_hex_distance geo_h3_abs geo_hex_neighbor geo_hex_norm2 geo_hex_ring_size geo_hex_disk_size h3_emit h3_w sys_write h3_wn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close

structs

none

consts

14const GH3_LOG: *u8 = "knowledge/status/geo_h3.log"

functions

16func h3_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 }
called by 1: h3_emit calls 1: sys_write
17func h3_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 }
called by 1: h3_emit calls 2: sys_mmapsys_write
19func h3_emit(fd: i64, cube_ok: i64, hmin: i64, hmax: i64, smin: i64, smax: i64, r2: i64, d2: i64, ok: i64) -> i64
called by 1: main calls 2: h3_wh3_wn
31func main() -> i64