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
Collaborative Editing with PGIP A Fresh Look at the PGIP Display - - PowerPoint PPT Presentation
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:
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
Aspinall & L¨ uth: Collaborative Editing with PGIP 2 November 1, 2007
PGIPD PGIPD PGIPD Prover Prover Graphical User Interface Text Editor Eclipse Broker File System Theory Store Prover Components Display Components PGIP PGIP
P P
Aspinall & L¨ uth: Collaborative Editing with PGIP 3 November 1, 2007
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
PGIPD PGIPD PGIPD Prover Prover Graphical User Interface Text Editor Eclipse Broker File System Theory Store Prover Components Display Components PGIP PGIP
P P
Aspinall & L¨ uth: Collaborative Editing with PGIP 5 November 1, 2007
. . . . . . . . . . . . Text is successfully Text is successfully User requests file to be loaded. parsed. Broker Display Prover <parsescript> <parseresult> <loadparsefile> <parsescript> Users edits a text region. commands are successfully executed. <parseresult> Old text is deleted, edited text is inserted. User request <newcmd> <ready> <ready> prover command prover command parsed. <newcmd> <editcmd> <delcmd> <newcmd> <setcmdstatus> <cmdstatus> <cmdstatus> Broker creates new prover commands. command to be processed. Several prover Aspinall & L¨ uth: Collaborative Editing with PGIP 6 November 1, 2007
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 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
Unparsed Outdated Outdate request Processed Normal response response Send to prover Parsed
Being processed
proof Replay Error Parse command Edit command
Aspinall & L¨ uth: Collaborative Editing with PGIP 9 November 1, 2007
Aspinall & L¨ uth: Collaborative Editing with PGIP 10 November 1, 2007
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
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
Display protocol has unique identifiers for:
provers (prvid) loaded files (srcid) commands (objid)
Aspinall & L¨ uth: Collaborative Editing with PGIP 13 November 1, 2007
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
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
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
Aspinall & L¨ uth: Collaborative Editing with PGIP 16 November 1, 2007
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
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
Theorem 2 Theorem 1 Theory T1 Definition 1 Lemma 1 Lemma 2
Show dependencies Collaborate editing respects dependencies Extended notion of conflict
Aspinall & L¨ uth: Collaborative Editing with PGIP 19 November 1, 2007
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