| 17735 |      1 | # 
 | 
|  |      2 | # RELAX NG Schema for PGIP, the Proof General Interface Protocol                   
 | 
|  |      3 | # 
 | 
|  |      4 | # Authors:  David Aspinall, LFCS, University of Edinburgh       
 | 
|  |      5 | #           Christoph Lueth, University of Bremen       
 | 
|  |      6 | #
 | 
|  |      7 | # Version: $Id$    
 | 
|  |      8 | # 
 | 
|  |      9 | # Status:   Prototype.
 | 
|  |     10 | #
 | 
|  |     11 | # For additional commentary, see accompanying commentary document available at
 | 
|  |     12 | # http://proofgeneral.inf.ed.ac.uk/Kit/docs/commentary.pdf
 | 
|  |     13 | #
 | 
|  |     14 | # Advertised version: 2.0
 | 
|  |     15 | # 
 | 
|  |     16 | # Contents
 | 
|  |     17 | # ========
 | 
|  |     18 | #
 | 
|  |     19 | #  0. Prelude
 | 
|  |     20 | #  1. Top-level 
 | 
|  |     21 | #  2. Component Control messages
 | 
|  |     22 | #  3. Display Commands
 | 
|  |     23 | #  4. Prover Configuration
 | 
|  |     24 | #  5. Interface Configuration
 | 
|  |     25 | #  6. Prover Control
 | 
|  |     26 | #  7. Proof script markup and proof control
 | 
|  |     27 | #
 | 
|  |     28 | 
 | 
|  |     29 | # ==============================================================================
 | 
|  |     30 | # 0. Prelude
 | 
|  |     31 | # ==============================================================================
 | 
|  |     32 | 
 | 
|  |     33 | include "pgml.rnc"                           # include PGML grammar
 | 
|  |     34 | 
 | 
|  |     35 | name_attr = attribute name { text }          # names are user-level textual identifiers
 | 
|  |     36 | thyname_attr = attribute thyname { text }    # names for theories (special case of name)
 | 
|  |     37 | thmname_attr = attribute thmname { text }    # names for theorems (special case of name)
 | 
|  |     38 | 
 | 
|  |     39 | datetime_attr = 
 | 
|  |     40 |    attribute datetime { xsd:dateTime }       # CCYY-MM-DDHH:MM:SS plus timezone info
 | 
|  |     41 | url_attr  = attribute url { xsd:anyURI }     # URLs  (often as "file:///localfilename.extn")
 | 
|  |     42 | dir_attr  = attribute dir { text }           # Unix-style directory name (no final slash)
 | 
|  |     43 | 
 | 
|  |     44 | systemdata_attr  = 
 | 
|  |     45 |             attribute systemdata { text }?   # system-specific data (useful for "stateless" RPC)
 | 
|  |     46 | 
 | 
|  |     47 | 
 | 
|  |     48 | objname = string
 | 
|  |     49 | termobjname = string                         # (User-level) object names, semi-colon terminated
 | 
|  |     50 | objnames = string                            # A sequence of objnames
 | 
|  |     51 | 
 | 
|  |     52 | #termobjname  = xsd:string { pattern = "[^;]+;" }  # unfortunately these declarations don't 
 | 
|  |     53 | #objnames = objname+                               #  work with the RNC->DTD tool trang
 | 
|  |     54 | 
 | 
|  |     55 | 
 | 
|  |     56 | # ==============================================================================
 | 
|  |     57 | # 1. Top-level Messages/documents
 | 
|  |     58 | # ==============================================================================
 | 
|  |     59 | 
 | 
|  |     60 | start = pgip                                 # Single message
 | 
|  |     61 |       | pgips                                # A log of messages between components
 | 
|  |     62 |       | displayconfig                        # displayconfig as a standalone element
 | 
|  |     63 |       | pgipconfig                           # pgipconfig as a standalone element
 | 
|  |     64 | 
 | 
|  |     65 | pgip = element pgip {                        #  A PGIP packet contains:
 | 
|  |     66 |    pgip_attrs,                               #   - attributes with header information;
 | 
|  |     67 |    (toprovermsg | todisplaymsg |             #   - a message with one of four channel types
 | 
|  |     68 |     fromprovermsg | fromdisplaymsg 
 | 
|  |     69 |    | internalmsg ) 
 | 
|  |     70 |   }
 | 
|  |     71 | 
 | 
|  |     72 | pgips = element pgips { pgip+ }
 | 
|  |     73 | 
 | 
|  |     74 | pgip_attrs =
 | 
|  |     75 |  attribute tag { text }?,                   # message tag, e.g. name of origin component (diagnostic)
 | 
|  |     76 |  attribute id { text },                     # (unique) session id of this component 
 | 
|  |     77 |  attribute destid { text }?,                # session id of destination component
 | 
|  |     78 |  attribute class { pgip_class },            # general categorization of message
 | 
|  |     79 |  attribute refid { text }?,                 # component id this message responds to (usually destid)
 | 
|  |     80 |  attribute refseq { xsd:positiveInteger }?, # message sequence this message responds to
 | 
|  |     81 |  attribute seq { xsd:positiveInteger }      # sequence number of this message
 | 
|  |     82 | 
 | 
|  |     83 | pgip_class = "pg"      # message sent TO proof general broker
 | 
|  |     84 |            | "pa"      # message sent TO the proof assistant/other component
 | 
|  |     85 |            | "pd"      # message sent TO display/front-end components
 | 
|  |     86 | 
 | 
|  |     87 | toprovermsg =          # Messages sent to the prover (class "pa"):
 | 
|  |     88 |    proverconfig        #   query Prover configuration, triggering interface configuration
 | 
|  |     89 |  | provercontrol       #   control some aspect of Prover
 | 
|  |     90 |  | improperproofcmd    #   issue a proof command 
 | 
|  |     91 |  | improperfilecmd     #   issue a file command
 | 
|  |     92 |  | properproofcmd      #   [ NB: not strictly needed: input PGIP processing not expected ]
 | 
|  |     93 |  | properfilecmd       #   [ NB: not strictly needed: input PGIP processing not expected ]
 | 
|  |     94 |  | proofctxt           #   issue a context command
 | 
|  |     95 | 
 | 
|  |     96 | fromprovermsg =        # Messages from the prover to PG (class "pg"):
 | 
|  |     97 |    kitconfig           #   messages to configure the interface 
 | 
|  |     98 |  | proveroutput        #   output messages from the prover, usually display in interface
 | 
|  |     99 |  | fileinfomsg         #   information messages concerning file-system access / prover state
 | 
|  |    100 | 
 | 
|  |    101 | todisplaymsg =         # Messages sent to display components (class "pd"):
 | 
|  |    102 |    brokermsg           #   status reports from broker
 | 
|  |    103 |  | dispmsg             #   display commands
 | 
|  |    104 |                        #   - Further, all fromprovermsg can be relayed to display
 | 
|  |    105 | 
 | 
|  |    106 | fromdisplaymsg =       # Messages sent from display components (class "pg"):
 | 
|  |    107 |    dispcmd             #   display messages 
 | 
|  |    108 |  | brokercontrol       #   messages controlling broker & prover processes
 | 
|  |    109 | 		       #   - Further, all toprovermsg to be relayed to prover
 | 
|  |    110 | 
 | 
|  |    111 | # ===========================================================================
 | 
|  |    112 | # 2. Component Control
 | 
|  |    113 | # ===========================================================================
 | 
|  |    114 | 
 | 
|  |    115 | #
 | 
|  |    116 | # Idea:  - broker knows how to manage some components (inc provers) as child processes,
 | 
|  |    117 | #          communicate via pipes.  Configured by a fixed PGIP config file read on startup.
 | 
|  |    118 | #        - other components may connect to running broker
 | 
|  |    119 | #
 | 
|  |    120 | # TODO: - describe startup protocol for component connecting to to running broker dynamically.
 | 
|  |    121 | 
 | 
|  |    122 | # This is the element contained in the configuration file read by the 
 | 
|  |    123 | # broker on startup.
 | 
|  |    124 | pgipconfig = element pgipconfig { componentspec* }
 | 
|  |    125 | 
 | 
|  |    126 | componentspec = 
 | 
|  |    127 |    element componentspec {
 | 
|  |    128 |       componentid_attr,         # Unique identifier for component class
 | 
|  |    129 |       componentname_attr,       # Textual name of component class
 | 
|  |    130 |       componenttype,            # Type of component: prover, display, auxiliary
 | 
|  |    131 |       systemattrs,              # System attributes for connecting to component
 | 
|  |    132 |       componentconnect          # How to connect to component
 | 
|  |    133 |    }
 | 
|  |    134 | 
 | 
|  |    135 | componentid_attr   = attribute componentid   { token }
 | 
|  |    136 | componentname_attr = attribute componentname { text }
 | 
|  |    137 | 
 | 
|  |    138 | componenttype = element componenttype {
 | 
|  |    139 |      provercomponent 
 | 
|  |    140 |    | displaycomponent 
 | 
|  |    141 |  # | filehandlercomponent 
 | 
|  |    142 |    | parsercomponent 
 | 
|  |    143 |    | othercomponent }
 | 
|  |    144 | 
 | 
|  |    145 | provercomponent  = element provercomponent { empty }
 | 
|  |    146 | displaycomponent = element displaycomponent { attribute active { xsd:boolean}? }
 | 
|  |    147 | parsercomponent  = element parsercomponent  { componentid_attr }
 | 
|  |    148 | othercomponent   = element othercomponent { empty }
 | 
|  |    149 | 
 | 
|  |    150 | componentconnect =
 | 
|  |    151 |    componentsubprocess | componentsocket | connectbyproxy
 | 
|  |    152 | 
 | 
|  |    153 | componentsubprocess = 
 | 
|  |    154 |    element syscommand { text }
 | 
|  |    155 | componentsocket = 
 | 
|  |    156 |    (element host { text }, element port { text })
 | 
|  |    157 | connectbyproxy = 
 | 
|  |    158 |    (element proxy { attribute host { text }    # Host to connect to
 | 
|  |    159 | 		  , attribute connect { 
 | 
|  |    160 |                            "rsh" | "ssh" # Launch proxy via RSH or SSH, needs
 | 
|  |    161 | 			                 # authentication 
 | 
|  |    162 |                          | "server"  # connect to running proxy on given port
 | 
|  |    163 |                          }?
 | 
|  |    164 |                   , attribute user { text } ? # user to connect as with RSH/SSH
 | 
|  |    165 | 		  , attribute port { text } ? # port to connect to running proxy
 | 
|  |    166 | 		  , componentconnect
 | 
|  |    167 | 		  })
 | 
|  |    168 | 
 | 
|  |    169 | systemattrs = (
 | 
|  |    170 |    attribute timeout { xsd:integer }?,  # timeout for communications
 | 
|  |    171 |    attribute sync { xsd:boolean }?,     # whether to wait for ready
 | 
|  |    172 |    attribute startup {		# what to do on broker startup:
 | 
|  |    173 |              "boot"   |		# always start this component (default with displays)
 | 
|  |    174 |              "manual" |		# start manually (default with provers)
 | 
|  |    175 |              "ignore"		# never start this
 | 
|  |    176 |              }?
 | 
|  |    177 |    )
 | 
|  |    178 | 
 | 
|  |    179 | # Control commands from display to broker
 | 
|  |    180 | brokercontrol = 
 | 
|  |    181 |     launchprover		# Launch a new prover
 | 
|  |    182 |   | exitprover			# Request to terminate a running prover
 | 
|  |    183 |   | restartprover		# Request to restart/reset a running prover
 | 
|  |    184 |   | proversquery		# Query about known provers, running provers
 | 
|  |    185 |   | shutdownbroker		# Ask broker to exit (should be wary of this!)
 | 
|  |    186 |   | brokerstatusquery		# Ask broker for status report
 | 
|  |    187 |   | pgipconfig			# Send config to broker
 | 
|  |    188 | 
 | 
|  |    189 | provername_attr    = attribute provername { provername }
 | 
|  |    190 | provername         = token
 | 
|  |    191 | 
 | 
|  |    192 | proverid_attr     = attribute proverid  { proverid }
 | 
|  |    193 | proverid          = token
 | 
|  |    194 | 
 | 
|  |    195 | launchprover      = element launchprover { componentid_attr }
 | 
|  |    196 | exitprover        = element exitprover { proverid_attr }
 | 
|  |    197 | restartprover     = element restartprover { proverid_attr }
 | 
|  |    198 | proversquery      = element proversavailable { empty }
 | 
|  |    199 | brokerstatusquery = element brokerstatusquery { empty } 
 | 
|  |    200 | shutdownbroker    = element shutdownbroker { attribute force { xsd:boolean }? } 
 | 
|  |    201 | 
 | 
|  |    202 | # Control messages from broker to interface
 | 
|  |    203 | brokermsg  = 
 | 
|  |    204 |     brokerstatus		# response to brokerstatusquery:
 | 
|  |    205 |   | proveravailmsg		# announce new prover is available
 | 
|  |    206 |   | newprovermsg		# new prover has started 
 | 
|  |    207 |   | proverstatemsg		# prover state has changed (busy/ready/exit)
 | 
|  |    208 | 
 | 
|  |    209 | brokerstatus  = element brokerstatus 
 | 
|  |    210 |                        { knownprovers, runningprovers, brokerinformation }
 | 
|  |    211 | 
 | 
|  |    212 | knownprover   = element knownprover   { componentid_attr, provername }
 | 
|  |    213 | runningprover = element runningprover { proverid_attr, provername }
 | 
|  |    214 | 
 | 
|  |    215 | knownprovers   = element knownprovers { knownprover* }
 | 
|  |    216 | runningprovers = element runningprovers { runningprover* }
 | 
|  |    217 | brokerinformation = element brokerinformation { text }
 | 
|  |    218 | 
 | 
|  |    219 | proveravailmsg  = element proveravailable { provername_attr,
 | 
|  |    220 |                                             componentid_attr }
 | 
|  |    221 | newprovermsg    = element proverstarted { provername_attr, 
 | 
|  |    222 | 		                          proverid_attr }
 | 
|  |    223 |                   # QUESTION: do we want  componentid_attr 
 | 
|  |    224 |                   # here as well, and do we want to be able to run multiple
 | 
|  |    225 |                   # copies of the same prover? 
 | 
|  |    226 | proverstatemsg = element proverstate { 
 | 
|  |    227 |                        proverid_attr, provername_attr,
 | 
|  |    228 |                        attribute proverstate {proverstate} } 
 | 
|  |    229 | 
 | 
|  |    230 | proverstate    = ("ready" | "busy" | "exitus")
 | 
|  |    231 | 
 | 
|  |    232 | # FIXME: This only allows provers to be available which are configured.
 | 
|  |    233 | #        In the long run, we want to change configurations while running.
 | 
|  |    234 | 
 | 
|  |    235 | 
 | 
|  |    236 | # ===========================================================================
 | 
|  |    237 | # 3. Display Commands
 | 
|  |    238 | # ===========================================================================
 | 
|  |    239 | 
 | 
|  |    240 | # Messages exchanged between broker and display
 | 
|  |    241 | 
 | 
|  |    242 |                         
 | 
|  |    243 | dispcmd = dispfilecmd | dispobjcmd  # display commands go from display to broker
 | 
|  |    244 | dispmsg = dispfilemsg | dispobjmsg  # display messages go from broker to display
 | 
|  |    245 |    
 | 
|  |    246 | 
 | 
|  |    247 | dispfilecmd = 
 | 
|  |    248 |     loadparsefile		# parse and load file
 | 
|  |    249 |   | newfilewith			# create new source file with given text
 | 
|  |    250 |   | dispopenfile		# open (or create) new file 
 | 
|  |    251 |   | savefile			# save opened file
 | 
|  |    252 |   | discardfile			# discard changes to opened file
 | 
|  |    253 | 
 | 
|  |    254 | dispfilemsg =
 | 
|  |    255 |     newfile			# announce creation of new file (in response to load/open)
 | 
|  |    256 |   | filestatus			#announce change in status of file in broker
 | 
|  |    257 | 
 | 
|  |    258 | # unique identifier of loaded files
 | 
|  |    259 | srcid_attr = attribute srcid { text }
 | 
|  |    260 | 
 | 
|  |    261 | loadparsefile = element loadparsefile { url_attr, proverid_attr }
 | 
|  |    262 | newfilewith   = element newfilewith   { url_attr, proverid_attr, text }
 | 
|  |    263 | dispopenfile  = element dispopenfile { url_attr,
 | 
|  |    264 |                                        proverid_attr,
 | 
|  |    265 |                                        attribute overwrite { xsd:boolean }?}
 | 
|  |    266 | savefile      = element savefile { srcid_attr,     
 | 
|  |    267 |                                    url_attr? }
 | 
|  |    268 | discardfile   = element discardfile { srcid_attr }
 | 
|  |    269 | 
 | 
|  |    270 | newfile       = element newfile  { proverid_attr, srcid_attr, url_attr }
 | 
|  |    271 | filestatus    = element filestatus  { proverid_attr, srcid_attr, newstatus_attr, 
 | 
|  |    272 | 				      datetime_attr} 
 | 
|  |    273 | 
 | 
|  |    274 | newstatus_attr = attribute newstatus { "saved" | "changed" | "discarded" }
 | 
|  |    275 | 
 | 
|  |    276 | dispobjcmd =
 | 
|  |    277 |     setobjstate			# request of change of state 
 | 
|  |    278 |   | editobj			# request edit operation of opbjects
 | 
|  |    279 |   | createobj			# request creation of new objects
 | 
|  |    280 |   | inputcmd		        # process the command (generated by an input event)
 | 
|  |    281 |   | interruptprover		# send interrupt or kill signal to prover
 | 
|  |    282 | 
 | 
|  |    283 | dispobjmsg = element dispobjmsg { 
 | 
|  |    284 |       newobj+			# new objects have been created
 | 
|  |    285 |     | delobj+			# objects have been deleted
 | 
|  |    286 |     | replaceobjs		# objects are being replaced
 | 
|  |    287 |     | objectstate+		# objects have changed state
 | 
|  |    288 |     }
 | 
|  |    289 | 
 | 
|  |    290 | newobj = element newobj {
 | 
|  |    291 | 	    proverid_attr,
 | 
|  |    292 |             srcid_attr, 
 | 
|  |    293 | 	    objid_attr, 
 | 
|  |    294 |             attribute objposition { objid } ?,
 | 
|  |    295 |             objtype_attr ?,
 | 
|  |    296 |             attribute objparent { objid }?,
 | 
|  |    297 |             attribute objstate { objstate },
 | 
|  |    298 |             (properscriptcmd | unparseable) }
 | 
|  |    299 | 
 | 
|  |    300 | replaceobjs = element replaceobjs {
 | 
|  |    301 | 	                srcid_attr,
 | 
|  |    302 | 	                attribute replacedfrom { objid }? ,
 | 
|  |    303 | 			attribute replacedto { objid }?,
 | 
|  |    304 |                         delobj*,
 | 
|  |    305 |                         newobj+ }
 | 
|  |    306 | 
 | 
|  |    307 | delobj = element delobj   { proverid_attr, srcid_attr, objid_attr }
 | 
|  |    308 | 
 | 
|  |    309 | objectstate = element objstate
 | 
|  |    310 |                        { proverid_attr, srcid_attr, objid_attr,
 | 
|  |    311 |                          attribute newstate {objstate} }
 | 
|  |    312 | 
 | 
|  |    313 | setobjstate = element setobjstate
 | 
|  |    314 |                   {  objid_attr, attribute newstate {objstate} }
 | 
|  |    315 | 
 | 
|  |    316 | editobj = element editobj { srcid_attr ?,
 | 
|  |    317 | 	                    attribute editfrom { objid }?,
 | 
|  |    318 |                             attribute editto   { objid }?,
 | 
|  |    319 |                             text }
 | 
|  |    320 | createobj = element createobj { srcid_attr ?, 
 | 
|  |    321 |                                 attribute objposition { objid }?, 
 | 
|  |    322 |                                 text}
 | 
|  |    323 | 
 | 
|  |    324 | inputcmd       = element inputcmd { improper_attr, text }
 | 
|  |    325 | improper_attr  = attribute improper { xsd:boolean }
 | 
|  |    326 | 
 | 
|  |    327 | interruptprover = element interruptprover 
 | 
|  |    328 |                           { interruptlevel_attr, proverid_attr }
 | 
|  |    329 | 
 | 
|  |    330 | interruptlevel_attr  = attribute interruptlevel { "interrupt" | "stop" | "kill" }
 | 
|  |    331 | 
 | 
|  |    332 | objid_attr = attribute objid { objid } 
 | 
|  |    333 | objid      = text 
 | 
|  |    334 | 
 | 
|  |    335 | objstate = 
 | 
|  |    336 |   ( "unparseable" | "parsed" | "being_processed" | "processed" | "outdated" )
 | 
|  |    337 | 
 | 
|  |    338 | 
 | 
|  |    339 | # ==============================================================================
 | 
|  |    340 | #  4. Prover Configuration
 | 
|  |    341 | # ==============================================================================
 | 
|  |    342 | 
 | 
|  |    343 | proverconfig =      
 | 
|  |    344 |    askpgip			# what version of PGIP do you support?
 | 
|  |    345 |  | askpgml			# what version of PGML do you support?
 | 
|  |    346 |  | askconfig			# tell me about objects and operations
 | 
|  |    347 |  | askprefs			# what preference settings do you offer?
 | 
|  |    348 |  | setpref			# please set this preference value 
 | 
|  |    349 |  | getpref			# please tell me this preference value
 | 
|  |    350 | 
 | 
|  |    351 | 
 | 
|  |    352 | 
 | 
|  |    353 | prefcat_attr = attribute prefcategory { text}   # e.g. "expert", "internal", etc.
 | 
|  |    354 |                                                 # could be used for tabs in dialog
 | 
|  |    355 | 
 | 
|  |    356 | askpgip   = element askpgip   { empty }
 | 
|  |    357 | askpgml   = element askpgml   { empty }
 | 
|  |    358 | askconfig = element askconfig { empty }
 | 
|  |    359 | askprefs  = element askprefs  { prefcat_attr? }
 | 
|  |    360 | setpref   = element setpref   { name_attr, prefcat_attr?, pgipvalue }
 | 
|  |    361 | getpref   = element getpref   { name_attr, prefcat_attr? }
 | 
|  |    362 | 
 | 
|  |    363 |  
 | 
|  |    364 | 
 | 
|  |    365 | # ==============================================================================
 | 
|  |    366 | #  5. Interface Configuration
 | 
|  |    367 | # ==============================================================================
 | 
|  |    368 | 
 | 
|  |    369 | kitconfig =        
 | 
|  |    370 |     usespgip			# I support PGIP, version ..
 | 
|  |    371 |   | usespgml			# I support PGML, version ..
 | 
|  |    372 |   | pgmlconfig			# configure PGML symbols
 | 
|  |    373 |   | proverinfo			# Report assistant information
 | 
|  |    374 |   | hasprefs			# I have preference settings ...
 | 
|  |    375 |   | prefval			# the current value of a preference is
 | 
|  |    376 |   | displayconfig		# configure the following object types and operations
 | 
|  |    377 |   | setids			# inform the interface about some known objects
 | 
|  |    378 |   | addids			# add some known identifiers
 | 
|  |    379 |   | delids			# retract some known identifers
 | 
|  |    380 |   | idvalue			# display the value of some identifier
 | 
|  |    381 |   | menuadd			# add a menu entry
 | 
|  |    382 |   | menudel			# remove a menu entry
 | 
|  |    383 | 
 | 
|  |    384 | # version reporting
 | 
|  |    385 | version_attr  = attribute version { text }
 | 
|  |    386 | usespgml = element usespgml  { version_attr }
 | 
|  |    387 | usespgip = element usespgip  { version_attr 
 | 
|  |    388 | 	                     , activecompspec
 | 
|  |    389 | 			     }
 | 
|  |    390 | 
 | 
|  |    391 | # These data from the component spec which an active component can override, or which
 | 
|  |    392 | # components initiating contact with the broker (e.g. incoming socket connections).
 | 
|  |    393 | # There are some restrictions: if we start a tool, the componentid and the type must be the
 | 
|  |    394 | # same as initially specified.
 | 
|  |    395 | activecompspec =  ( componentid_attr?   # unique identifier of component class
 | 
|  |    396 | 	          , componentname_attr? # Textual name of this component (overrides initial spec)
 | 
|  |    397 | 		  , componenttype?      # Type of component
 | 
|  |    398 | 		  , acceptedpgipelems?  # list of accepted elements
 | 
|  |    399 | 		  )
 | 
|  |    400 | 
 | 
|  |    401 | 
 | 
|  |    402 | acceptedpgipelems = element acceptedpgipelems { singlepgipelem* }
 | 
|  |    403 | 
 | 
|  |    404 | singlepgipelem    = element pgipelem { 
 | 
|  |    405 |    attribute async { xsd:boolean }?,  # true if this command supported asynchronously (deflt false)
 | 
|  |    406 |    text }                             # (otherwise part of ready/sync stream)
 | 
|  |    407 | 
 | 
|  |    408 | # PGML configuration
 | 
|  |    409 | pgmlconfig = element pgmlconfig { pgmlconfigure+ }
 | 
|  |    410 | 
 | 
|  |    411 | # Types for config settings: corresponding data values should conform to canonical
 | 
|  |    412 | # representation for corresponding XML Schema 1.0 Datatypes.  (This representation is verbose
 | 
|  |    413 | # but helps for error checking later)
 | 
|  |    414 | #
 | 
|  |    415 | # In detail:
 | 
|  |    416 | #  pgipbool   = xsd:boolean = true | false
 | 
|  |    417 | #  pgipint    = xsd:integer = (-)?(0-9)+     (canonical: no leading zeroes)
 | 
|  |    418 | #  pgipstring = xsd:string  =  <any character sequence>
 | 
|  |    419 | #  pgipchoice = cf xs:choice  = type1 | type2 | ... | typen
 | 
|  |    420 | 
 | 
|  |    421 | pgiptype   = pgipbool | pgipint | pgipstring | pgipchoice | pgipconst
 | 
|  |    422 | pgipbool   = element pgipbool { empty }
 | 
|  |    423 | 
 | 
|  |    424 | pgipint    = element pgipint  { min_attr?, max_attr?, empty }
 | 
|  |    425 | min_attr   = attribute min { xsd:integer }
 | 
|  |    426 | max_attr   = attribute max { xsd:integer }
 | 
|  |    427 | pgipstring = element pgipstring { empty }
 | 
|  |    428 | pgipchoice = element pgipchoice { pgiptype+ }
 | 
|  |    429 | pgipconst  = element pgipconst { name_attr?, text }
 | 
|  |    430 | 
 | 
|  |    431 | pgipvalue  = text
 | 
|  |    432 | 
 | 
|  |    433 | icon  = element icon { xsd:base64Binary }  # image data for an icon
 | 
|  |    434 | 
 | 
|  |    435 | default_attr = attribute default { text }
 | 
|  |    436 | descr_attr   = attribute descr { text }
 | 
|  |    437 | 
 | 
|  |    438 | # icons for preference recommended size: 32x32 
 | 
|  |    439 | # top level preferences: may be used in dialog for preference setting
 | 
|  |    440 | # object preferences: may be used as an "emblem" to decorate 
 | 
|  |    441 | # object icon (boolean preferences with default false, only)
 | 
|  |    442 | haspref = element haspref  { 
 | 
|  |    443 |    name_attr, descr_attr?, 
 | 
|  |    444 |    default_attr?, icon?,
 | 
|  |    445 |    pgiptype
 | 
|  |    446 | }
 | 
|  |    447 | 
 | 
|  |    448 | hasprefs = element hasprefs { prefcat_attr?, haspref* }
 | 
|  |    449 | 
 | 
|  |    450 | prefval = element prefval { name_attr, pgipvalue } 
 | 
|  |    451 | 
 | 
|  |    452 | # menu items (incomplete, FIXME)
 | 
|  |    453 | path_attr = attribute path { text }
 | 
|  |    454 | 
 | 
|  |    455 | menuadd  = element menuadd  { path_attr?, name_attr?, opn_attr? }
 | 
|  |    456 | menudel  = element menudel  { path_attr?, name_attr? }
 | 
|  |    457 | opn_attr = attribute operation { token }
 | 
|  |    458 | 
 | 
|  |    459 | 
 | 
|  |    460 | # Display configuration information: 
 | 
|  |    461 | # basic prover information, lexical structure of files, 
 | 
|  |    462 | # an icon for the prover, help documents, and the 
 | 
|  |    463 | # objects, types, and operations for building proof commands.
 | 
|  |    464 | 
 | 
|  |    465 | # NB: the following object types have a fixed interpretation 
 | 
|  |    466 | # in PGIP:  "comment", "theorem", "theory", "file" 
 | 
|  |    467 | 
 | 
|  |    468 | displayconfig =
 | 
|  |    469 |   element displayconfig { 
 | 
|  |    470 |      welcomemsg?, icon?, helpdoc*, lexicalstructure*,
 | 
|  |    471 |      objtype*, opn* }
 | 
|  |    472 | 
 | 
|  |    473 | objtype = element objtype { name_attr, descr_attr?, icon?, hasprefs?, contains* }
 | 
|  |    474 | 
 | 
|  |    475 | objtype_attr = attribute objtype { token }           # the name of an objtype
 | 
|  |    476 | contains = element contains { objtype_attr, empty }  #  a container for other objtypes
 | 
|  |    477 | 
 | 
|  |    478 | opn   = element opn { name_attr, inputform?, opsrc, optrg, opcmd, improper_attr? }
 | 
|  |    479 | 
 | 
|  |    480 | opsrc = element opsrc { list { token* } }  # source types: a space separated list
 | 
|  |    481 | optrg = element optrg { token }?           # single target type, empty for proof command
 | 
|  |    482 | opcmd = element opcmd { text }             # prover command, with printf-style "%1"-args
 | 
|  |    483 | 
 | 
|  |    484 | # interactive operations - require some input
 | 
|  |    485 | inputform = element inputform { field+ }  
 | 
|  |    486 | 
 | 
|  |    487 | # a field has a PGIP config type (int, string, bool, choice(c1...cn)) and a name; under that
 | 
|  |    488 | # name, it will be substituted into the command Ex. field name=number opcmd="rtac %1 %number"
 | 
|  |    489 | 
 | 
|  |    490 | field = element field { 
 | 
|  |    491 |    name_attr, pgiptype,
 | 
|  |    492 |    element prompt { text }
 | 
|  |    493 | }
 | 
|  |    494 | 
 | 
|  |    495 | # identifier tables: these list known items of particular objtype.
 | 
|  |    496 | # Might be used for completion or menu selection, and inspection.
 | 
|  |    497 | # May have a nested structure (but objtypes do not).
 | 
|  |    498 | 
 | 
|  |    499 | setids  = element setids { idtable* }   # (with an empty idtable, clear table)
 | 
|  |    500 | addids  = element addids { idtable* }
 | 
|  |    501 | delids  = element delids { idtable* }
 | 
|  |    502 | 
 | 
|  |    503 | # give value of some identifier (response to showid)
 | 
|  |    504 | idvalue = element idvalue               
 | 
|  |    505 |    {  name_attr, objtype_attr, pgmltext }
 | 
|  |    506 | 
 | 
|  |    507 | idtable    = element idtable { context_attr?, objtype_attr, identifier* }
 | 
|  |    508 | identifier = element identifier { token }
 | 
|  |    509 | 
 | 
|  |    510 | context_attr = attribute context { token } # parent identifier (context) 
 | 
|  |    511 | 
 | 
|  |    512 | instance_attr = attribute instance { text }
 | 
|  |    513 | 
 | 
|  |    514 | # prover information: 
 | 
|  |    515 | # name, instance (e.g. in case of major parameter of invocation);
 | 
|  |    516 | # description, version, homepage,  welcome message, docs available
 | 
|  |    517 | proverinfo = element proverinfo 
 | 
|  |    518 |    { name_attr, version_attr?, instance_attr?,
 | 
|  |    519 |      descr_attr?, url_attr?, filenameextns_attr?, 
 | 
|  |    520 | ## TEMP: these elements are duplicated in displayconfig, as they're
 | 
|  |    521 | ## moving there.  
 | 
|  |    522 |       welcomemsg?, icon?, helpdoc*, lexicalstructure* }
 | 
|  |    523 | 
 | 
|  |    524 | welcomemsg = element welcomemsg { text }
 | 
|  |    525 | 
 | 
|  |    526 | # helpdoc: advertise availability of some documentation, given a canonical
 | 
|  |    527 | # name, textual description, and URL or viewdoc argument.
 | 
|  |    528 | # 
 | 
|  |    529 | helpdoc = element helpdoc { name_attr, descr_attr, url_attr?, text } # text is arg to "viewdoc"
 | 
|  |    530 | 
 | 
|  |    531 | filenameextns_attr = attribute filenameextns { objnames }
 | 
|  |    532 | 
 | 
|  |    533 | # lexical structure of proof texts
 | 
|  |    534 | lexicalstructure = 
 | 
|  |    535 |    element lexicalstructure {
 | 
|  |    536 |       keyword*,
 | 
|  |    537 |       stringdelimiter*,
 | 
|  |    538 |       escapecharacter?,
 | 
|  |    539 |       commentdelimiter*,
 | 
|  |    540 |       identifiersyntax?
 | 
|  |    541 |    }
 | 
|  |    542 | 
 | 
|  |    543 | keyword = element keyword {
 | 
|  |    544 |    attribute word { text },
 | 
|  |    545 |    shorthelp?,
 | 
|  |    546 |    longhelp? }
 | 
|  |    547 | 
 | 
|  |    548 | shorthelp = element shorthelp { text }   # one-line (tooltip style) help 
 | 
|  |    549 | longhelp  = element longhelp { text }    # multi-line help
 | 
|  |    550 | 
 | 
|  |    551 | stringdelimiter = element stringdelimiter { text }  # should be a single char
 | 
|  |    552 | 
 | 
|  |    553 | # The escape character is used to escape strings and other special characters - in most languages it is \
 | 
|  |    554 | escapecharacter = element escapecharacter { text }  # should be a single char
 | 
|  |    555 | 
 | 
|  |    556 | commentdelimiter = element commentdelimiter { 
 | 
|  |    557 |    attribute start { text },
 | 
|  |    558 |    attribute end { text }?,
 | 
|  |    559 |    empty
 | 
|  |    560 |   }
 | 
|  |    561 | 
 | 
|  |    562 | 
 | 
|  |    563 | # syntax for ids: id = initial allowed*  or id = allowed+ if initial empty
 | 
|  |    564 | identifiersyntax = element identifiersyntax { 
 | 
|  |    565 |    attribute initialchars { text }?,
 | 
|  |    566 |    attribute allowedchars { text }
 | 
|  |    567 | }
 | 
|  |    568 | 
 | 
|  |    569 | # ==============================================================================
 | 
|  |    570 | # 6. Prover Control
 | 
|  |    571 | # ==============================================================================
 | 
|  |    572 | 
 | 
|  |    573 | provercontrol = 
 | 
|  |    574 |    proverinit			# reset prover to its initial state
 | 
|  |    575 |  | proverexit			# exit prover
 | 
|  |    576 |  | startquiet			# stop prover sending proof state displays, non-urgent messages
 | 
|  |    577 |  | stopquiet			# turn on normal proof state & message displays
 | 
|  |    578 |  | pgmlsymbolson		# activate use of symbols in PGML output (input always understood)
 | 
|  |    579 |  | pgmlsymbolsoff		# deactivate use of symbols in PGML output
 | 
|  |    580 | 
 | 
|  |    581 | proverinit     = element proverinit { empty }  
 | 
|  |    582 | proverexit     = element proverexit { empty }
 | 
|  |    583 | startquiet     = element startquiet { empty }  
 | 
|  |    584 | stopquiet      = element stopquiet  { empty }  
 | 
|  |    585 | pgmlsymbolson  = element pgmlsymbolson { empty }
 | 
|  |    586 | pgmlsymbolsoff = element pgmlsymbolsoff { empty }
 | 
|  |    587 | 
 | 
|  |    588 | 
 | 
|  |    589 | # General prover output/responses
 | 
|  |    590 | 
 | 
|  |    591 | # Nearly all prover output has an optional proverid attribute, except for the one which is 
 | 
|  |    592 | # never seen by any display. This is set by the Broker to indicate the originating or referring
 | 
|  |    593 | # prover. 
 | 
|  |    594 | # Displays rendering these messages can rely on this attribute being set.
 | 
|  |    595 | 
 | 
|  |    596 | proveroutput =
 | 
|  |    597 |    ready			# prover is ready for input
 | 
|  |    598 |  | cleardisplay			# prover requests a display area to be cleared
 | 
|  |    599 |  | proofstate			# prover outputs the proof state
 | 
|  |    600 |  | normalresponse		# prover outputs some display
 | 
|  |    601 |  | errorresponse		# prover indicates an error/warning/debug condition, with message
 | 
|  |    602 |  | scriptinsert			# some text to insert literally into the proof script
 | 
|  |    603 |  | metainforesponse		# prover outputs some other meta-information to interface
 | 
|  |    604 |  | parseresult			# results of a <parsescript> request (see later)
 | 
|  |    605 | 
 | 
|  |    606 | ready = element ready { empty }
 | 
|  |    607 | 
 | 
|  |    608 | displayarea = "status"		# a status line
 | 
|  |    609 | 	    | "message"		# the message area (e.g. response buffer)
 | 
|  |    610 |             | "display"		# the main display area (e.g. goals buffer)
 | 
|  |    611 | 	    | token		# prover-specified window name
 | 
|  |    612 | 
 | 
|  |    613 | cleardisplay = 
 | 
|  |    614 |    element cleardisplay {
 | 
|  |    615 |       proverid_attr?,
 | 
|  |    616 |       attribute area { 
 | 
|  |    617 |          displayarea | "all" } }           
 | 
|  |    618 | 
 | 
|  |    619 | 
 | 
|  |    620 | proofstate = 
 | 
|  |    621 |   element proofstate { proverid_attr?, pgml }
 | 
|  |    622 | 
 | 
|  |    623 | messagecategory =		# attribution of message
 | 
|  |    624 |    "internal"			#  - internal debug message (interface should usually hide)
 | 
|  |    625 |  | "information"		#  - user-level debug/info message (interface may hide)
 | 
|  |    626 |  | "tracing"			#  - user-level "tracing" message (possibly voluminous)
 | 
|  |    627 | 
 | 
|  |    628 | normalresponse =                           
 | 
|  |    629 |   element normalresponse { 
 | 
|  |    630 |     proverid_attr?,
 | 
|  |    631 |     attribute area { displayarea },
 | 
|  |    632 |     attribute messagecategory { messagecategory }?, # optional extra category (e.g. tracing/debug)
 | 
|  |    633 |     attribute urgent { "y" }?,                      # indication that message must be displayed
 | 
|  |    634 |     pgmltext 
 | 
|  |    635 | }
 | 
|  |    636 | 
 | 
|  |    637 | ## Error messages:  these are different from ordinary messages in that
 | 
|  |    638 | ##		    they indicate an error condition in the prover, with a notion
 | 
|  |    639 | ##		    of fatality and (optionally) a location.  The interface may collect these
 | 
|  |    640 | ##		    messages in a log, display in a modal dialog, or in the specified
 | 
|  |    641 | ##		    display area if one is specified.
 | 
|  |    642 | 
 | 
|  |    643 | errorresponse = 
 | 
|  |    644 |    element errorresponse { 
 | 
|  |    645 |      proverid_attr?,
 | 
|  |    646 |      attribute area { displayarea }?,
 | 
|  |    647 |      attribute fatality { fatality },
 | 
|  |    648 |      location_attrs,
 | 
|  |    649 |      pgmltext
 | 
|  |    650 |   }
 | 
|  |    651 | 
 | 
|  |    652 | fatality =	  # degree of error conditions:
 | 
|  |    653 |    "nonfatal"     #  - warning message (interface should show message)
 | 
|  |    654 |  | "fatal"        #  - error message (interface must show message)
 | 
|  |    655 |  | "panic"        #  - shutdown condition, component exits (interface may show message)
 | 
|  |    656 |  | "log"          #  - log message (interface must not show message, write to broker log file)
 | 
|  |    657 |  | "debug"        #  - debug message (interface may show message, write to broker log file)
 | 
|  |    658 | 		   ## FIXME da: wondering if this is more appropriate than normal/internal above
 | 
|  |    659 | 
 | 
|  |    660 | 
 | 
|  |    661 | # attributes describing a file location (for error messages, etc)
 | 
|  |    662 | location_attrs = 
 | 
|  |    663 |      attribute location_descr    { text }?,
 | 
|  |    664 |      attribute location_url      { xsd:anyURI }?,
 | 
|  |    665 |      attribute locationline      { xsd:positiveInteger }?,
 | 
|  |    666 |      attribute locationcolumn    { xsd:positiveInteger }?,
 | 
|  |    667 |      attribute locationcharacter { xsd:positiveInteger }?
 | 
|  |    668 | 
 | 
|  |    669 | scriptinsert = element scriptinsert { proverid_attr?, metavarid_attr?, text }
 | 
|  |    670 | 
 | 
|  |    671 | 
 | 
|  |    672 | # metainformation is an extensible place to put system-specific information
 | 
|  |    673 | 
 | 
|  |    674 | value = element value { name_attr?, text }   # generic value holder
 | 
|  |    675 | 
 | 
|  |    676 | metainforesponse = 
 | 
|  |    677 |    element metainforesponse { 
 | 
|  |    678 |       proverid_attr?,
 | 
|  |    679 |       attribute infotype { text },      # categorization of data
 | 
|  |    680 |       value* }                          # data values
 | 
|  |    681 | 
 | 
|  |    682 | 
 | 
|  |    683 | # ==============================================================================
 | 
|  |    684 | # 7. Proof script markup and proof control 
 | 
|  |    685 | # ==============================================================================
 | 
|  |    686 | 
 | 
|  |    687 | # properproofcmds are purely markup on native proof script text
 | 
|  |    688 | properproofcmd =
 | 
|  |    689 |     opengoal        # open a goal in ambient context
 | 
|  |    690 |   | proofstep       # a specific proof command (perhaps configured via opcmd) 
 | 
|  |    691 |   | closegoal       # complete & close current open proof (succeeds iff proven, may close nested pf)
 | 
|  |    692 |   | giveupgoal      # close current open proof, retaining attempt in script (Isar oops)
 | 
|  |    693 |   | postponegoal    # close current open proof, record as proof obl'n  (Isar sorry)  
 | 
|  |    694 |   | comment         # a proof script comment; text probably ignored by prover 
 | 
|  |    695 |   | whitespace      # a whitespace comment; text ignored by prover
 | 
|  |    696 |   | spuriouscmd     # command ignored for undo, e.g. "print x", could be pruned from script
 | 
|  |    697 |   | badcmd          # a command which should not be stored in the script (e.g. an improperproofcmd)
 | 
|  |    698 |   | litcomment      # a literate comment (never passed to prover)
 | 
|  |    699 |   | pragma	    # a document generating instruction (never passed to prover)
 | 
|  |    700 | 
 | 
|  |    701 | # improperproofcmds are commands which are never stored in the script
 | 
|  |    702 | improperproofcmd =
 | 
|  |    703 |     dostep        # issue a properproofcmd (without passing in markup)
 | 
|  |    704 |   | undostep      # undo the last proof step issued in currently open goal 
 | 
|  |    705 |   | redostep      # redo the last undone step issued in currently open goal (optionally supported)
 | 
|  |    706 |   | abortgoal     # give up on current open proof, close proof state, discard history
 | 
|  |    707 |   | forget        # forget a theorem (or named target), outdating dependent theorems
 | 
|  |    708 |   | restoregoal   # re-open previously postponed proof, outdating dependent theorems
 | 
|  |    709 | 
 | 
|  |    710 | opengoal     = element opengoal     { display_attr?, thmname_attr?, text } # FIXME: add objprefval
 | 
|  |    711 | proofstep    = element proofstep    { display_attr?, name_attr?, objtype_attr?, text }
 | 
|  |    712 | closegoal    = element closegoal    { display_attr?, text }
 | 
|  |    713 | giveupgoal   = element giveupgoal   { display_attr?, text }
 | 
|  |    714 | postponegoal = element postponegoal { display_attr?, text }
 | 
|  |    715 | comment      = element comment      { display_attr?, text }
 | 
|  |    716 | whitespace   = element whitespace   { display_attr?, text }
 | 
|  |    717 | 
 | 
|  |    718 | display_attr = attribute nodisplay { xsd:boolean }  # whether to display in documentation
 | 
|  |    719 | 
 | 
|  |    720 | spuriouscmd  = element spuriouscmd { text }
 | 
|  |    721 | badcmd       = element badcmd { text }
 | 
|  |    722 | 
 | 
|  |    723 | litcomment  = element litcomment { format_attr?, (text | directive)* }
 | 
|  |    724 | directive   = element directive { (proofctxt,pgml) }
 | 
|  |    725 | format_attr = attribute format { token }
 | 
|  |    726 | 
 | 
|  |    727 | pragma       = showhidecode | setformat
 | 
|  |    728 | showhidecode = element showcode { attribute show { xsd:boolean } }
 | 
|  |    729 | setformat    = element setformat { format_attr }
 | 
|  |    730 | 
 | 
|  |    731 | dostep       = element dostep { text }
 | 
|  |    732 | undostep     = element undostep { empty }
 | 
|  |    733 | redostep     = element redostep { empty }
 | 
|  |    734 | abortgoal    = element abortgoal { empty }
 | 
|  |    735 | forget       = element forget { thyname_attr?, name_attr?, objtype_attr? }
 | 
|  |    736 | restoregoal  = element restoregoal { thmname_attr }
 | 
|  |    737 | 
 | 
|  |    738 | # empty objprefval element is used for object prefs in script markup 
 | 
|  |    739 | objprefval = element objprefval { name_attr, val_attr, empty }
 | 
|  |    740 | val_attr   = attribute value { text }
 | 
|  |    741 | 
 | 
|  |    742 | 
 | 
|  |    743 | 
 | 
|  |    744 | 
 | 
|  |    745 | # =======================================================
 | 
|  |    746 | # Inspecting the proof context, etc.
 | 
|  |    747 | 
 | 
|  |    748 | proofctxt =
 | 
|  |    749 |     askids         # please tell me about identifiers (given objtype in a theory)
 | 
|  |    750 |   | showid         # print value of an object
 | 
|  |    751 |   | askguise       # please tell me about the current state of the prover
 | 
|  |    752 |   | parsescript    # parse a raw proof script into proofcmds
 | 
|  |    753 |   | showproofstate # (re)display proof state (empty if outside a proof)
 | 
|  |    754 |   | showctxt       # show proof context
 | 
|  |    755 |   | searchtheorems # search for theorems (prover-specific arguments)  
 | 
|  |    756 |   | setlinewidth   # set line width for printing
 | 
|  |    757 |   | viewdoc        # request some on-line help (prover-specific arg)
 | 
|  |    758 | 
 | 
|  |    759 | askids = element askids  { thyname_attr?, objtype_attr? }
 | 
|  |    760 | 	# Note that thyname_attr is *required* for certain objtypes (e.g. theorem).
 | 
|  |    761 | 	# This is because otherwise the list is enormous.
 | 
|  |    762 | 	# Perhaps we should make thyname_attr obligatory? 
 | 
|  |    763 | 	# With a blank entry (i.e. thyname="") allowed for listing theories, or for when 
 | 
|  |    764 | 	# you really do want to see everything.
 | 
|  |    765 | 
 | 
|  |    766 | showid = element showid  { thyname_attr?, objtype_attr, name_attr }
 | 
|  |    767 | 
 | 
|  |    768 | askguise = element askguise { empty }
 | 
|  |    769 | 
 | 
|  |    770 | 
 | 
|  |    771 | # =======================================================
 | 
|  |    772 | # Parsing proof scripts
 | 
|  |    773 | 
 | 
|  |    774 | # NB: parsing needs only be supported for "proper" proof commands,
 | 
|  |    775 | # which may appear in proof texts.  The groupdelimiters are purely
 | 
|  |    776 | # markup hints to the interface for display structure on concrete syntax.
 | 
|  |    777 | # The location attributes can be used by the prover in <parsescript> to
 | 
|  |    778 | # generate error messages for particular locations; they can be used 
 | 
|  |    779 | # in <parseresult> to pass position information back to the display,
 | 
|  |    780 | # particularly in the case of (re-)parsing only part of a file.
 | 
|  |    781 | # The parsing component MUST return the same location attributes
 | 
|  |    782 | # (and system data attribute) that was passed in.
 | 
|  |    783 | 
 | 
|  |    784 | parsescript = element parsescript
 | 
|  |    785 |                  { location_attrs, systemdata_attr, text }
 | 
|  |    786 |        
 | 
|  |    787 | parseresult = element parseresult { location_attrs, systemdata_attr,
 | 
|  |    788 | 				    singleparseresult* }
 | 
|  |    789 | 
 | 
|  |    790 | singleparseresult  = properscriptcmd | unparseable | errorresponse
 | 
|  |    791 | 
 | 
|  |    792 | unparseable = element unparseable { text }
 | 
|  |    793 | properscriptcmd = properproofcmd | properfilecmd | groupdelimiter
 | 
|  |    794 | 
 | 
|  |    795 | 
 | 
|  |    796 | groupdelimiter = openblock | closeblock
 | 
|  |    797 | openblock  = element openblock { metavarid_attr? }
 | 
|  |    798 | closeblock = element closeblock { empty }
 | 
|  |    799 | 
 | 
|  |    800 | # 
 | 
|  |    801 | metavarid_attr = attribute metavarid { token }
 | 
|  |    802 | 
 | 
|  |    803 | showproofstate = element showproofstate { empty }
 | 
|  |    804 | showctxt       = element showctxt { empty }
 | 
|  |    805 | searchtheorems = element searchtheorems { text }
 | 
|  |    806 | setlinewidth   = element setlinewidth { xsd:positiveInteger }
 | 
|  |    807 | viewdoc        = element viewdoc { text }
 | 
|  |    808 | 
 | 
|  |    809 | 
 | 
|  |    810 | # =======================================================
 | 
|  |    811 | # Theory/file handling
 | 
|  |    812 | 
 | 
|  |    813 | properfilecmd =     # (NB: properfilecmds are purely markup on proof script text)
 | 
|  |    814 |     opentheory      # begin construction of a new theory.  
 | 
|  |    815 |   | theoryitem      # a step in a theory (e.g. declaration/definition of type/constant).
 | 
|  |    816 |   | closetheory     # complete construction of the currently open theory
 | 
|  |    817 | 
 | 
|  |    818 | improperfilecmd = 
 | 
|  |    819 |     doitem	    # issue a proper file command (without passing in markup)
 | 
|  |    820 |   | undoitem	    # undo last step (or named item) in theory construction
 | 
|  |    821 |   | redoitem	    # redo last step (or named item) in theory construction (optionally supported)
 | 
|  |    822 |   | aborttheory     # abort currently open theory
 | 
|  |    823 |   | retracttheory   # retract a named theory
 | 
|  |    824 |   | openfile        # lock a file for constructing a proof text 
 | 
|  |    825 |   | closefile       # unlock a file, suggesting it has been processed
 | 
|  |    826 |   | abortfile       # unlock a file, suggesting it hasn't been processed
 | 
|  |    827 |   | loadfile        # load a file possibly containing theory definition(s)
 | 
|  |    828 |   | changecwd       # change prover's working directory (or load path) for files
 | 
|  |    829 |   | systemcmd       # system (other) command, parsed internally
 | 
|  |    830 | 
 | 
|  |    831 | fileinfomsg = 
 | 
|  |    832 |    informfileloaded       # prover informs interface a particular file is loaded
 | 
|  |    833 |  | informfileretracted    # prover informs interface a particular file is outdated
 | 
|  |    834 |  | informguise		  # prover informs interface about current state
 | 
|  |    835 | 
 | 
|  |    836 | opentheory    = element opentheory    { thyname_attr, parentnames_attr?, text }
 | 
|  |    837 | closetheory   = element closetheory   { text }
 | 
|  |    838 | theoryitem    = element theoryitem    { name_attr?, objtype_attr?, text } # FIXME: add objprefval
 | 
|  |    839 | 
 | 
|  |    840 | doitem        = element doitem        { text } 
 | 
|  |    841 | undoitem      = element undoitem      { name_attr?, objtype_attr? } 
 | 
|  |    842 | redoitem      = element redoitem      { name_attr?, objtype_attr? } 
 | 
|  |    843 | aborttheory   = element aborttheory   { empty }
 | 
|  |    844 | retracttheory = element retracttheory { thyname_attr }
 | 
|  |    845 | 
 | 
|  |    846 | parentnames_attr = attribute parentnames { objnames }
 | 
|  |    847 | 
 | 
|  |    848 | 
 | 
|  |    849 | # Below, url_attr will often be a file URL.  We assume for now that
 | 
|  |    850 | # the prover and interface are running on same filesystem.
 | 
|  |    851 | #
 | 
|  |    852 | 
 | 
|  |    853 | openfile      = element openfile  { url_attr }	    # notify begin reading from given file
 | 
|  |    854 | closefile     = element closefile { empty }	    # notify currently open file is complete
 | 
|  |    855 | abortfile     = element abortfile { empty }	    # notify currently open file is discarded
 | 
|  |    856 | loadfile      = element loadfile  { url_attr }	    # ask prover to read file directly
 | 
|  |    857 | changecwd     = element changecwd { dir_attr }	    # ask prover to change current working dir
 | 
|  |    858 | 
 | 
|  |    859 | # this one not yet implemented, but would be handy.  Perhaps could be 
 | 
|  |    860 | # locatethy/locatefile instead.
 | 
|  |    861 | #locateobj     = element locateobj { name_attr, objtype_attr } # ask prover for file defining obj
 | 
|  |    862 | 
 | 
|  |    863 | informfileloaded    = element informfileloaded    { url_attr }  # prover indicates a processed file
 | 
|  |    864 | informfileretracted = element informfileretracted { url_attr }  # prover indicates an undone file
 | 
|  |    865 | informfilelocation  = element informfilelocation  { url_attr }  # response to locateobj
 | 
|  |    866 | 
 | 
|  |    867 | informguise = 
 | 
|  |    868 |    element informguise {
 | 
|  |    869 |       element guisefile { url_attr }?,
 | 
|  |    870 |       element guisetheory { thyname_attr }?,
 | 
|  |    871 |       element guiseproof { thmname_attr?, proofpos_attr? }?
 | 
|  |    872 |    }
 | 
|  |    873 | 
 | 
|  |    874 | proofpos_attr = attribute proofpos { xsd:nonNegativeInteger }
 | 
|  |    875 | 
 | 
|  |    876 | systemcmd     = element systemcmd     { text }		# "shell escape", arbitrary prover command!
 | 
|  |    877 | 
 | 
|  |    878 | # ==============================================================================
 | 
|  |    879 | # 8. Internal messages-- only used between communicating brokers.
 | 
|  |    880 | # ==============================================================================
 | 
|  |    881 | internalmsg  = launchcomp | stopcomp | registercomp | compstatus
 | 
|  |    882 | 
 | 
|  |    883 | launchcomp   = element launchcomponent { componentspec }
 | 
|  |    884 | 	               # request to start an instance of this component remotely
 | 
|  |    885 | stopcomp     = element stopcomponent { attribute sessionid { string } }
 | 
|  |    886 |                        # request to stop component with this session id remotely
 | 
|  |    887 | 
 | 
|  |    888 | registercomp = element registercomponent { activecompspec } 
 | 
|  |    889 |                        # component has been started successfully
 | 
|  |    890 | compstatus   = element componentstatus { componentstatus_attr    # status
 | 
|  |    891 | 	                               , componentid_attr?       # component id (for failure)
 | 
|  |    892 | 	                               , element text { text }?  # user-visible error message
 | 
|  |    893 | 				       , element info { text }?  # Additional info for log files.
 | 
|  |    894 | 				       }	
 | 
|  |    895 |                        # component status: failed to start, or exited
 | 
|  |    896 | 
 | 
|  |    897 | componentstatus_attr = attribute status { ("fail"   # component failed to start
 | 
|  |    898 |  		                          |"exit"  # component exited
 | 
|  |    899 | 					  )}	
 | 
|  |    900 | 
 | 
|  |    901 | # Local variables:
 | 
|  |    902 | # fill-column: 95
 | 
|  |    903 | # End:
 | 
|  |    904 | # ==============================================================================
 | 
|  |    905 | # end of `pgip.rnc'.
 | 
|  |    906 | 
 |