我正在尝试使用可以轻松生成的术语(在此特定示例中,从tauto)实例化存在量词的策略。我第一次尝试: Ltac mytac :=
match goal with
| |- (exists (_ : ?X), _) => cut X;
[ let t := fresh "t" in intro t ; exists t; firstorder
我正在尝试编写一个柯里函数的策略,包括普遍量化的函数。 Require Import Coq.Program.Tactics.
Definition curry1 := forall A B C, (A /\ B -> C) -> (A -> B -> C).
Definition curry2 := forall A B, (forall C, A /\ B -> C) -> (foral
Ltac checkForall H :=
let T := type of H in
match T with
| forall x, ?P x =>
idtac
| _ =>
fail 1 "not a forall"
end.
Example test : (forall x, x) -> True.
Proof.
我有几个证据遵循相同的结构。其中第一个可以用trivial完成,其他所有用auto with foo_db完成,其中foo_db是在第一个证明完成后填充提示的提示数据库。我想写一个使用auto with foo_db来解决所有这些证明的Ltac程序。但是,当运行该Ltac解决我的第一个证明foo_db尚不存在,所以科克抱怨:Error: No such Hint database: foo_db.
如何在ltac中调用rewrite只重写一个发生?我认为coq的文档提到了一些关于rewrite at的内容,但我在实践中并没有真正使用它,并且没有例子。 这是什么,我试图做一个例子: Definition f (a b: nat): nat.
Admitted.
Theorem theorem1: forall a b: nat, f a b = 4.
Admitted.
Theor
获取假名'类型 我正在寻找一种通过它的名字获得假名以匹配它的方法。就像这样: Ltac mytactic h_name :=
let h := hyp_from_name h_name in
match h with
| _ /\ _ => do_something
| _ => print_error_message
end
.
这将是像这样使用: