16.11. 还原性
可简化术语定义由grind 热切地展开。
这可以实现更高效的 定义等价 比较和索引。
Reducibility and Congruence Closure
电子匹配模式还展现了可简化的定义。
为有关缩写的定理生成的模式以展开的缩写表示。
缩写一般不应是递归的;特别是,当使用 grind 时,递归缩写可能会导致索引性能较差和不可预测的模式。
E-matching and Unfolding Abbreviations
当向定理添加 grind 注释时,将根据定理语句生成 E 匹配模式。
这些模式决定了定理何时被实例化。
定理 one_eq_1 提到了 半可约 定义 one,结果模式也是 one:
def one := 1
@[grind? =]
theorem one_eq_1 : one = 1 := ⊢ one = 1 All goals completed! 🐙
将相同的注释应用于有关 reducible 缩写 two 的定理会产生 two 展开的模式:
abbrev two := 2
@[grind? =]
theorem two_eq_2: two = 2 := ⊢ two = 2 All goals completed! 🐙