How to forbid simpl tactic to unfold arithmetic expressions?

前端 未结 2 1709
灰色年华
灰色年华 2021-01-12 03:16

The simpl tactic unfolds expressions like 2 + a to \"match trees\" which doesn\'t seem simple at all. For example:



        
2条回答
  •  -上瘾入骨i
    2021-01-12 03:46

    You can tweak how the simpl tactic behaves so you get less matches.

    Require Import Coq.ZArith.ZArith.
    
    Goal forall i:Z, ((fun x => (x + i)%Z) 3%Z = (i + 3)%Z).
    Arguments Z.add x y : simpl nomatch.
    simpl.
    

    Read more about it here.

    Otherwise you can use other tactics that allow you to choose how to reduce. cbn beta, for example.

提交回复
热议问题