Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

FormulaTransformEngine

Guides

  • FormulaTransformEngine
  • FormulaTransformEngine

Symbols

  • AddFormulaTransformRegistryPath
  • ApplyFormulaTransform
  • CompileFormulaHeuristicRule
  • CompileFormulaObligationDischarger
  • CompileFormulaStructuralTransform
  • CompileFormulaTargetPlanner
  • CompileFormulaTransformRule
  • FormulaTransformHandleRequest
  • FTMatchAlgebraicStructure
  • FTSolveParameters
  • GetFormulaTransformObligations
  • InspectFormulaTransformRegistry
  • PlanFormulaTransform
  • PlanFormulaTransformParts
  • ReloadFormulaTransformRegistry
  • AddFormulaTransformRegistryPath
  • ApplyFormulaTransform
  • CompileFormulaHeuristicRule
  • CompileFormulaObligationDischarger
  • CompileFormulaStructuralTransform
  • CompileFormulaTargetPlanner
  • CompileFormulaTransformRule
  • FormulaTransformHandleRequest
  • FTMatchAlgebraicStructure
  • FTSolveParameters
  • GetFormulaTransformObligations
  • InspectFormulaTransformRegistry
  • PlanFormulaTransform
  • PlanFormulaTransformParts
  • ReloadFormulaTransformRegistry
Lightmarey`FormulaTransformEngine`
CompileFormulaHeuristicRule
​
CompileFormulaHeuristicRule[json]
验证并注册确定性的预处理重写,用于生成或排序变换候选。
​
更多信息和选项
▪
启发式规则声明适用范围、表达式重写方式、代价和应用次数上限;它本身不定义最终数学关系。
▪
编译过程只接受声明式数据。可执行构造、未知编译原语、未绑定模板槽和不一致的方向都会被拒绝。
▪
成功时返回包含 Status -> "Compiled"、Kind -> "FormulaHeuristicRule"、Name、规范化字段和 Raw 的关联。无效输入返回 Status -> "Failure"、FailureType -> "InvalidRuleJSON" 以及 Issues 列表。
▪
参数:
json
Association
描述符字段如下表所示。
▪
描述符字段:
name
String,必需
注册表名称。
appliesTo
字符串列表
可使用该启发式规则的规则或族。
matchers
List
声明式源表达式匹配器。
rewrite
Association
受限的重写模板。
conditions
List
执行重写所需的条件。
cost
Number
候选排序代价;默认值为 1。
maxApplications
Integer
最大应用次数;默认值为 1。
​
范例  
(1)
基本范例  
(1)
In[1]:=
Needs["Lightmarey`FormulaTransformEngine`"]
编译并注册一个最小有效描述符:
In[2]:=
CompileFormulaHeuristicRule
[Association["name""ExampleHeuristic","appliesTo"{"Holder"},"matchers"{},"rewrite"Association[],"cost"1,"maxApplications"1]]
Out[2]=
StatusCompiled,KindFormulaHeuristicRule,HeadCompiledFormulaHeuristicRule,RegistryKindHeuristicRewrite,NameExampleHeuristic,AppliesTo{Holder},Matchers{},Rewrite,Conditions{},Cost1,MaxApplications1,RawnameExampleHeuristic,appliesTo{Holder},matchers{},rewrite,cost1,maxApplications1
无效描述符返回结构化诊断,而不会执行任意代码:
In[1]:=
CompileFormulaHeuristicRule
[Association[]]
Out[1]=
StatusFailure,KindFormulaTransform,FailureTypeInvalidRuleJSON,MessageFormula heuristic JSON was rejected.,Issues{name must be a non-empty string.},Heuristic
参见
CompileFormulaTransformRule
▪
CompileFormulaStructuralTransform
▪
CompileFormulaTargetPlanner
▪
CompileFormulaObligationDischarger
相关指南
▪
FormulaTransformEngine
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com