CAMINOREAL
CAMINOREAL
CAMINOREAL
EP88 DRAFT -- August 29, 1987 12:46:11 pm PDT (MCISAAC) -- EP88 DRAFT
EP88 DRAFT -- August 29, 1987 12:46:11 pm PDT (MCISAAC) -- EP88 DRAFT
EP88 DRAFT -- August 29, 1987 12:46:11 pm PDT (MCISAAC) -- EP88 DRAFT
CaminoReal: An Interactive Mathematical Notebook
Dennis Arnon, Carl Waldspurger, Kevin McIsaac, and Richard Beach
© Copyright 1987 Xerox Corporation. All rights reserved.
Abstract: Four broad categories of Mathematical Software are Computer Algebra (Symbolic Mathematics), Numerical Computation, Mathematical Typesetting, and "Technical Electronic Mail" (i.e. e-mail that contains mathematical expressions). In each of these categories one finds powerful and sophisticated systems. Nonetheless, what one really would like is simultaneous, integrated access to all four types of functionality.
CaminoReal is a system for integrated, interactive, technical documents and computations. It lives in Cedar, the programming environment of Xerox PARC's Computer Science Laboratory, and is used in conjunction with Tioga, Cedar's multimedia document editor. CaminoReal offers a small builtin algebra package based on the notions of Domains and Objects, plus access to "Algebra Servers" on a network. Mathematical expressions are passed between CaminoReal, Tioga, and Algebra Servers in pure functional notation. Our current Algebra Servers are the Reduce, SMP, and SAC-2 Computer Algebra systems.
Keywords: Computational Mathematics, Document Processing, Mathematical Typesetting, Technical Documents, Mathematics Editing, WYSIWYG, User Interfaces, Direct Manipulation, Computer Algebra, Symbolic Mathematical Computation, Object-Oriented Programming
XEROX   Xerox Corporation
    Palo Alto Research Center
    3333 Coyote Hill Road
    Palo Alto, California 94304

DRAFT — Preliminary Version — DRAFT
There is no 'royal road' to geometry.
Euclid, said to Ptolemy I
1. Introduction
1.1 Background
In the 27 years since J.C.R. Licklider presented the notion of Man-Computer Symbiosis [Licklider 1960], there have been continuous efforts to define and build such "symbiotic systems" for mathematical work. Clapp and Kain's Magic Paper system (1963), Minsky's MATHSCOPE proposal (1963). and Martin's Symbolic Mathematical Laboratory (1967) appear to be the earliest. The papers of Sammet (1966), Griesmer/Jenks (1971), Sundblad (1974), Ng (1979), Berman/Kulp (1979), Hearn (1980, 1982), Foster (1984), Engeler (1985), and Fich (1986) chronicle subsequent progress and offer pointers to the future. MathScribe (Smith/Soiffer 1986), MathCAD (MathSOFT 1986), the Engineering/Scientific Workstation (Bloomberg/Hogg 1987), and the Dynamicist's Workbench (Abelson 1987) are representative examples of the (large amount of) work that has begun recently.
Following Licklider and the works just cited, when we speak of environments for mathematical work in this paper, we exclude from consideration those aspects of mathematical computing that pertain to intelligence, learning, and automated reasoning. These are topics of the greatest importance, but we believe that more mundane aspects of mathematical environments are of greater short-run urgency. In fact, much remains to be done before we have satisfactory "mundane" systems, and we must have good "dumb" systems before we can hope to have good "smart" ones.
Our work on CaminoReal, leverages off certain recent hardware developments, such as: High-Resolution Screens and Printers, Pointing Devices, High-speed Networks, and Personal Computers. It also use recent software developments such as: sophisticated symbolic and numerical software, high-quality Electronic Publishing systems that utilize the new hardware devices , and the broad acceptance of certain User Interface paradigms for interactive software, such as WYSIWYG editing, Direct Manipulation, Menus, Windows, Holophrasting (Koved/Shneidermann 1986), Iconification, and Browsers.
CaminoReal, together with other components of Cedar, provides a working system for the creation, display, editing, transmittion and "execution" of Interactive Mathematical Notebooks. We began work with some very specific targets but without a coherent overall design. As we have uncovered CaminoReal's strengths and weaknesses, we believe we have developed the system design we previously lacked. This paper is as much about this design as it is about the working prototype.
CaminoReal has much in common with other recent work, but we do believe it to have two unique features These are:
1. The accessibility from CaminoReal of a variety of different computational "Math Servers" on our local network (details in Section 4 below).
2. The coupling of computation facilities with a sophisticated document system, thereby opening interesting new opportunities for computed and interactive documents.
To a large extent, these novel capabilities are made possible by the rich facilities of the Cedar environment. In turn, the richness of Cedar reflects thorough its incorporation of the hardware and software developments we identified above. Given that many of these developments originated at Xerox PARC (Crecine 1986), it is not surprising that they are well integrated into Cedar.
1.2. To be more specific ...
CaminoReal lives in Cedar, the programming environment of Xerox PARC's Computer Science Laboratory (Swinehart et al 1986, Donahue 1986), and is used in conjunction with Tioga, Cedar's multimedia document editor. Actual document production (e.g. printing, management of other document constituents such as text and graphics) is provided by Tioga. The screen, mouse actions and keyboard input is managed by the Cedar viewers package. A viewer is a window that can be scrolled and resized. A viewer can have buttons and pop-up menus that invoke commands. The mouse is used to point and select text or expressions. CaminoReal supports interactive, syntax-directed, two-dimensional, WYSIWYG editing of mathematical expressions, placing/fetching such expressions in/from Tioga documents, and algebraic manipulation of expressions. Algebraic computation can be performed using either a small builtin package, or using well-known algebra systems such as Reduce, SMP, and SAC-2 over a network. The internal algebra package is based on an object-oriented paradigm that supports polymorphic procedures. For example, one can easily create and do simple arithmetic on matrices of polynomials with complex number coefficients, or matrices of such matrices, etc.
CaminoReal supports the creation of "interactive" technical documents. For example, the user can browse a typeset draft of a technical document on the workstation screen, select, edit and compute with the mathematical expressions in it. The resulting expressions can be inserted back into the document. One can extend this to the notion of a computed document, that is a document with imbedded computations. Two particularly useful flavors of computed documents are spreadsheets and mathematical form letters.
This paper combines an exposition of CaminoReal as it currently is, with suggestions for desirable changes or extensions. The current version of CaminoReal has at least touched on most issues we consider to be within our scope, so we will typically describe the existing features, and then how they might be altered.
Previous work on Man-Computer Symbiosis in Mathematics (such as that we cited above) has largely ignored the issue of documents. Although a number of interactive mathematical systems, e.g. MathCAD (MathSoft 1986), MILO (Avitzur 1987), and INFOR (Schelter 1987), allow the production of some sort of document, only INFOR could be said to support professional-quality typesetting for text and mathematics, and it does not have provision for other media such as voice or complex graphics. Multimedia document systems such as Diamond (Crowley 1987) and Andrew (Morris 1986) support a range of media, but they are only beginning to support math in documents, and they do not address the issue of computations with math expressions in a document. Spreadsheet systems can be said to integrate documents and computation, but they are typically limited in the types of documents that can be created, and the media that those documents can contain. For us, such documents as automatically generated logs, audit trails, or newly written technical papers, are a crucial part of a mathematical system. Furthermore, we want all documents in our system to be "active", in the sense that the user should be able to select a math expression in a document and compute with it, and to place the result of any computation at any place in a document. CaminoReal provides these capabilities. That CaminoReal provides a professional-quality document system may be gauged by the fact that this document is produced using it. At PARC, a reader who is browsing the electronic version of this document can select any mathematical expression in it, and edit it or compute with that expression. Hence we call CaminoReal a system for Interactive Mathematical Notebooks.
2. Standard Mathematical Systems
2.1 Introduction
This material is adapted from the Report of the Workshop on Environments for Computational Mathematics (Arnon 1987).
We postulate that there is an Abstract Syntax for any mathematical expression. A piece of Abstract Syntax consists of an Operator and a list of Arguments, where each Argument is (recursively) a piece of Abstract Syntax. Functional Notation, Lisp S—Expressions, Directed Acyclic Graphs, and N-ary Trees are equivalent representations of Abstract Syntax. For example, the common mathematical expression X could be represened in abstract syntax by the functional notation Plus[Times[a,b],c]
A "Standard Mathematical Component" (abbreviated SMC) is a collection of software and hardware modules, with a single function, which if it reads mathematical expressions, reads them as Abstract Syntax, and if it writes mathematical expressions, writes them as Abstract Syntax. A "Standard Mathematical System" (abbreviated SMS) is a collection of SMC's which are used together, and which communicate with each other in Abstract Syntax.
We identify five possible types of components in an SMS, which we define in Section 2.2. Any particular SMS may have zero, one, or several instances of each component type. The connection between two particular components of an SMS, of whatever type, is via Abstract Syntax passed over a "wire" joining them.
2.2 Standard Mathematical Components
2.2.1 EDs - Math Editors
These edit Abstract Syntax to Abstract Syntax. An ED may be WYSIWYG or language-oriented.
2.2.2 DISPs - Math Displayers
These are suites of software packages, device drivers, and hardware devices that take in an expression in Abstract Syntax and render it. For example, (1) the combination of an Abstract Syntax->TeX translator, TeX itself, and a printer, or (2) a plotting package plus a plotting device. A DISP component may or may not support "pointing" (i.e. selection), within an expression it has displayed, e.g. a printer probably doesn't, but terminal screen may. If pointing is supported, then a DISP component must be able to pass back the selected subexpression in Abstract Syntax.
2.2.3 COMPS - Computation Systems
Examples are numerical libraries and computer algebra systems. There are questions as to the state of a comp component at the time it receives an expression. for example, what global flags are set or what previous expressions have been computed, that the current expression may refer to. However we don't delve into these hard issues at this time.
2.2.4 DOCs - Document systems
Need not relate to printable docs. Could be Database or hypertext systems.
Note that if math is editable in place in a document, this is not part of the DOCs per se, but part of the DISP. The interface is the DOC telling the DISP how much space it has to display in (e.g. page height, infinite to the right), and perhaps some hints (clip, scale, level-clip), and the DISP then paints.
2.2.5 GLUE - The Link Between Systems
The abstract syntax specifies the grammer of the communication language but say noting about the semantics. It is the function of the glue to translate abstract syntax from one system to another. For example a MACSYMA to SMP translator. Thus the user of a SMS need not, and is encouraged not to, understand the naming convention of the particular system being used. Further the glue should have some understanding of the relative merits of the different COMP and provide automatic routing of computational requests to the most appropriate system available in the SMS
2.3 Further notes on the overall architecture
A typical SMS will have an ED and a DISP that are much more closely coupled than is suggested here. The boundaries between the component types are not hard and fast, e.g. an ED might support simple computations The key for a given software, module to qualify as an SMS component is its ability to read and write Abstract Syntax.
Abstract syntax is human-readable, thus any text editor can be used as an ED. However many users will only want to interact with mathematics that has a textbook-like appearance. They should not need to know that their system uses abstract syntax within itself, or to the outside world.
3. CaminoReal as a prototype SMS: Expression Editing and Basic Documents
3.1. Introduction
CaminoReal is a prototype of a standard mathematical system, where one can edit mathematical notation interactively, display mathematics in traditional two-dimensional appearance, compute symbolically or numerically with mathematical expressions, and format and organize documents containing such mathematical objects.
There are three major components of CaminoReal, Meddle, an interactive mathematics expression editor (combining the functions of an ED and DISP), AlgebraStructures, an exploratory domain-based algebra system (COMP) with remote access to other algebra services via distributed network protocols, and Tioga, the integrated multimedia document production system (DOC).
We believe that such a prototype reveals interesting architectural issues, many of which were described in the previous section, and provides opportunities for exploring new directions for active documents described later in this paper. CaminoReal also provides a testbed for exploring user interface issues concerning manipulating mathematics within documents.
3.2. The Expression Editor (ED and DISP)
The expression editor in CaminoReal combines the math editor and display components of a standard mathematical system to manipulate two-dimensional math notation interactively. The editor was modeled after the Tioga document editor in Cedar, utilizing multiple selections, accepting input actions from either the keyboard or menu buttons, and processing input actions through an incremental pseudo-parser. The editor updates the display incrementally after each key stroke.
The editing paradigm is based on expression trees, with operators as interior nodes and atoms as leaves. Each operator is represented by a template that defines the notation for that operator by determining the symbol representing the operator and the structure and appearance of the subexpressions. For example, the summation template defines that a Greek sigma, S, be used for the operator and that there be three subexpressions: a lower bound, an upper bound and a summand. Such templates are written in the Cedar language and registered to CaminoReal. When templates are first presented, any unfilled expressions are represented by placeholders (X). Thus, the addition template first appears as X.
3.3. Selecting Expressions
One may select subexpressions corresponding to subtrees by pointing at the relevant object. This strategy helps ensure that structurally correct expressions are created at the expense of freedom to manipulate individual operators. The intention is that additional operator templates be added to accommodate new notation rather than permitting the editor to arbitrarily rearrange subexpressions. To facilitate keyboard entry, a complete set of navigational commands are provided, such as select parent, sibling or child of the current selection.
CaminoReal depends on four types of selections: primary, copy, move, and the keyboard caret. The primary selection, made by pointing and clicking with the mouse, establishes the focus of most operations. The copy selection, made by chording the keyboard SHIFT key and clicking the mouse, supplies the argument for copying a subexpression to replace the primary selection. A move selection, made by chording the keyboard CTRL key and clicking the mouse, supplies the argument for moving a subexpression to replace the primary selection. The keyboard caret identifies the expression most recently entered by a keyboard input action and determines where the next keyboard input will be directed.
3.4. Entering Expressions
All editing operations are available from menu buttons and several common ones are mapped onto keyboard keys. CaminoReal uses a pseudo-parser in the Cedar user interface management system to map key presses into editing operations. This provides a feel similar to an operator precedence grammar, but is unfortunately not very natural. For example, the keyboard sequence x^2<CTRL-P>+1<CTRL-P>=0 requires the embedded `select parent' operations to get the proper associations for the expression X .
Modifications to the primary selection may occur either by a replace operation or a wrap operation. In a replace operation, the subexpression in the primary selection is deleted and a new subexpression, determined by either a keyboard input action or a menu choice, is inserted in the expression tree. In a wrap operation, the primary selection appears as one of the placeholders in the new subexpression. For example, consider the first placeholder in the addition expression X as the primary selection. Typing the letter `r' replaces the first placeholder with X resulting in the new expression X , and subsequently typing the key `^' wraps a superscript template around the X to produce X (replacing the X with a subscript template would produce X ).
The math expression editor provides several `creature comforts' suited to interactive editing of complex notation, especially the undo command and various scaling operations to improve the readability on low resolution display screens.
3.5. Character sets
An interesting challenge for other mathematical expression editors is the treatment of special symbols. This issue is finessed in CaminoReal through the use of the Xerox character code standard, in which a unique code (a 1-, 2-, or 3-byte code) has been assigned to all multilingual and technical symbols in the standard. Therefore, mathematical notation symbols and foreign language symbols are known in each type font at specific character code locations. The Xerox character code standard is comprehensive and incorporates many international standards, such as ISO and JIS, and several de facto standards, such as the AMS TeX math symbols.
Nonetheless, there remains the challenge of identifying and inputing symbols beyond the standard keyboard keys. CaminoReal employs a tenatative solution by using menus for special symbols and Greek letters. Other Xerox systems use virtual keyboards to map the keys into arbitrary character codes and abbreviation name lookup translations to map token identifiers into symbols.
3.6. The Integrated Document Formatter (DOC and DISP)
desire is to integrate mathematical content into document as a document object
CaminoReal implementation limited by Tioga to creating passive artwork objects
artwork objects require procedures to return a bounding box for layout, to paint in an imaging context (device independent, might be display or an Interpress master)
objects may be in-line expressions or displayed notation
DOC component relies on DISP component to format notation (true?)
strategy is to have several CaminoReal tools for editing and manipulating mathematical objects
tool operations to manipulate math objects in Tioga documents
send math expression to document
extract math expression from document
evaluate math expression in document
4. CaminoReal as a prototype SMS: Computation
4.1. Introduction
CaminoReal provides two methods for algebraic computation, both integrated through the same tool interface: 1) an experimental domain-oriented package, AlgebraStructures, locally implemented in Cedar, and 2) several traditional algebra packages accessed as algebra servers over the network. One may evaluate expressions at several levels of detail, from selected subexpressions to complete expressions to entire documents. The results of evaluating an expression may be alternatively done in place or presented in a new CaminoReal tool. The integration of this computation capability and the interactive editing environment, especially utilizing the undo command, provides a very handy tool for exploring complicated expressions.
4.1. The AlgebraStructures Package
The Cedar AlgebraStructures package supports a limited set of algebraic operations defined within a mathematical domain. Domains include expressions, variables, integers, booleans, rationals, reals and complex numbers. Domain structures include sets, families of sets, sequences, vectors, matrices and polynomials. For example, one could create a matrix of polynomials on a sequence of variables of rational numbers. Evaluation of expressions produces a result that is consistent with the domains within the expression.
4.2. Computation with algebra servers
Algebraic computation is supported by selecting an expression or subexpression and sending it to a specific algebra server (COMP). Glue is used to convert the expression to abstract syntax, appropiate for the abgebra server, and passed to a VAX or SUN. The resulting expression from the COMP returns via the same process, and replaces the seleced expression.
Currently an new process is invoked for each computation. This is a slow process since a typical COMP takes a few seconds to startup. Further there is no support for non computational communication. For example, receiving error messages from the COMP, querying the help data bases associated in most COMPS, checking the state of a COMP.
5. Computed Documents
5.1. Mathematical form letters
If desired, the math expressions imbedded in a Tioga document can be evaluated prior to being painted, whenever the document is displayed, and so can be defined as functions of other expressions. This makes possible Tioga documents that are spreadsheets or mathematical form letters, or simply computed documents. Having the math in a technical paper computed on the fly minimizes the introduction of typographical errors, and so reduces the burden of proofreading.
When the EvalBeforePaint flag is off (the default), CaminoReal Expressions in a Tioga document are painted just as they are stored. When the EvalBeforePaint flag is on, they are evaluated before being painted. This enables Computed Documents. The Cedar CommandTool commands "MathEval on" and "MathEval off" do the toggling.
5.2. Future work on automated proofreading, spreadsheets, audit trails.
`The example in the previous Section showed the use of the environment and evaluation for generating documents. In the future we expect to refine the use of these tools to provide a more direct proofreading feature. For example, suppose that we stored both the unevaluated and evaluated form of each expression. Then one need only do the evaluations occasionally, when one wishes to check the validity of the document. The unevaluated expressions could thus be viewed as "assertions" about the actual expressions in the document, which can be checked by evaluating them and checking for equality with the evaluated form.
SpreadSheets, with an Audit Trail of the interactions with a computation system, are natural extensions of these ideas, and we expect to pursue them in the future. It provides a natural method for logging and documenting the results of a calculation done with an algebra system. This that is clearly lacking in current systems.
6. Acknowledgements
Thanks to Michael Plass, Ken Pier, Christian LeCocq for technical assistance. Thanks to those in the Computer Science Lab at PARC who have used CaminoReal for their documents and computations, and suggested improvements. Thanks to Alan Perlis and Alan Demers for inspiration.
References
Abelson, H., "The Dynamicist's Workbench", Department of Electrical Engineering & Computer Science, Massachusetts Institute of Technology (talk at Xerox PARC, May 1987)
Arnon, D., "Report of the Workshop on Environments for Computational Mathematics", held at ACM SIGGRAPH Conference, Anaheim, CA, July 27, 1987. Submitted for publication to the ACM SIGSAM Bulletin.
Avitzur, Ron, "MILO System", Palo Alto, CA 1987.
Berman, R. and Kulp, J., "A new environment for computational physics", Proc. 1979 MACSYMA Users Conf., Washington D.C., June 20-22, 1979, pp. 622-632.
Bloomberg, D. and Hogg, T., "Engineering/Scientific Workstation Project", Internal Report GSL-87-01, P87-00001, Xerox Palo Alto Research Center, January 1987.
Crecine, J., "The next generation of personal computers", Science, 231 (28 Feb. 1986), pp. 935-943.
Crowley T. et al, "The Diamond Multimedia Editor", Proc. USENIX 1987, pp. 1-17.
Donahue, J., "Integration Mechanisms in Cedar"
Engeler, E., "Scientific computation: the integration of symbolic, numeric and graphic computation", Proc. EUROCAL '85, (B.F. Caviness, ed.), Linz, Austria, April 3-5, 1985, Springer-Verlag, Lecture Notes in Computer Science, 203 (1985), pp. 185-200
Fich, F, "Mathematics notepad", Internal Document, Xerox Corporation, 1986.
Griesmer, J. and Jenks, R., "Scratchpad/I - an interactive facility for symbolic mathematics.", Proc. Second Symp. on Symbolic and Algebraic Manipulation (SIGSAM '71), ACM, pp. 42-58.
Hearn, A., The Personal Algebra Machine, Proc. IFIP '80, North-Holland, Amsterdam, 1980, pp. 620-628.
Hearn, A., "REDUCE - a case study in algebra system development", Proc. EUROCAM '82, Marseille, France, April 1982, Lecture Notes in Computer Science, 144, Springer-Verlag, New York, 1982, pp. 263-272.
Knuth, D.E., "The TeXBook", Addison-Wesley, 1984.
Knuth, Donald, "Mathematical Typography", Bull. AMS (New Series), March 1979, V. 1, No. 2, 337-372.
Koved L., Shneidermann B., "Embedded menus: selecting items in context", Comm. ACM, 29, 4 (April 1986), pp. 312-318.
Licklider, JCR, "Man-Computer Symbiosis", IRE Trans. on Human Factors in Electronics, HFE-1, 4-11 (1960).
Martin, W., "Symbolic Mathematical Laboratory", Ph.D. thesis, MIT, Jan. 1967.
Martin, W., "Computer input/output of mathematical expressions.", Proc. Second Symp. on Symbolic and Algebraic Manipulation (SIGSAM '71), ACM, pp. 78-89.
Martin, W. and Fateman, R., "The MACSYMA System.", Proc. Second Symp. on Symbolic and Algebraic Manipulation (SIGSAM '71), ACM, pp. 59-75.
MathSoft Inc, "MathCAD System", 1 Kendall Square, Cambridge, MA 02139
Minsky, M., "MATHSCOPE, part I - a proposal for a mathematical manipulation-display system", Memo MAC-M-118, Artificial Intelligence Project, Project MAC, MIT, November 1963, 13pp.
Morris, J. et al, "Andrew: A Distributed Personal Computing Environment", Comm. ACM 29, 3 (March 1986), pp. 184-201)
Ng, E., "Symbolic-numeric interface: a review", Proc. EUROSAM '79, Marseille, France, June 1979, Lecture Notes in Computer Science, 72, Springer-Verlag, New York, 1979, pp. 330-345.
R. Pavelle, M. Rothstein, and J. Fitch, "Computer Algebra", Scientific American, 245, 6 (December 1981), pp. 136-152.
Sammet, J., "Survey of formula manipulation", Comm. ACM, 9, 8 (August 1966), pp. 555-569.
Schelter, W.F., "INFOR Display Editor", MS, Department of Mathematics, University of Texas-Austin, July 1987, 11pp.
Shneiderman, B., "Direct Manipulation: A Step Beyond Programming Languages", IEEE Computer, August 1983, pp. 57-69.
Smith, C.J. and N. Soiffer, "MathScribe: A User Interface for Computer Algebra Systems", Proc. 1986 Symp. Symbolic and Algebraic Computation (B. Char, ed.), ACM, pp. 7-12.
Spivak, M., "The Joy of TeX", Addison-Wesley, 1986.
Sundblad, Y., "Symbolic mathematical systems now and in the future", Proc. EUROSAM '74, ACM SIGSAM Bulletin, 8, 3 (August 1974), pp. 1-8.
Swinehart, D.C., Zellweger, P.T., Beach, R.J., Hagmann, R.B., "A Structural View of the Cedar Programming Environment", Report CSL-86-1, Xerox Palo Alto Research Center, June 1986, 74pp., also ACM Trans. on Programming Lang. and Systems (TOPLAS), 1986.