Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the definition and notations like ++ in Coq

Tags:

coq

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 "++".

like image 648
zell Avatar asked Sep 25 '14 02:09

zell


2 Answers

Do:

Locate "++".

To lookup for notations.

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

like image 171
Ptival Avatar answered Nov 08 '22 00:11

Ptival


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 [] = []
like image 34
sinan Avatar answered Nov 08 '22 01:11

sinan