Collaborative Editing with PGIP A Fresh Look at the PGIP Display Protocol David Aspinall, Christoph L¨ uth November 1, 2007 Aspinall & L¨ uth: Collaborative Editing with PGIP 1 November 1, 2007
PGIP Refresher Aspinall & L¨ uth: Collaborative Editing with PGIP 2 November 1, 2007
PGIP and PG Kit System Architecture Prover Components Display Components Graphical User PGIP D Interface PGIP Prover P Text Editor Broker PGIP D Prover PGIP P PGIP D Eclipse File System Theory Store Aspinall & L¨ uth: Collaborative Editing with PGIP 3 November 1, 2007
PGIP Status Design & implementation started 2003 Supported in Isabelle (2005) Experiments with Coq (2007) RSN: Proof General Eclipse Aspinall & L¨ uth: Collaborative Editing with PGIP 4 November 1, 2007
PG Kit System Architecture Prover Components Display Components Graphical User PGIP D Interface PGIP Prover P Text Editor Broker PGIP D Prover PGIP P PGIP D Eclipse File System Theory Store Aspinall & L¨ uth: Collaborative Editing with PGIP 5 November 1, 2007
Sample Message Exchange Display Prover Broker User requests <loadparsefile> file to be loaded. <parsescript> Text is successfully parsed. <parseresult> <newcmd> Broker creates new . . . prover commands. <newcmd> <editcmd> Users edits <parsescript> a text region. Text is successfully parsed. <parseresult> Old text is <delcmd> . deleted, . . <newcmd> edited text is inserted. <setcmdstatus> User request prover command Several prover command to commands are <ready> be processed. . successfully <cmdstatus> . . executed. . prover command . . <ready> <cmdstatus> Aspinall & L¨ uth: Collaborative Editing with PGIP 6 November 1, 2007
Proof Language Proof script: native language lemma fn1: ”( ∃ x. P (f x)) − → ( ∃ y. P y)” proof assume ” ∃ x. P (f x)” thus ” ∃ y. P y” proof fix a assume ”P (f a)” show ?thesis .. qed qed Aspinall & L¨ uth: Collaborative Editing with PGIP 7 November 1, 2007
Proof Language Markup Proof scripts: native language plus PGIP markup < opengoal name=”fn1” > lemma fn1: "( < sym name=”exists” > EX < /sym > x. < openblock/ >< proofstep > proof < /proofstep > < proofstep > assume " < sym name=”exists” > EX < /sym > x. P (f x)" < / < proofstep > thus " < sym name=”exists” > EX < /sym > y. P y" < /proofste < openblock/ >< proofstep > proof < /proofstep > < proofstep > fix a < /proofstep > < proofstep > assume "P (f a)" < /proofstep > < proofstep > show ?thesis < /proofstep >< openblock/ > < proofstep > .. < /proofstep >< closeblock/ > < proofstep > qed < /proofstep >< closeblock/ > < closegoal > qed < /closegoal >< closeblock/ > Aspinall & L¨ uth: Collaborative Editing with PGIP 8 November 1, 2007
Document States in Development Unparsed Outdated Outdate request Edit command Parse Replay Error Parsed command proof Processed response Normal response Being processed Send to prover Aspinall & L¨ uth: Collaborative Editing with PGIP 9 November 1, 2007
PGIP D Revisited Aspinall & L¨ uth: Collaborative Editing with PGIP 10 November 1, 2007
Display commands: display − → broker Provers: <launchprover>... Files: <loadparsefile url="file:///home/cxl/proof.thy" prvid="xyz.2007.25"/> <savefile url="file:///home/cxl/newproof.thy" srcid="f07"/> Editing: <createobj srcid="f07" objposition="a19" >apply (drule_tac x="f y" in spec)</createobj> <editobj src="f07" editfrom="a19" editto="a23">...</editobj> Proving: <setobjstate objid="a15" newstate="processed"> Aspinall & L¨ uth: Collaborative Editing with PGIP 11 November 1, 2007
Display messages: broker − → displays Provers: <proverstarted prvid="xyz.2007.25"/> Files: <newfile prvid="xyz.2007.25" srcid="f07" url="file:///home/cxl/proof.thy"/> Editing: <newobj srcid="f07" objid="a23"> <proofstep>apply (drule_tac x="f y" in spec)< /proofstep></newobj> Proving: <objstate objid="a23" newstate="processed"/> Aspinall & L¨ uth: Collaborative Editing with PGIP 12 November 1, 2007
PGIP Display Protocol Revisited Display protocol has unique identifiers for: provers ( prvid ) loaded files ( srcid ) commands ( objid ) Aspinall & L¨ uth: Collaborative Editing with PGIP 13 November 1, 2007
PGIP Display Protocol Revisited Display protocol has unique identifiers for: provers ( prvid ) loaded files ( srcid ) commands ( objid ) Systematic view of broker: provides stateless access to inherently stateful resources Resources organised hierarchically state changes communicated e.g. via XUpdate or HTTP Aspinall & L¨ uth: Collaborative Editing with PGIP 13 November 1, 2007
A Taxonomy of Resources Broker: global configurations, list of known provers, list of loaded files Prover: status, preferences, identifiers, menues; list of files loaded; messages; component specification: how to start, system attributes; File: list of links to all text spans source URL file status Text span: PGIP markup, text content status (unparsed . . . outdated) Aspinall & L¨ uth: Collaborative Editing with PGIP 14 November 1, 2007
Communicating Changes The (asynchronous) RPC way: XUpdate Load a file ( < loadparsefile > ) <xupdate:append select="provers/xyz.2007.25/files/"> <srcfile url="..."> </xupdate:append> Edit a text span: ( < editobj > ) <xupdate:update select="files/f07/[objid=a19 or objid=a20 or objid=a21]" >apply ...</xupdate:update> The Web way: CRUD Load a file: POST file to "provers/xyz.2007.25/files/" Edit a text span: DELETE files/f07#a19 files/f07#a20 files/f07#a21 PUT files/f07#a25 Alternatively: PUT files/f07.xml Aspinall & L¨ uth: Collaborative Editing with PGIP 15 November 1, 2007
Collaborative Editing Aspinall & L¨ uth: Collaborative Editing with PGIP 16 November 1, 2007
Wiki-style Collaboration lemma fn1: ”( ∃ x. P (f x)) − → ( ∃ y. P y)” proof Begin Conflict assume ” ∃ x. P (f x)” Conflict -1+1 v1.1 assume ” ∃ z. P z” Conflict -1+1 current assume ” ∃ y. P y” End Conflict Aspinall & L¨ uth: Collaborative Editing with PGIP 17 November 1, 2007
Collaborative Proving? Proving = problem-solving � = wiki page editing Hypothesis: fine-grained collaboration useful CSCW mode: distributed, synchronous plus additional side-channels for communication = ⇒ concurrent editing within proof text: WYSIWIS Challenge: proof texts have rich inherent structure Aspinall & L¨ uth: Collaborative Editing with PGIP 18 November 1, 2007
Towards Collaborative Editing with PGIP D Theory T1 Definition 1 Lemma 1 Show dependencies Lemma 2 Collaborate editing respects dependencies Theorem 1 Extended notion of conflict Theorem 2 Aspinall & L¨ uth: Collaborative Editing with PGIP 19 November 1, 2007
Conclusions PGIP with XUpdate a uniform mechanism for change propagation broker provides stateless view on stateful resources Connections with MathWiki API design for interactive proving multiple displays: going beyond traditional wikis — more collaborative Aspinall & L¨ uth: Collaborative Editing with PGIP 20 November 1, 2007
Recommend
More recommend