Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Towards Merging PlatΩ and PGIP David Aspinall1 Christoph Lüth2 1 University 2 DFKI 3 Saarland Serge Autexier2 Marc Wagner2,3 of Edinburgh, Scotland Bremen, Germany University, Saarbrücken, Germany 8th International Workshop User Interfaces for Theorem Provers Montréal, Canada 22. August 2008 Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence PGKIT Architecture Prover Components Prover 1 IP D PG PGI P P Broker Prover 2 Display Components Middleware PP PGI PGIPD PG IP D Graphical User Interface Text Editor Eclipse File System Theory Store Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence PGKIT Architecture ◮ ACL2, Isabelle, HOL, Lambda-Clam, Lego, Plastic, Phox, . . . ◮ ASCII Files (Input-only) ◮ Specific parsers ◮ Command-Line oriented ◮ Single focus ◮ Display of proof state Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence PlatΩ Architecture Prover Components Prover PLATOP Middleware PLATOD PlatΩ OMDoc Display Components PL TEXmacs URI to Theories in Text-Editor Document Format or OMDoc Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence PlatΩ Architecture ◮ Writing TEXmacs documents assisted by Ωmega ◮ Ωmega: OMDoc Input/Output ◮ TEXmacs: Specific, flexible proof document style (PL) ◮ Multiple foci ◮ Bidirectional: proof steps done by the prover are propagated into the TEXmacs document ◮ XUPDATE/XMLDIFF based ◮ On the fly conversions between OMDoc and PL ◮ Contect-sensitive menus for assistance Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Comparision Document format Document syntax Change protocol Operations Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner PlatΩ Display XML TEXmacs XUpdate Contextdependent menus PG Kit Display Plain text ASCII PGIPD Global menus, typed operations PGIP 2 Display XML Generic XUpdate Context-dependent menus, typed operations German Research Center for Artificial Intelligence Comparision Document format Document syntax PlatΩ Prover XML OMDoc Change protocol Prover support XUpdate Ωmega Operations Contextdependent menus Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner PG Kit Prover Plain text Native prover syntax PGIPP Generic (Coq, Isabelle, etc) Global menus, typed operations PGIP 2 Prover XML Generic XUpdate Generic (Coq, Isabelle, Ωmega, etc) Context-dependent menus, typed operations German Research Center for Artificial Intelligence Overview of Extensions for PGIP 2 1 Support for Semi Structured Documents Multiple Foci XUpdate/Semantic XMLDiff Protocols 2 Context-Sensitive Service Menus 3 Multiple Editing Displays in Parallel 4 Mutiple Document Formats Working hypothesis: Do not require any change for current displays/provers when using the new PGIP 2 Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence 1 Support for Semi Structured Documents Multiple Foci XUpdate/Semantic XMLDiff Protocols 2 Context-Sensitive Service Menus 3 Multiple Editing Displays in Parallel 4 Mutiple Document Formats Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Unstructured Documents theory NN imports Main begin text {∗ The datatype of natural numbers\footnote{Not the real ones!}. ∗} datatype N = Z | S N text{∗ Induction is a derived concept: @{thm N.induct} ∗} add (infixr ”+” 65) text{∗ We first need two lemmas. ∗} lemma add Z r: ”x + Z= x” by (induct x, simp+) lemma add S: ”S (x+ y)= x+ (S y)” by (induct x, simp+) text{∗ Now we can prove commutativity. ∗} text{∗ We define addition via recursive equations, and declare its usual syntax. ∗} fun ”add” :: ”N \<Rightarrow> N \<Rightarrow> N” where ”add Z x = x” | ”add (S x) y= S (add x y)” theorem add commute: ”x+ y= y+ (x::N)” proof (induct x rule: N.induct) case Z thus ?case by (simp add: add Z r) case S thus ?case by (simp add: add S) qed end notation Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Unstructured Documents Display User requests file to be loaded. Prover Broker <loadparsefile> <parsescript> <parseresult> <newcmd> . . . <newcmd> Users edits a text region. Broker creates new prover commands. <editcmd> <parsescript> <parseresult> Old text is deleted, <delcmd> edited text is inserted. <newcmd> User request command to be processed. Text is successfully parsed. Text is successfully parsed. . . . <setcmdstatus> prover command <ready> <cmdstatus> . . . <cmdstatus> Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner prover command . . . Several prover commands are successfully executed. <ready> German Research Center for Artificial Intelligence Unstructured Documents <pgip tag = ”Isabelle/Isar” id = ”hume/cxl/27572/1208530140 .785” destid = ”broker:hume/2658/27571/2008318−144859− Z” class = ”pg” refid = ”broker:hume/2658/27571/2008318−144859− Z” refseq = ”18” seq = ”24”><parseresult> <opentheory/> <openblock/> <theoryitem/> <opentheory thyname = ”NN” parentnames = ”Main”>theory NN imports Main begin</opentheory><openblock objtype = ”theory body”/> <theoryitem objtype = ”theory declaration”>text {∗ The datatype of natural numbers\footnote{Not the real ones!}. ∗}</theoryitem > <theoryitem objtype = ”theory declaration”>datatype N = Z | S N</ theoryitem> <theoryitem objtype = ”theory declaration”>text{∗ Induction is a derived concept: @{thm N.induct} ∗}</theoryitem> <theoryitem objtype = ”theory declaration”>text{∗ We define addition via recursive equations, and declare its syntax as the usual infix operator. ∗}</theoryitem> <opengoal/> <openblock/> <pgip> <proofstep/> <closeblock/> <closegoal/> <closeblock/> <closetheory/> <theoryitem objtype = ”theory declaration”>fun "add" :: & quot;N \<Rightarrow> N \<Rightarrow> N" where "add Z x = x" | "add (S x) y= S (add x y)"</theoryitem> Towards Mergingobjtype PlatΩ = and”theory PGIPdeclaration”>notation <theoryitem Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Semi Structured Documents <pgip tag = ”Isabelle/Isar” id = ”hume/cxl/27572/1208530140 .785” destid = ”broker:hume/2658/27571/2008318−144859− Z” class = ”pg” refid = ”broker:hume/2658/27571/2008318−144859− Z” refseq = ”18” seq = ”24”> <parseresult> <document> <theory thyname=”NN” parentnames=”Main”>theory NN imports Main begin <block objtype=”theory body”> <theoryitem>text {∗ The datatype of natural numbers\footnote{Not the real ones!}. ∗}</theoryitem> <theoryitem type=”adt”>datatype N = Z | S N</theoryitem> <theoryitem>text{∗ Induction is a derived concept: @{thm N.induct} ∗}</theoryitem> <theoryitem>text{∗ We define addition via recursive equations, and declare its syntax as the usual infix operator. ∗}</theoryitem> <theoryitem objtype=”fundef”>fun "add" :: "N \< Rightarrow> N \<Rightarrow> N" where "add Z x = x" | "add (S x) y= S (add x y)"</theoryitem> <theoryitem objtype=”notation”>notation Towards PlatΩ and PGIP addMerging (infixr "+" 65)</theoryitem> Aspinall, Autexier, Lüth, Wagner <pgip> <document> <theory> <block> <theoryitem/> <assertion> <block> <proofstep/> <endproof/> German Research Center for Artificial Intelligence Supporting Semi Structured Documents ◮ New internal PGIP markup (PGML), tree compatible ◮ ◮ Use xml:id to flexibilise document structure Example: theorems and proofs need not occur together physically Rigid structure computed by the broker for the prover ◮ Provide on-the-fly converters between old and new markup ⇒ provers need not be adapted ◮ Configuration Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Single Focus Top Level CloseFile OpenFile File Open OpenTheory CloseTheory Theory Open Closeproof Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OpenProof Proof Open German Research Center for Artificial Intelligence Single Focus Top Level CloseFile OpenFile File Open OpenTheory CloseTheory Theory Open Closeproof Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OpenProof Proof Open German Research Center for Artificial Intelligence Single Focus Top Level CloseFile OpenFile File Open OpenTheory CloseTheory Theory Open Closeproof Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OpenProof Proof Open German Research Center for Artificial Intelligence Single Focus Top Level CloseFile OpenFile File Open OpenTheory CloseTheory Theory Open Closeproof Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OpenProof Proof Open German Research Center for Artificial Intelligence Single Focus Top Level CloseFile OpenFile File Open OpenTheory CloseTheory Theory Open Closeproof Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OpenProof Proof Open German Research Center for Artificial Intelligence Multiple Foci <pgip> Top Level CloseFile OpenFile <document> File Open CloseTheory 2 <theory> OpenTheory 1 OpenTheory CloseTheory21 <block> Theory 2 Open Closeproof T3 OpenProof T3 Proof T3 Open Theory 1 Open Closeproof T2 CloseproofOpenProof T1 T2 Proof T2 Open OpenProof T1 <theoryitem/> <assertion> Proof T1 Open <block> <proofstep/> Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence <endproof/> Supporting Semi Structured Documents ◮ New internal PGIP markup, tree compatible ◮ Provide on-the-fly converters between old and new markup ⇒ provers need not be adapted ◮ Configuration Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence XUpdates Old PGIPD protocol (asymmetric): ◮ ◮ Display → Broker: <createcmd>, <editcmd> Broker → Display: <newcmd>, <delcmd>, <replacecmd> New PGIPD protocol: ◮ Rephrase in terms of Xupdate-modifications <insert-after>, <insert-before>, <remove> Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner Display User requests file to be loaded. Broker <loadparsefile> <parsescript> <parseresult> <newcmd> . . . <newcmd> Users edits a text region. <editcmd> Old text is deleted, <delcmd> edited text is inserted. <newcmd> Broker creates new prover commands. <parsescript> <parseresult> User request command to be processed. . . . <setcmdstatus> prover command <ready> <cmdstatus> . . . <cmdstatus> German Research Center for Artificial Intelligence prover command <ready> . . . Compatibility ◮ XUPDATEs cannot be generated by all displays or provers ◮ Allow components to send only new document version and compute differences inside the broker Use semantic XMLDIFF tool inside the broker ◮ ◮ ◮ ◮ ◮ Normal tree diff Configurable to take some “semantics” into account Configurable level of granularity for modifications Configuration if component can handle XUPDATES Broker generates appropriate representation for each component Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Protocol between Prover and Broker ◮ <parsescript> and <parseresult> ◮ Prover commands in native prover command syntax ◮ prover answers <normalresponse>, <errorresponse>, <ready> Unchanged, but contextualized (multiple foci) Extension: ◮ <normalresponse> can contain XUPDATES for document which are relayed to the display Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Protocols between Display with Broker In addition to PGIPD provide ◮ XML-RPC interface and ◮ HTTP in plain REST architecture HTTP Request /initsession /session1/initdocument?CONTENT /session1/document/1 /session1/document/HEAD Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner HTTP answer path to new session (/session1) HTML rendered document after parsing version 1 of the document the current version of the document German Research Center for Artificial Intelligence 1 Support for Semi Structured Documents Multiple Foci XUpdate/Semantic XMLDiff Protocols 2 Context-Sensitive Service Menus 3 Multiple Editing Displays in Parallel 4 Mutiple Document Formats Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Service Menus ◮ Allow requests of service menus for arbitrary elements in the display ◮ Requests relayed by the broker to the prover Prover returns menu description (PGML menu format) ◮ ◮ ◮ Menus contain descriptions and actions Actions can be ◮ ◮ ◮ ◮ tactic calls (traditional) requests for axiom/lemma applications (PlatΩ/TEXmacs) Computing the complete menus is expensive, most of the menu is discarded Support lazy menu computation ◮ Menu entries trigger computations which results are modifications of the menu Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence 1 Support for Semi Structured Documents Multiple Foci XUpdate/Semantic XMLDiff Protocols 2 Context-Sensitive Service Menus 3 Multiple Editing Displays in Parallel 4 Mutiple Document Formats Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Multiple Editing Displays RichTotalOrder Display Components Middleware inst−118 ExtTotalOrder basic−88 Prover 1 IP D PG PGI P P Graphical User Interface inst−92 union−63 inst−59 inst−69 Prover 2 PP PGI PGIPD PG IP D inst−57 inst−67 inst−84 Rat union−61 union−56 union−66 union−83 basic−12 TotalOrder inst−11 inst−54 union−10 union−53 inst−115 ExtPartialOrder basic−78 union−86 union−117 inst−81 inst−77 union−75 inst−112 inst−74 union−90 union−76 Int inst−109 union−73 union−114 union−108 PartialOrder basic−7 inst−51 inst−6 union−50 union−5 union−58 EquivalenceRelation union−48 inst−45 union−44 union−30 TransitiveRelation union−46 inst−31 union−37 union−27 ReflexiveRelation inst−38 union−32 inst−121 union−35 PartialEquivalenceRelation inst−47 RichBooleanAlgebra inst−36 PreOrder Nat basic−2 inst−28 union−25 SymmetricRelation inst−33 inst−26 inst−17 inst−20 basic−42 union−16 union−19 union−41 Eclipse German Research Center for Artificial Intelligence basic−103 inst−102 basic−101 basic−40 basic−100 inst−99 SigOrder inst−23 Text Editor inst−111 ExtBooleanAlgebra SimilarityRelation basic−80 union−22 File System Theory Store Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner inst−91 union−85 inst−62 Relation Broker RichPartialOrder inst−87 inst−64 union−68 daVinci V2.1 Prover Components union−97 inst−96 union−120 union−95 inst−107 union−98 BooleanAlgebra union−110 un Multiple Editing Displays RichTotalOrder Display Components Middleware inst−118 ExtTotalOrder basic−88 Prover 1 IP D PG PGI P P Graphical User Interface inst−92 union−63 inst−59 inst−69 Prover 2 PP PGI PGIPD PG IP D inst−57 inst−67 inst−84 Rat union−61 union−56 union−66 union−83 basic−12 TotalOrder inst−11 inst−54 union−10 union−53 inst−115 ExtPartialOrder basic−78 union−86 union−117 inst−81 inst−77 union−75 inst−112 inst−74 union−90 union−76 Int inst−109 union−73 union−114 union−108 PartialOrder basic−7 inst−51 inst−6 union−50 union−5 union−58 EquivalenceRelation union−48 inst−45 union−44 union−30 TransitiveRelation union−46 inst−31 union−37 union−27 ReflexiveRelation inst−38 union−32 inst−121 union−35 PartialEquivalenceRelation inst−47 RichBooleanAlgebra inst−36 PreOrder Nat basic−2 inst−28 union−25 SymmetricRelation inst−33 inst−26 inst−17 inst−20 basic−42 union−16 union−19 union−41 Eclipse Requires Synchronisation by the Broker German Research Center for Artificial Intelligence basic−103 inst−102 basic−101 basic−40 basic−100 inst−99 SigOrder inst−23 Text Editor inst−111 ExtBooleanAlgebra SimilarityRelation basic−80 union−22 File System Theory Store Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner inst−91 union−85 inst−62 Relation Broker RichPartialOrder inst−87 inst−64 union−68 daVinci V2.1 Prover Components union−97 inst−96 union−120 union−95 inst−107 union−98 BooleanAlgebra union−110 un Multiple Displays ◮ ◮ ◮ ◮ Simple kind of version control inside the broker Broker stores for each display the latest version communicated Broker Display #1 Rev. 47 User changes Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner Rev. 47 Display #2 Latest rev, Display #2 Head Rev. 47 Rev. 47 Rev. 47 commit User changes Rev. 47’ Uses semantic XMLMerge (diff3) Conflicts are marked in special markup extending XUpdate markup. Latest rev, Display #1 Rev. 47 Rev. 47’ Rev. 48 New head ! new revision ack. Rev. 48 CT LI F ON C Rev. 48 Rev. 48 Rev. 47’’ Conflict resolved Rev. 47’’ new revision new revision ack. Rev. 49 commit ack. Rev. 49 Rev. 49 Rev. 49 Rev. 49 German Research Center for Artificial Intelligence 1 Support for Semi Structured Documents Multiple Foci XUpdate/Semantic XMLDiff Protocols 2 Context-Sensitive Service Menus 3 Multiple Editing Displays in Parallel 4 Mutiple Document Formats Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Multiple Document Formats ◮ Have: Display D communicates in format A ◮ Have: Prover P communicates in format B ◮ Wanted: Use display D with prover P TEXmacs PL PL ⇋ OMDoc For instance: ◮ ◮ OMDoc PlatΩ connects TEXmacs with format PL to Ωmega with format OMDoc Broker Now want to use TEXmacs with Isabelle (Isar) OMDoc Isar ⇋ OMDoc Isar Prover Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Multiple Document Formats ◮ Have: Display D communicates in format A ◮ Have: Prover P communicates in format B ◮ Wanted: Use display D with prover P TEXmacs PL PL ⇋ OMDoc For instance: ◮ OMDoc PlatΩ connects TEXmacs with format PL to Ωmega with format OMDoc Now want to use TEXmacs with Isabelle (Isar) Provide autonomous converters from PL to OMDoc and OMDoc and Isar Broker ◮ ◮ Bidirectional ◮ Conversion of Xupdates ◮ Maintain mappings to relay service requests Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner OMDoc Isar ⇋ OMDoc Isar Prover German Research Center for Artificial Intelligence Related Work ◮ Semi-structured input documents MathsTiles (structured input to multiple domain reasoners, unidirectional) ◮ Multiple foci Ωmega (status management added), Isabelle (multi-foci under the way) ◮ Multiple displays Matita (proof script,goal display), LΩui, GeoProof/ Coq ◮ Support modifications to the document from the prover: Matita (tinycals) Could be realised by the generic functionality proposed here? Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence Next Steps ◮ Implementation (any feedback/remarks welcome before we start. . . ) ◮ Implement PlatΩ functionality on PGIP 2 basis ◮ Connect other editing displays (Word 2007, OpenOffice, Netbeans) ◮ Multiple foci, changes from prover could serve interaction styles in other provers (Agda, Mizar, PVS) Towards Merging PlatΩ and PGIP Aspinall, Autexier, Lüth, Wagner German Research Center for Artificial Intelligence