Coq 从自动/自动触发类型类搜索
如何在Coq中从auto/eauto触发typeclass搜索 例如: 我为Coq 从自动/自动触发类型类搜索,coq,coq-tactic,Coq,Coq Tactic,如何在Coq中从auto/eauto触发typeclass搜索 例如: 我为PartialOrders设置了一个类: Class PartialOrder `(lt : LessThan A) := { po_refl : forall a, a ⊑ a; po_trans : forall a b c, a ⊑ b -> b ⊑ c -> a ⊑ c; po_antisymm : forall a b, a ⊑ b -> b ⊑ a
PartialOrder
s设置了一个类:
Class PartialOrder `(lt : LessThan A) :=
{
po_refl : forall a, a ⊑ a;
po_trans : forall a b c, a ⊑ b -> b ⊑ c -> a ⊑ c;
po_antisymm : forall a b, a ⊑ b -> b ⊑ a -> a = b
}.
然后,我想获取部分订单的产品:
Instance ProdPO `(lt__a : LessThan A)
`(lt__b : LessThan B)
`(!PartialOrder lt__a)
`(!PartialOrder lt__b) : PartialOrder (ProdLT lt__a lt__b).
Proof.
constructor.
- (* refl *)
intros [a b].
(* TODO: how can I apply po_rel automatically? *)
constructor; apply po_refl.
这是可行的,但是如果有一种方法可以从auto
中触发类型类搜索,那么应该可以用auto
解决这个问题
在这里利用自动化的正确方法是什么?您知道这种策略吗?