Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] questions about using search command in coqtop ideslave

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] questions about using search command in coqtop ideslave


Chronological Thread 
  • From: CJ Bell <siegebell+coq AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] questions about using search command in coqtop ideslave
  • Date: Tue, 4 Oct 2016 23:53:10 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=siegebell AT gmail.com; spf=Pass smtp.mailfrom=siegebell AT gmail.com; spf=None smtp.helo=postmaster AT mail-lf0-f44.google.com

The code for encoding and decoding this call is here:
1. the type of the Search call is a list of pairs, the first being a constraint and the second a bool: https://github.com/coq/coq/blob/trunk/ide/xmlprotocol.ml#L464
2. the constraint type: https://github.com/coq/coq/blob/trunk/ide/xmlprotocol.ml#L25
3. the return type is a list of pairs of Coq objects and strings: https://github.com/coq/coq/blob/trunk/ide/xmlprotocol.ml#L488

Example search for regex "nat_rect.+":
<call val="Search"><list><pair><search_cst val="name_pattern"><string>nat_rect.+</string></search_cst><bool val="true"/></pair></list></call
Returns:
<value val="good"><list><coq_object><list><string>Coq</string><string>Init</string><string>Peano</string></list><list><string>nat_rect_plus</string></list><string>forall&nbsp;(n&nbsp;m&nbsp;:&nbsp;nat)&nbsp;(A&nbsp;:&nbsp;Type)&nbsp;(f&nbsp;:&nbsp;A&nbsp;-&gt;&nbsp;A)&nbsp;(x&nbsp;:&nbsp;A),
nat_rect&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;A)&nbsp;x&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;f)&nbsp;(n&nbsp;+&nbsp;m)&nbsp;=
nat_rect&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;A)
&nbsp;&nbsp;(nat_rect&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;A)&nbsp;x&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;f)&nbsp;m)&nbsp;
&nbsp;&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;f)&nbsp;n</string></coq_object><coq_object><list><string>Coq</string><string>Init</string><string>Peano</string></list><list><string>nat_rect_succ_r</string></list><string>forall&nbsp;(A&nbsp;:&nbsp;Type)&nbsp;(f&nbsp;:&nbsp;A&nbsp;-&gt;&nbsp;A)&nbsp;(x&nbsp;:&nbsp;A)&nbsp;(n&nbsp;:&nbsp;nat),
nat_rect&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;A)&nbsp;x&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;f)&nbsp;(S&nbsp;n)&nbsp;=
nat_rect&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;A)&nbsp;(f&nbsp;x)&nbsp;(fun&nbsp;_&nbsp;:&nbsp;nat&nbsp;=&gt;&nbsp;f)&nbsp;n</string></coq_object></list></value>


-cj

On Tue, Oct 4, 2016 at 9:49 PM, zjhsdtc <zjhsdtc AT gmail.com> wrote:

Hi all,

There is something that has confused me for quite a while. if we use coqtop -ideslave --help-XML-protocol, it will produce a list of commands available in the ideslave, e.g. the Goal command, so we can simply send <call val="Goal"><unit/></call> to ideslave, i can easily play around with these commands except the Search one.

According to the brief documentation, it seems have to send a list of search constraint and boolean value pairs inside <call val="Search">...</call>, but after trying and failing for many times, i still can not find a way to construct a qualified xml message to stand for a search command.

So is there any examples to use Search command in ideslave or anyone have an idea how to use it?

Thank you,





Archive powered by MHonArc 2.6.18.

Top of Page