simpl
策略將2 + a
這樣的表達式展現爲「匹配樹」,它看起來並不簡單。例如:如何禁止簡單的策略展開算術表達式?
Goal forall i:Z, ((fun x => x + i) 3 = i + 3).
simpl.
引出:
forall i : Z,
match i with
| 0 => 3
| Z.pos y' =>
Z.pos
match y' with
| q~1 =>
match q with
| q0~1 => (Pos.succ q0)~1
| q0~0 => (Pos.succ q0)~0
| 1 => 3
end~0
| q~0 =>
match q with
| q0~1 => (Pos.succ q0)~0
| q0~0 => q0~1
| 1 => 2
end~1
| 1 => 4
end
| Z.neg y' => Z.pos_sub 3 y'
end = i + 3
如何避免此類併發症與simpl
戰術?
這個特殊的目標可以用omega
來解決,但如果它有點複雜,歐米茄就會失敗,我不得不求助於類似於:replace (2 + a) with (a + 2); simpl; replace (a + 2) with (2 + a)
。