coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: zjhsdtc <zjhsdtc AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] questions about using search command in coqtop ideslave
- Date: Wed, 5 Oct 2016 21:49:41 +0800
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=zjhsdtc AT gmail.com; spf=Pass smtp.mailfrom=zjhsdtc AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f54.google.com
- Ironport-phdr: 9a23:ftlgaR8Btg4Vt/9uRHKM819IXTAuvvDOBiVQ1KB90egcTK2v8tzYMVDF4r011RmSDN+dsKoP1buempujcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47AblHf6ke/8SQVUk2mc1EkfKKuQsWM3oye7KObw9XreQJGhT6wM/tZDS6dikHvjPQQmpZoMa0ryxHE8TNicuVSwn50dxrIx06vrpT4wJk2+CNJ/vkl6sRoUKPgfq1+Q6YLIi4hNjUn5s3wuQXIBV+d5HsHXnkduhVNCgnBqhr9W8Gi4WPBquNh1XzCboXNRrcuVGH64g==
Hi CJ Bell,
Thanks for the detailed answer! and xmlprotocol.ml is pretty neat, i will try to search around the source code before my next question about Coq :D
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#L4642. the constraint type: https://github.com/coq/coq/blob/trunk/ide/xmlprotocol.ml#L253. the return type is a list of pairs of Coq objects and strings: https://github.com/coq/coq/blob/trunk/ide/xmlprotocol.ml#L488Example 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></callReturns:<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 (n m : nat) (A : Type) (f : A -> A) (x : A),
nat_rect (fun _ : nat => A) x (fun _ : nat => f) (n + m) =
nat_rect (fun _ : nat => A)
(nat_rect (fun _ : nat => A) x (fun _ : nat => f) m)
(fun _ : nat => f) 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 (A : Type) (f : A -> A) (x : A) (n : nat),
nat_rect (fun _ : nat => A) x (fun _ : nat => f) (S n) =
nat_rect (fun _ : nat => A) (f x) (fun _ : nat => f) n</string></coq_object></list></value>-cjOn 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 theideslave
, e.g. theGoal
command, so we can simply send<call val="Goal"><unit/></call>
to ideslave, i can easily play around with these commands except theSearch
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,
- [Coq-Club] questions about using search command in coqtop ideslave, zjhsdtc, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, CJ Bell, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, zjhsdtc, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, James Smith, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, CJ Bell, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, James Smith, 10/06/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, CJ Bell, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, James Smith, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, zjhsdtc, 10/05/2016
- Re: [Coq-Club] questions about using search command in coqtop ideslave, CJ Bell, 10/05/2016
Archive powered by MHonArc 2.6.18.