防止在Coq中施用后意外展开

时间:2018-09-23 21:43:28

标签: coq

我的表示法在申请后被无意间展开了。 我不想每次使用惯用方式时都在这个小例子的最后一行称战术“改变”。 如何禁止Coq展示我的符号“(a'=='b)”?

Require Export Coq.Vectors.Vector.
Import VectorNotations.
Inductive Terms : Type :=
    FVC : nat -> Terms.
Definition Fo:=nat.
Context (axs0 : nat -> Type).
Context (Atom : Vector.t Terms 2 -> Fo).
Notation "( a '==' b )" := (Atom [a:Terms; b:Terms]).
Notation "( A --> B )" := (A + B).

Inductive GPR (axs : nat -> Type) (ctx:list nat) : nat -> Type :=
| MP (A B: Fo) : (GPR axs ctx A)->(GPR axs ctx (A --> B))
             ->(GPR axs ctx B).
Definition APR := GPR axs0.
Definition p2_23_a ctx (t:Terms) : APR ctx (t == t).
apply MP with (A:=(t == t)).
change (Atom [t; t]) with ((t==t)).  (* <-- I don't want to write this line. *)

1 个答案:

答案 0 :(得分:1)

更改

Notation "( a '==' b )" := (Atom [a:Terms; b:Terms]).

Notation "( a '==' b )" := (Atom [a; b]).

类型注释出现在AST中,并且很容易简化,因此注释很少匹配。