Ltac:实例化forall假设

时间:2017-07-03 10:28:46

标签: coq coq-tactic ltac

我正在研究一种可以创造两个新假设的策略

x0 : D
x0_Linked : P x0

来自该形式的假设

H : forall x : D, P x

这是我的Ltac代码:

Ltac mytactic h t x :=
    match type of h with
    | (forall (_: ?X1), _) =>  evar (x : X1) ; pose ( t := h x )
    | _ => idtac "Erreur: Aucun pour tout decomposable dans l'hypothese."
    end
.

h是分解的假设,x新变量的名称和t新假设的名称。策略按预期工作,但在证据的最后我得到了这个:

testproof< exact H0. 
All the remaining goals are on the shelf.

1 subgoal

subgoal 1 is:
 D

evar策略似乎创建了一个名为D的新类型,而不是使用现有类型。请注意,如果我使用

Coq< Variable x0 : D.

在coqtop中,它完美无缺。

0 个答案:

没有答案
相关问题