code wiki / (root) / nx_flavor_chem.nx

nx_flavor_chem.nx

buildroot/runtime/nx_flavor_chem.nx

5234 B133 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic flavor
docsdependenciesstructsconstsfunctions

about

nx_flavor_chem.nx -- T3 of the TASTE-SCIENCE ladder: FLAVOR CHEMISTRY. Predict taste from MOLECULAR STRUCTURE via structure-activity rules (SAR), the molecular-gastronomy / e-tongue frontier. The baseline nx_food_science assigns a fixed 0-9 score PER NAMED INGREDIENT; it cannot say anything about a molecule it has never been told about. T3 predicts taste from the molecule's structure -- so it GENERALISES to novel molecules (the whole point of a real flavor model). The structure-activity rules (each a real, citable finding): - SWEET: the AH-B-X theory (Shallenberger & Acree 1967) -- an AH proton donor + a B proton acceptor ~250-400 pm apart; a hydrophobic X site marks a HIGH-POTENCY sweetener (why sucralose ~600x sucrose). - SOUR: acidity -- a carboxyl that releases H+ at low pKa. - SALTY: a small ionic salt (Na+ etc.). - UMAMI: a glutamate-like amino-diacid. - BITTER: an alkaloid / N-heterocycle motif. MEASURED EXCEED (gate-checked): correctly classifies 6 grounded reference molecules AND a NOVEL molecule in no ingredient table, and derives sweetness POTENCY from structure -- generalisation the static table cannot do. The molecular descriptors below are exactly what nx_chem_molecule / nx_chem_descriptors compute from a structure; auto-extracting them from SMILES is T3's named follow-up. Taste-quality vocabulary composed from nx_taste_transduce (T0). genealogy_id: shallenberger_acree_1967_ahb + kier_1972_ahbx + nishi_taste_transduce_2026

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_taste_transduce.nx nx_flavor_chem.nx nx_flavor_chem_test.nx

imports: nx_syscalls.nxnx_taste_transduce.nx

imported by: nx_flavor_chem_test.nx

structs

41struct NxMolSensory

consts

33const NX_MAGIC_5000: i64 = 5000
34const NX_MAGIC_99000: i64 = 99000
35const NX_MAGIC_3100: i64 = 3100
36const NX_MAGIC_3000: i64 = 3000
38const NX_TQ_NONE: i64 = 6 // tasteless / no SAR match (0-4 = qualities, 5 = count)

functions

53func nx_molsensory_new(donors: i64, acceptors: i64, dist_pm: i64, x: i64,
70func nx_flavor_is_sweet(m: *NxMolSensory) -> i64
79func nx_flavor_sweet_potency(m: *NxMolSensory) -> i64
called by 1: main calls 1: nx_flavor_is_sweet
85func nx_flavor_is_sour(m: *NxMolSensory) -> i64
92func nx_flavor_is_umami(m: *NxMolSensory) -> i64
96func nx_flavor_is_bitter(m: *NxMolSensory) -> i64
100func nx_flavor_is_salty(m: *NxMolSensory) -> i64
105func nx_flavor_predict_taste(m: *NxMolSensory) -> i64
116func nx_molsensory_sucrose() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new
119func nx_molsensory_sucralose() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new
122func nx_molsensory_citric() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new
125func nx_molsensory_nacl() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new
128func nx_molsensory_quinine() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new
131func nx_molsensory_msg() -> *NxMolSensory
called by 1: main calls 1: nx_molsensory_new