NOTE: Most of this document does not apply to OpenCyc images, but the document is included to illustrate one way that Cyc (in 2002) handles a multiple-image environment.
This is accomplished by having each image write operations to, and read operations from, one or more transcript files.
Therefore, there are six possible combinations for the communication status:
The Communication Status page is where you can view and change your communication settings. When Storing operations, a new section of the communication status page will appear. In this section you are given the option of sending your stored operations or clearing them from storage. Selecting either option will cause a new local transcript to be started for the image. Selecting clear does NOT mean the stored operations will be erased(they will still be in the local transcript).
The value of *use-local-queue?* determines whether or not operations performed in the local image will be executed immediately (thus blocking the execution of other processes), or pushed onto the local queue to be executed at a time determined by the CYC® Agenda. The possible values for this variable are T and NIL. In most cases (most of the time), *use-local-queue?* will be set to T. This means that every KB-modifying operation performed using any of the top-level Functional Interface (FI) functions (e.g., FI-ASSERT) will automatically be pushed onto *local-queue* to be executed by the CYC® Agenda. Usually this is a good thing, because otherwise the operation would be executed immediately where you typed it in (or where it was evaluated internally through the web browser interface). If it happened to be a long operation, you would be forced to wait before you (or another application) could continue to interact with CYC®. However, you may sometimes want the evaluation of a Functional Interface function to happen immediately. In this case, set the value of *use-local-queue?* to NIL by evaluating
(CSETQ *use-local-queue?* NIL)
in the Interactor web interface page. If you are typing SubL expressions directly to a read-eval-print loop (extremely rare for doing knowledge entry), use the procedure SAFE-FI.
(SAFE-FI)
For example, instead of typing the form
(FI-ASSERT '(#$isa #$Siegel #$Person) #$BaseKB)
you would type
(SAFE-FI :assert '(#$isa #$Siegel #$Person) #$BaseKB)
The value of *run-own-operations?* determines whether or not your local CYC® image will process operations originating from it when reading operations from a transcript file. In most cases this should be set to NIL. However, if an image dies and needs to be restarted (due, e.g., to a power failure or irrecoverable memory error), you will usually want it to evaluate its own operations when it is restarted and loads the master transcript file, so that it will be in sync with the other running images. This is just something to be aware of and watch for -- the right thing should happen automatically, and you should never have to manually set the value of this variable.
([user] [image-id] [date] [encapsulated op])
An encapsulated operation is one in which all CYC® constants (e.g., #$isa) are referred to as lists including name-id pairs (e.g., (:HP "isa" 260)) rather than as Cyc-constant data objects.
In a read-eval-print loop, you can also call the function LOAD-TRANSCRIPT-FILE with the appropriate arguments. These arguments include the pathname of the file to be loaded, a boolean value (T or NIL) indicating whether or not operations that originated in the local image should be loaded, and a keyword indicating onto which queue the loaded operations should be pushed. The possibilities for the last argument (the queue keyword) are :local, :remote, and :none. :None means that the Functional Interface commands in the transcript will be evaluated immediately, and other processes will be forced to wait until they are finished.
When a CYC® image is started and the CYC® init file is loaded, the global variables *use-local-queue?* and *use-transcript?* are initialized to T. With these settings, every FI command you evaluate (even including fi-ask), will be added to your transcript queue and (if your agenda is running) saved to a transcript file. If you are Sending operations or Storing and you send your stored operations, the operations will be appended to the master transcript file, and everyone who is reading from the master file will run your operations.
Changing your communication status is one way to safely alter the setting of these variables. For example, if you go into a Not Recording mode then no operations performed in your CYC® image will be added to its transcript queue. In rare cases, a user might want to "manually" set *use-transcript?* to NIL. If you think you need to manually set these variables, check with your contact at Cycorp. Here is a way to handle a common situation -- you want to run some cleanup operations that will be included in the next KB dump, but you don't want everyone to be forced to run the cleanup:
Cycorp has adopted the informal policy of using one CYC® image as a dedicated KB cleanup and dump image. If you want to run large numbers of cleanup operations to be included in the next dump, you can run them in the dedicated image with the communication status set to Storing and then clear the operations from storage. The local transcript file containing the operations can then be loaded on the dump image (make sure not to send them to the master transcript) immediately before the next dump.
If in the context of some cleanup you write code or evaluate FI commands "manually" (in a SubL read-eval-print loop), use the generalized "safe" dispatcher function for FI commands called SAFE-FI. Within calls to SAFE-FI, *use-local-queue?* and *use-transcript?* are bound to NIL, so there is no danger of unintended operations ending up in a transcript file. For example, instead of calling:
(FI-ASK '(#$arity #$customers ?Y) #$BaseKB)
you could call:
(SAFE-FI :ask '(#$arity #$customers ?Y) #$BaseKB)
Note that the first expression above would not return an answer unless *use-local-queue?* were set to NIL. Instead, the result of the evaluation would be pushed onto the local queue, and the evaluated form would return the keyword :queued. However, the second expression is guaranteed to return a result, since *use-local-queue?* is internally bound to NIL.
Note that users of other copies of the current CYC® image (copies other than the particular image being used to do the dump) can always continue to work (do new knowledge entry) after a dump has started. Just switch to a non-sending communication status. This will start a local transcript file for your new operations. After a new image is built and you have started it, you can then load your transcript file, specifying that the operations should go on the local queue. The operations will then be treated as if they had just now been performed in the new image, and they will be included in the new master transcript file.
The CYC® Agenda is the process running in a CYC® image which performs all the tasks needed to manage CYC® operations: moving operations from one queue to another, executing operations, reading from transcript files, writing to transcript files, and loading CYC® source code patches.
In computer science terms, the CYC® Agenda is a finite state machine which continually moves from state to state, testing for a certain set of conditions in each state, and causing specific actions to be performed when the conditions hold.
Or you can think of the agenda as a manager who spends all day checking her watch and running back and forth between the offices of her employees, telling each one when it is time to do something.
A Flowchart for the CYC® Agenda
Here is an informal description of the states through which the CYC®
Agenda moves, and what it does in each state (leaving out error
handling and other technicalities):
Here is a line-by-line explanation of the various bits of information displayed in this section:
System Area Here are your system settings. Current machine: Lenny Current image number: LENNY-293-19980105094631 Current KB: 111.545 System and patch level: 54.44 Click here to halt this CYC® image.
Queue Information: Master Transcript Operations Read But Unprocessed: 0 Master Transcript Operations Read: 545 Unprocessed Local Queue Operations: 0 Local Queue Operations Processed But Unrecorded: 0 Current Local Transcript Operations Processed And Recorded: 1
Transcript Information: Master Transcript: ./transcripts/0111/cyc-kb-111.ts Characters: 251230 Estimated Ops: 1219 Operations Read: 545 Local Transcript: ./transcripts/0111/LENNY-293-19980105094631-local-0.ts Operations: 1
Historical Information: Remote Operations Processed: 545 Local Operations Processed: 1 Local Operations Sent To Master Transcript: 0
Copyright © 1995, 1996, 1997 Cycorp. All rights reserved.