Designing a state transaction machine for Coq Bruno Barras & Enrico Tassi 12 Aug 2012 — Princeton Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 1 / 9
Roadmap The Paral-ITP project 1 A State Transaction Machine for Coq 2 Demo 3 Future work 4 Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 2 / 9
The Paral-ITP project Paral-ITP in a nutshell This work has been done in the context of the Paral-ITP project: Consortium: LRI, INRIA, CNAM Peculiarity: Coq & Isabelle Buzzword: parallelization Inspiration: Isabelle/Jedit (Wenzel) Objectives on the Coq side: Get rid of the read/eval/print loop: - rethink the execution flow of a document Towards a document centric prover: - design a “document model”/editing API Take profit: - asynchronous flow between the GUI and the prover - parallel processing of independent tasks Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 3 / 9
A State Transaction Machine for Coq The evil loop Getting rid of the read/eval/print loop Require Import Stuff. 1 Section Ex. 2 The loop: Variables A B C : Prop. 3 line n + 1 requires line n Lemma ex1 : A -> B. 4 to be fully evaluated Proof. 5 ... Breaking it: 6 Qed. 7 Proof . . . Qed blocks generate opaque proof terms Lemma ex2 : C. 8 Proof. 9 opaque proofs are almost ... 10 irrelevant for the type checker apply ex1. 11 ... 12 Qed. 13 End Ex. 14 Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 4 / 9
A State Transaction Machine for Coq The evil loop Getting rid of the read/eval/print loop The problems: Require Import Stuff. 1 Section Ex. 2 End Ex. looks at the proof Variables A B C : Prop. 3 to compute the discharged type Lemma ex1 : A -> B. constraints on Type indexes are 4 Proof. 5 generated by Qed while ... 6 type checking the proof Qed. 7 Lemma ex2 : C. 8 Proof. 9 ... 10 apply ex1. 11 ... 12 Qed. 13 End Ex. 14 Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 5 / 9
A State Transaction Machine for Coq The evil loop Getting rid of the read/eval/print loop The problems: Require Import Stuff. 1 Section Ex. 2 End Ex. looks at the proof Variables A B C : Prop. 3 to compute the discharged type Lemma ex1 : A -> B. constraints on Type indexes are 4 Proof. 5 generated by Qed while ... 6 type checking the proof Qed. 7 We are lucky: Lemma ex2 : C. 8 Proof using vars. Proof. 9 to declare the section ... 10 variables used (in 8.4) apply ex1. 11 ... 12 the addition of Type constraints Qed. 13 is a commutative operation End Ex. 14 Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 5 / 9
A State Transaction Machine for Coq State Transaction Machine Getting rid of the read/eval/print loop The data structure Require Import Stuff. 1 s9 Section Ex. 2 Proof using C. Variables A B C : Prop. 3 s8 Lemma ex1 : A -> B. 4 Lemma ex2 : C. Proof using A B. 5 ... s7 6 Qed. 7 s6 Lemma ex2 : C. 8 Proof using C. ... Qed ex1 9 ... 10 s5 apply ex1. 11 ... Proof using AB. 12 Qed. 13 s4 End Ex. Lemma ex1 : A -> B. 14 Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 6 / 9
Demo Demo Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 7 / 9
Future work Future/ongoing work Many things are still needed to take full profit: separate compilation revisited 1 .v when compiled generates a .vi and .vp .vi enough data to make Require work (fast to generate) .vp delayed tasks (to be run by the .vi interactive user) .vo obtained as .vi + output of tasks in .vp Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 8 / 9
Future work Future/ongoing work Many things are still needed to take full profit: separate compilation revisited 1 Isabelle/Jedit GUI 2 ◮ share the document model/editing API with Isabelle/Jedit ◮ share most of the Jedit plugin code ◮ fast computation of the DAG (ideally by just parsing) ◮ classification of vernacular commands: ⋆ branch/merge ( Proof , Qed ) ⋆ global (side)effect ( Hint ) ⋆ require immediate execution ( Notation , Open Scope ) ⋆ local to the branch (tactics) Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 8 / 9
Future work Future/ongoing work Many things are still needed to take full profit: separate compilation revisited 1 Isabelle/Jedit GUI 2 true concurrency in Coq 3 ◮ farm or slave processes ◮ task and prover status transmission (deltas?) ◮ API available to most Coq internals Are you interested in a post-doc on these topics? Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 8 / 9
Future work Future/ongoing work Many things are still needed to take full profit: separate compilation revisited 1 Isabelle/Jedit GUI 2 true concurrency in Coq 3 better tracking of dependencies 4 ◮ recheck only what is really needed Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 8 / 9
Future work Thanks Thanks for your attention! Barras, Tassi (INRIA) Designing a STM for Coq 4th Coq Workshop 9 / 9
Recommend
More recommend