Find the definition and notations like ++ in Coq

后端 未结 2 1152
半阙折子戏
半阙折子戏 2021-02-12 13:00

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

I have tried : Search ++,

相关标签:
2条回答
  • 2021-02-12 13:20

    Do:

    Locate "++".
    

    To lookup for notations.

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

    0 讨论(0)
  • 2021-02-12 13:27

    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 [] = []
    
    0 讨论(0)
提交回复
热议问题