Find the definition and notations like ++ in Coq

断了今生、忘了曾经 提交于 2019-12-05 13:50:35

问题


How can we get the definition/type for those notations like "+", or "++" of List?

I have tried : Search ++, Search "++", Search (++), SearchAbout ... and Check ++, Check "++", Check(++).

None of them work however...

SearchAbout "++" does show some info, but not the definition of "++".


回答1:


Do:

Locate "++".

To lookup for notations.

Then you can Print/Check the actual term being denoted.




回答2:


In addition to previous answer, you can use Unfold "++" to unfold it's definition without locating it first.

Example:

Coq < Goal forall A (l : list A), l ++ [] = [].
1 subgoal

  ============================
   forall (A : Type) (l : list A), l ++ [] = []

Unnamed_thm < unfold "++".
1 subgoal

  ============================
   forall (A : Type) (l : list A),
   (fix app (l0 m : list A) {struct l0} : list A :=
      match l0 with
      | [] => m
      | a :: l1 => a :: app l1 m
      end) l [] = []


来源:https://stackoverflow.com/questions/26029594/find-the-definition-and-notations-like-in-coq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!