组合Formula便利接口与Semantic核心[#79]
如果源表达式最初来自文章正文,可以先读取并保存:
@(define source (φ:read "2*x + 3*x"))
@(define collection (math-collect source
#:assumptions (φ:assumptions "coordinate(x)")))
@math[(math-report-result collection)] 这里Formula reader仅在第一行接触字符串。后续math-collect接收source这个Semantic值;计算事实也是解析后的term。把结果保存为值后,它还可以继续参与◆:构造器、Notation排版或另一个pass。