nx_calc.nx
buildroot/runtime/nx_calc.nx
about
nx_calc.nx -- symbolic calculus engine.
Native NishiLang symbolic differentiation by structural recursion
over Term values. No third-party CAS; output is itself a *Term that
downstream proofs can manipulate via SUBST/EQ_TRANS in the v2 kernel.
Patent-clean implementation: standard derivative rules from any
calculus textbook.
dependencies 1 imports · 4 importers
imports: nx_kernel_v2.nx
imported by: nx_calc_integrate.nxnx_calc_series.nxnx_calc_solve.nxnx_capabilities_test.nx
structs
| none |
consts
| 19 | const NX_CALC_SYM_X: nx_int = 414001 // distinguished variable |
| 20 | const NX_CALC_SYM_ADD: nx_int = 414002 |
| 21 | const NX_CALC_SYM_SUB: nx_int = 414003 |
| 22 | const NX_CALC_SYM_MUL: nx_int = 414004 |
| 23 | const NX_CALC_SYM_DIV: nx_int = 414005 |
| 24 | const NX_CALC_SYM_POW: nx_int = 414006 |
| 25 | const NX_CALC_SYM_NEG: nx_int = 414007 |
| 26 | const NX_CALC_SYM_SIN: nx_int = 414008 |
| 27 | const NX_CALC_SYM_COS: nx_int = 414009 |
| 28 | const NX_CALC_SYM_EXP: nx_int = 414010 |
| 29 | const NX_CALC_SYM_LN: nx_int = 414011 |
| 30 | const NX_CALC_SYM_CONST: nx_int = 414012 // wraps an integer literal |
functions
| 33 | func nx_calc_var(var_id: nx_int) -> *Term calls 1: nx_term_var |
| 37 | func nx_calc_const_int(n: nx_int) -> *Term called by 17: nx_calc_derivt2_subst_constt4_maclaurin_constt5_maclaurin_x2t6_solve_lineart7_solve_quadratic+11 calls 1: nx_term_app |
| 43 | func nx_calc_x() -> *Term { return nx_term_var(NX_CALC_SYM_X) } |
| 45 | func nx_calc_bin(sym: nx_int, a: *Term, b: *Term) -> *Term called by 10: nx_calc_addnx_calc_subnx_calc_mulnx_calc_pownx_calc_derivnx_calc_integrate+4 calls 1: nx_term_app |
| 54 | func nx_calc_un(sym: nx_int, a: *Term) -> *Term called by 7: nx_calc_sinnx_calc_cosnx_calc_expnx_calc_lnnx_calc_derivnx_calc_neg_cos+1 calls 1: nx_term_app |
| 60 | func nx_calc_add(a: *Term, b: *Term) -> *Term { return nx_calc_bin(NX_CALC_SYM_ADD, a, b) } |
| 61 | func nx_calc_sub(a: *Term, b: *Term) -> *Term { return nx_calc_bin(NX_CALC_SYM_SUB, a, b) } |
| 62 | func nx_calc_mul(a: *Term, b: *Term) -> *Term { return nx_calc_bin(NX_CALC_SYM_MUL, a, b) } |
| 63 | func nx_calc_pow(a: *Term, b: *Term) -> *Term { return nx_calc_bin(NX_CALC_SYM_POW, a, b) } |
| 64 | func nx_calc_sin(a: *Term) -> *Term { return nx_calc_un(NX_CALC_SYM_SIN, a) } |
| 65 | func nx_calc_cos(a: *Term) -> *Term { return nx_calc_un(NX_CALC_SYM_COS, a) } |
| 66 | func nx_calc_exp(a: *Term) -> *Term { return nx_calc_un(NX_CALC_SYM_EXP, a) } |
| 67 | func nx_calc_ln(a: *Term) -> *Term { return nx_calc_un(NX_CALC_SYM_LN, a) } |
| 90 | func nx_calc_deriv(t: *Term, var_id: nx_int) -> *Term |