[Paper Review] PIDE as front-end technology for Coq
This paper presents CoqPIDE, an experiment integrating Coq with the PIDE (Prover IDE) framework originally designed for Isabelle, demonstrating that Coq can be connected to PIDE through a minimal 40 kB OCaml/Scala implementation. The key contribution is proving PIDE's generality and reusability across proof assistants by enabling asynchronous, document-oriented interaction without modifying Coq's core proof processing.
Isabelle/PIDE is the current Prover IDE technology for Isabelle. It has been developed in ML and Scala in the past 4-5 years for this particular proof assistant, but with an open mind towards other systems. PIDE is based on an asynchronous document model, where the prover receives edits continuously and updates its internal state accordingly. The interpretation of edits and the policies for proof document processing are determined by the prover. The editor front-end merely takes care of visual rendering of formal document content. Here we report on an experiment to connect Coq to the PIDE infrastructure of Isabelle. This requires to re-implement the core PIDE protocol layer of Isabelle/ML in OCaml. The payload for semantic processing of proof document content is restricted to lexical analysis in the sense of existing CoqIde functionality. This is sufficient as proof-of-concept for PIDE connectivity. Actual proof processing is then a matter of improving Coq towards timeless and stateless proof processing, independently of PIDE technicalities. The implementation worked out smoothly and required minimal changes to the refined PIDE architecture of Isabelle2013. This experiment substantiates PIDE as general approach to prover interaction. It illustrates how other provers of the greater ITP family can participate by following similar reforms of the classic TTY loop as was done for Isabelle in the past few years.
Motivation & Objective
- To investigate whether PIDE, a Prover IDE framework designed for Isabelle, can be adapted to work with Coq.
- To evaluate the feasibility of re-implementing the PIDE protocol layer in OCaml for Coq's ecosystem.
- To demonstrate that PIDE's asynchronous, document-centric model can be generalized beyond Isabelle to other proof assistants.
- To assess the minimal engineering overhead required to connect a new prover to the PIDE infrastructure.
Proposed method
- Re-implemented the core PIDE protocol layer in OCaml to interface with Coq, using the same bidirectional byte-stream communication as in Isabelle.
- Adopted a minimal payload for semantic processing, relying only on lexical analysis to validate the PIDE connectivity.
- Leveraged the PIDE's asynchronous document model, where edits are continuously processed and results are pushed back without blocking the editor.
- Used Scala-based front-end (jEdit) for rendering, while Coq handled proof processing independently via the PIDE protocol.
- Designed the protocol using typed XML serialization to exchange structured data between the OCaml prover backend and Scala front-end.
- Applied a modular approach, separating PIDE protocol logic (50%) from Coq-specific payload (50%), enabling extensibility.
Experimental results
Research questions
- RQ1Can the PIDE architecture be successfully extended to support Coq as a backend prover?
- RQ2What is the minimal implementation cost (in code size and effort) to connect a new proof assistant to PIDE?
- RQ3Does PIDE's asynchronous, document-oriented model work effectively with Coq’s proof processing model?
- RQ4Can PIDE’s protocol be re-implemented in OCaml without compromising correctness or performance?
- RQ5To what extent does PIDE’s design enable stateless, timeless proof processing in Coq?
Key findings
- The CoqPIDE experiment succeeded with minimal changes to the Isabelle2013 PIDE architecture, validating PIDE’s reusability across proof assistants.
- The PIDE protocol implementation in OCaml required only about 40 kB of source code, with 26 kB in OCaml and 14 kB in Scala, demonstrating high efficiency.
- The minimal payload—limited to lexical analysis—was sufficient as a proof-of-concept, showing that full proof processing can be decoupled from PIDE integration.
- The asynchronous model prevented editor blocking, enabling responsive editing even during long-running proof checks.
- The experiment confirmed that PIDE’s design supports timeless and stateless proof processing, which Coq can adopt independently of PIDE.
- The use of typed XML serialization enabled robust, portable communication between the OCaml prover and Scala front-end, ensuring data integrity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.