code wiki / (root) / nx_compare_systems_test.nx

nx_compare_systems_test.nx source

↩ module page · 222 lines · 13115 B

1// nx_compare_systems_test.nx -- run the comparison engine vs each peer. 2 3import "nx_compare_systems.nx" 4 5// ===== vs HOL Light =============================================== 6func compare_vs_hol_light() -> nx_int { 7 println("=========================================================" as *u8) 8 println("vs HOL Light (Harrison, ~500 LOC OCaml kernel, FOL+ML)" as *u8) 9 println("=========================================================" as *u8) 10 let _r1: nx_int = nx_compare_row(NX_AXIS_KERNEL_LOC, NX_PEER_HOL_LIGHT, 11 "~340 LOC NishiLang" as *u8, "~500 LOC OCaml" as *u8, 12 NX_VERDICT_WIN, "" as *u8) 13 let _r2: nx_int = nx_compare_row(NX_AXIS_LCF_DISCIPLINE, NX_PEER_HOL_LIGHT, 14 "yes (DISCH+THM rules)" as *u8, "yes (LCF inventor)" as *u8, 15 NX_VERDICT_TIE, "" as *u8) 16 let _r3: nx_int = nx_compare_row(NX_AXIS_NATIVE_TARGET, NX_PEER_HOL_LIGHT, 17 "RV64 + x86_64 native" as *u8, "OCaml bytecode" as *u8, 18 NX_VERDICT_WIN_BIG, "" as *u8) 19 let _r4: nx_int = nx_compare_row(NX_AXIS_DEPENDENCY_FREE, NX_PEER_HOL_LIGHT, 20 "zero deps" as *u8, "OCaml + camlp5" as *u8, 21 NX_VERDICT_WIN, "" as *u8) 22 let _r5: nx_int = nx_compare_row(NX_AXIS_TACTIC_LANG, NX_PEER_HOL_LIGHT, 23 "nx_tactics (8 tactics)" as *u8, "REWRITE/MESON/INDUCT" as *u8, 24 NX_VERDICT_LOSE, "build REWRITE_TAC + MESON-style auto" as *u8) 25 let _r6: nx_int = nx_compare_row(NX_AXIS_AUTO_PROVER, NX_PEER_HOL_LIGHT, 26 "nx_prove propositional" as *u8, "MESON FOL" as *u8, 27 NX_VERDICT_LOSE, "extend nx_prove to first-order via skolem" as *u8) 28 let _r7: nx_int = nx_compare_row(NX_AXIS_SEMANTIC_REJECT, NX_PEER_HOL_LIGHT, 29 "yes (Term-shape check)" as *u8, "yes (HOL type check)" as *u8, 30 NX_VERDICT_TIE, "" as *u8) 31 let _r8: nx_int = nx_compare_row(NX_AXIS_LIBRARY_SIZE, NX_PEER_HOL_LIGHT, 32 "~4274 funcs / 1 thm" as *u8, "~10000 thms" as *u8, 33 NX_VERDICT_LOSE_BIG, "ship OpenTheory replay engine + arith library" as *u8) 34 let _r9: nx_int = nx_compare_row(NX_AXIS_LOGIC, NX_PEER_HOL_LIGHT, 35 "intuitionistic + LEM axiom" as *u8, "classical HOL" as *u8, 36 NX_VERDICT_TIE, "" as *u8) 37 let _r10: nx_int = nx_compare_row(NX_AXIS_CLASSICAL_AXIOMS, NX_PEER_HOL_LIGHT, 38 "LEM/DNE/Peirce explicit" as *u8, "default" as *u8, 39 NX_VERDICT_WIN, "" as *u8) 40 let _r11: nx_int = nx_compare_row(NX_AXIS_VISUAL_NATIVE, NX_PEER_HOL_LIGHT, 41 "CLI ASCII + SVG native" as *u8, "none" as *u8, 42 NX_VERDICT_WIN_BIG, "" as *u8) 43 let _r12: nx_int = nx_compare_row(NX_AXIS_PHYSICS, NX_PEER_HOL_LIGHT, 44 "nx_units 7-D dim" as *u8, "none" as *u8, 45 NX_VERDICT_WIN_BIG, "" as *u8) 46 let _r13: nx_int = nx_compare_row(NX_AXIS_BITS_UP_BUILD, NX_PEER_HOL_LIGHT, 47 "RV64 asm out, no CRT" as *u8, "OCaml runtime" as *u8, 48 NX_VERDICT_WIN_BIG, "" as *u8) 49 return 0 50} 51 52// ===== vs Coq ====================================================== 53func compare_vs_coq() -> nx_int { 54 println("" as *u8) 55 println("=========================================================" as *u8) 56 println("vs Coq (Calculus of Inductive Constructions, dependent types)" as *u8) 57 println("=========================================================" as *u8) 58 let _r1: nx_int = nx_compare_row(NX_AXIS_KERNEL_LOC, NX_PEER_COQ, 59 "~340 LOC" as *u8, "~30000 LOC OCaml" as *u8, 60 NX_VERDICT_WIN_BIG, "" as *u8) 61 let _r2: nx_int = nx_compare_row(NX_AXIS_LOGIC, NX_PEER_COQ, 62 "intuitionistic + LEM" as *u8, "CIC dependent types" as *u8, 63 NX_VERDICT_LOSE, "add dependent-type kernel rules (Pi/Sigma)" as *u8) 64 let _r3: nx_int = nx_compare_row(NX_AXIS_TACTIC_LANG, NX_PEER_COQ, 65 "8 basic tactics" as *u8, "Ltac/Ltac2 + plugins" as *u8, 66 NX_VERDICT_LOSE_BIG, "ship Ltac-equivalent metaprogramming layer" as *u8) 67 let _r4: nx_int = nx_compare_row(NX_AXIS_AUTO_PROVER, NX_PEER_COQ, 68 "nx_prove propositional" as *u8, "tauto/firstorder/lia/nia" as *u8, 69 NX_VERDICT_LOSE, "ship lia (Presburger) + nia decision procs" as *u8) 70 let _r5: nx_int = nx_compare_row(NX_AXIS_LIBRARY_SIZE, NX_PEER_COQ, 71 "~4274 funcs" as *u8, "~50000 stdlib lemmas" as *u8, 72 NX_VERDICT_LOSE_BIG, "build .v export parser to ingest stdlib" as *u8) 73 let _r6: nx_int = nx_compare_row(NX_AXIS_NATIVE_TARGET, NX_PEER_COQ, 74 "RV64 + x86_64" as *u8, "OCaml bytecode" as *u8, 75 NX_VERDICT_WIN_BIG, "" as *u8) 76 let _r7: nx_int = nx_compare_row(NX_AXIS_DEPENDENCY_FREE, NX_PEER_COQ, 77 "zero deps" as *u8, "OCaml + opam ecosystem" as *u8, 78 NX_VERDICT_WIN, "" as *u8) 79 let _r8: nx_int = nx_compare_row(NX_AXIS_VISUAL_NATIVE, NX_PEER_COQ, 80 "ASCII + SVG native" as *u8, "CoqIDE / Proof General (Emacs)" as *u8, 81 NX_VERDICT_WIN, "" as *u8) 82 let _r9: nx_int = nx_compare_row(NX_AXIS_PHYSICS, NX_PEER_COQ, 83 "nx_units" as *u8, "none in stdlib" as *u8, 84 NX_VERDICT_WIN_BIG, "" as *u8) 85 return 0 86} 87 88// ===== vs Lean 4 =================================================== 89func compare_vs_lean4() -> nx_int { 90 println("" as *u8) 91 println("=========================================================" as *u8) 92 println("vs Lean 4 (CIC + meta + Mathlib4)" as *u8) 93 println("=========================================================" as *u8) 94 let _r1: nx_int = nx_compare_row(NX_AXIS_KERNEL_LOC, NX_PEER_LEAN4, 95 "~340 LOC NishiLang" as *u8, "~10000 LOC C++" as *u8, 96 NX_VERDICT_WIN_BIG, "" as *u8) 97 let _r2: nx_int = nx_compare_row(NX_AXIS_LIBRARY_SIZE, NX_PEER_LEAN4, 98 "~4274 funcs" as *u8, "~200000 Mathlib4 lemmas" as *u8, 99 NX_VERDICT_LOSE_BIG, "Mathport-style .lean parser to NishiLang" as *u8) 100 let _r3: nx_int = nx_compare_row(NX_AXIS_TACTIC_LANG, NX_PEER_LEAN4, 101 "8 basic tactics" as *u8, "Lean elab/macro" as *u8, 102 NX_VERDICT_LOSE_BIG, "ship metaprogramming Term DSL" as *u8) 103 let _r4: nx_int = nx_compare_row(NX_AXIS_AUTO_PROVER, NX_PEER_LEAN4, 104 "nx_prove propositional" as *u8, "decide/omega/polyrith" as *u8, 105 NX_VERDICT_LOSE, "ship omega Presburger + polyrith Groebner" as *u8) 106 let _r5: nx_int = nx_compare_row(NX_AXIS_NATIVE_TARGET, NX_PEER_LEAN4, 107 "RV64 + x86_64 native" as *u8, "C codegen via lean->cpp" as *u8, 108 NX_VERDICT_WIN, "" as *u8) 109 let _r6: nx_int = nx_compare_row(NX_AXIS_DEPENDENCY_FREE, NX_PEER_LEAN4, 110 "zero deps" as *u8, "GMP + LLVM + cpp" as *u8, 111 NX_VERDICT_WIN, "" as *u8) 112 let _r7: nx_int = nx_compare_row(NX_AXIS_VISUAL_NATIVE, NX_PEER_LEAN4, 113 "ASCII + SVG native" as *u8, "VSCode plugin" as *u8, 114 NX_VERDICT_WIN, "" as *u8) 115 return 0 116} 117 118// ===== vs Isabelle ================================================= 119func compare_vs_isabelle() -> nx_int { 120 println("" as *u8) 121 println("=========================================================" as *u8) 122 println("vs Isabelle/HOL (Cambridge/TUM, Pure + HOL + AFP)" as *u8) 123 println("=========================================================" as *u8) 124 let _r1: nx_int = nx_compare_row(NX_AXIS_KERNEL_LOC, NX_PEER_ISABELLE, 125 "~340 LOC" as *u8, "~10000 LOC SML" as *u8, 126 NX_VERDICT_WIN_BIG, "" as *u8) 127 let _r2: nx_int = nx_compare_row(NX_AXIS_AUTO_PROVER, NX_PEER_ISABELLE, 128 "nx_prove propositional" as *u8, "Sledgehammer + Isar" as *u8, 129 NX_VERDICT_LOSE_BIG, "Sledgehammer-class FOL ATP integration" as *u8) 130 let _r3: nx_int = nx_compare_row(NX_AXIS_LIBRARY_SIZE, NX_PEER_ISABELLE, 131 "~4274 funcs" as *u8, "AFP ~700+ entries / 100K+ lemmas" as *u8, 132 NX_VERDICT_LOSE_BIG, "AFP .thy parser -> NishiLang Term replay" as *u8) 133 let _r4: nx_int = nx_compare_row(NX_AXIS_NATIVE_TARGET, NX_PEER_ISABELLE, 134 "RV64 + x86_64 native" as *u8, "Poly/ML + JVM (jEdit IDE)" as *u8, 135 NX_VERDICT_WIN_BIG, "" as *u8) 136 let _r5: nx_int = nx_compare_row(NX_AXIS_DEPENDENCY_FREE, NX_PEER_ISABELLE, 137 "zero deps" as *u8, "Poly/ML + Java + Scala" as *u8, 138 NX_VERDICT_WIN, "" as *u8) 139 return 0 140} 141 142// ===== vs Mathematica ============================================= 143func compare_vs_mathematica() -> nx_int { 144 println("" as *u8) 145 println("=========================================================" as *u8) 146 println("vs Mathematica (Wolfram, closed-source CAS)" as *u8) 147 println("=========================================================" as *u8) 148 let _r1: nx_int = nx_compare_row(NX_AXIS_OPEN_SOURCE, NX_PEER_MATHEMATICA, 149 "MIT/Apache (open)" as *u8, "proprietary $$$" as *u8, 150 NX_VERDICT_WIN_BIG, "" as *u8) 151 let _r2: nx_int = nx_compare_row(NX_AXIS_LIBRARY_SIZE, NX_PEER_MATHEMATICA, 152 "~4274 callable" as *u8, "~5000 built-ins" as *u8, 153 NX_VERDICT_LOSE, "ship special-functions library + ODE solver" as *u8) 154 let _r3: nx_int = nx_compare_row(NX_AXIS_SYMBOLIC_CALC, NX_PEER_MATHEMATICA, 155 "nx_calc deriv + chain" as *u8, "D[]/Integrate[]/Series[]" as *u8, 156 NX_VERDICT_LOSE_BIG, "ship symbolic Integrate + Series + Solve" as *u8) 157 let _r4: nx_int = nx_compare_row(NX_AXIS_LCF_DISCIPLINE, NX_PEER_MATHEMATICA, 158 "yes" as *u8, "no (CAS-style trust)" as *u8, 159 NX_VERDICT_WIN_BIG, "" as *u8) 160 let _r5: nx_int = nx_compare_row(NX_AXIS_NATIVE_TARGET, NX_PEER_MATHEMATICA, 161 "RV64 + x86_64" as *u8, "WolframLang VM" as *u8, 162 NX_VERDICT_WIN, "" as *u8) 163 let _r6: nx_int = nx_compare_row(NX_AXIS_DEPENDENCY_FREE, NX_PEER_MATHEMATICA, 164 "zero deps" as *u8, "Wolfram engine 5+ GB" as *u8, 165 NX_VERDICT_WIN_BIG, "" as *u8) 166 let _r7: nx_int = nx_compare_row(NX_AXIS_PHYSICS, NX_PEER_MATHEMATICA, 167 "nx_units 7-D dims" as *u8, "QuantityMagnitude/Units" as *u8, 168 NX_VERDICT_LOSE, "ship Quantity arithmetic + unit conversion table" as *u8) 169 let _r8: nx_int = nx_compare_row(NX_AXIS_CHEMISTRY, NX_PEER_MATHEMATICA, 170 "nx_chem H..Ar" as *u8, "ChemicalData[] full table + reactions" as *u8, 171 NX_VERDICT_LOSE_BIG, "extend periodic table to 118 + balance reactions" as *u8) 172 let _r9: nx_int = nx_compare_row(NX_AXIS_VISUAL_NATIVE, NX_PEER_MATHEMATICA, 173 "ASCII + SVG" as *u8, "ListPlot/Plot/3D notebook" as *u8, 174 NX_VERDICT_LOSE, "ship 3D rendering + interactive plots" as *u8) 175 let _r10: nx_int = nx_compare_row(NX_AXIS_PROOF_OUTPUT, NX_PEER_MATHEMATICA, 176 "two-column + Term-tree" as *u8, "no formal proof output" as *u8, 177 NX_VERDICT_WIN_BIG, "" as *u8) 178 return 0 179} 180 181// ===== Aggregate scoreboard ======================================= 182func emit_summary() -> nx_int { 183 println("" as *u8) 184 println("=========================================================" as *u8) 185 println("AGGREGATE per-peer scoreboard" as *u8) 186 println("=========================================================" as *u8) 187 println(" vs HOL Light 7 WIN/WIN_BIG, 2 TIE, 4 LOSE/LOSE_BIG (13 axes)" as *u8) 188 println(" vs Coq 5 WIN/WIN_BIG, 0 TIE, 4 LOSE/LOSE_BIG ( 9 axes)" as *u8) 189 println(" vs Lean 4 4 WIN/WIN_BIG, 0 TIE, 3 LOSE/LOSE_BIG ( 7 axes)" as *u8) 190 println(" vs Isabelle 3 WIN/WIN_BIG, 0 TIE, 2 LOSE/LOSE_BIG ( 5 axes)" as *u8) 191 println(" vs Mathematica 5 WIN/WIN_BIG, 0 TIE, 5 LOSE/LOSE_BIG (10 axes)" as *u8) 192 println("" as *u8) 193 println(" WORLD-CLASS NET (combining all 5 peers):" as *u8) 194 println(" + WIN_BIG on: kernel_LOC, native_target, dependency_free, visual_native," as *u8) 195 println(" bits_up_build, open_source, LCF (vs CAS)" as *u8) 196 println(" + WIN on: classical_axioms (explicit citations), proof output" as *u8) 197 println(" - LOSE_BIG on: library_size (need ingestion engine)," as *u8) 198 println(" tactic language (need Ltac/elab equivalent)," as *u8) 199 println(" symbolic calculus (need Integrate/Solve)" as *u8) 200 println(" - LOSE on: auto_prover (need Presburger + Sledgehammer-class)," as *u8) 201 println(" chemistry (need full periodic table + reactions)" as *u8) 202 println("" as *u8) 203 println("HONEST WORLD-CLASS VERDICT (per cardinal feedback-honest-perf-verdict):" as *u8) 204 println(" We WIN on the SUBSTRATE-LEVEL axes (kernel size, native, deps, visual," as *u8) 205 println(" open source, bits-up build). We LOSE on the CORPUS-LEVEL axes" as *u8) 206 println(" (library size, tactic ecosystem, decision procedures, symbolic CAS)" as *u8) 207 println(" because those incumbents have 30+ years of contributors. We close" as *u8) 208 println(" the corpus gap with INGESTION ENGINES (OpenTheory replay / Mathport /" as *u8) 209 println(" AFP parser) -- one engine per peer system. Refused: claim 'world" as *u8) 210 println(" class on every axis' -- honest LOSE rows above forbid it." as *u8) 211 return 0 212} 213 214func main() -> nx_exit { 215 let _h: nx_int = compare_vs_hol_light() 216 let _c: nx_int = compare_vs_coq() 217 let _l: nx_int = compare_vs_lean4() 218 let _i: nx_int = compare_vs_isabelle() 219 let _m: nx_int = compare_vs_mathematica() 220 let _s: nx_int = emit_summary() 221 return 0 222}