4 ms·
Worth noting that pattern matching and term rewriting are a sufficiently general combination that it forms the basis for Mathematica.
by dTal 2y ago
Worth noting that pattern matching and term rewriting are a sufficiently general combination that it forms the basis for Mathematica.
- psb217 2y agoTrouble sneaks in when the pattern matching is only correct most of the time. Eg, if some code for regex-based search missed anywhere from 0.1% to 10% of matches, with the miss rate depending on the regex and no obvious way to know which regexes have worse miss rates, the utility of your regex-based search would be limited. LLMs are like this, but their generality makes them useful in spite of this limitation.
- 60654 2y agoI would just add that Mathematica-style term rewriting (e.g. analytical integration, or equation solving) is done with _semantics-preserving_ symbolic solvers, which are hand-made and human-reviewed to guarantee correctness. LLM style pattern matching and rewriting does not preserve semantics, except accidentally due to an overwhelming amount of examples.