Method and apparatus for displaying and editing mathematical expressions in textbook format

Abstract: A calculator (10) programmed for displaying in textbook format a mathematical expression as it is entered (33). This format is the way the expression would appear if presented in a textbook or if written with pencil and paper. As a key is pressed, means display the associated object, such as an alpha character or mathematical symbol, on the display screen in textbook format. A cursor (36) is provided which responds to currently entered objects for indicating where the next object to be entered will be displayed. The means for displaying objects is also context sensitive. It responds to currently entered objects by controlling the display of the next object to maintain the textbook format of the expression. Other features include syntax checking (43) of the mathematical expression as its objects are being entered, and implicit entering and displaying (41) objects in response to entry of a predetermined patterns of objects.

Description: BACKGROUND OF THE INVENTION This invention relates to portable computing devices such as calculators and, more particularly, to the format for displaying information on the device's display screen. Portable computing devices such as calculators typically display information line-by-line, like the text on this page. This information may include mathematical expressions such as equations having variables, operators and other symbols which are displayed in a single-height linear format. More advanced devices include a larger display screen that can display several lines of information simultaneously. But in neither case is the information displayed in the form most familiar to the user-the way it appears printed in textbooks and journals and the way a user normally writes it with pencil and paper. To most users, mathematical expressions displayed in the more familiar "textbook" or "graphical" format are easier to read and understand than expressions displayed in the linear format. Textbook editing has been used in document editors such as the one disclosed in Informationstechnik IT. vol. 28, No. 6, 1986, München BR, pages 352-360; Schar: "Die Integration mathematischer Formeln in den Dokumenteneditor LARA". These document editors, however, are only word processors and do not allow for computational analysis on the mathematical expressions, syntax checking or automatic entry of operands and operators. SUMMARY OF THE INVENTION It would therefore be desirable to provide means for displaying mathematical expressions in a textbook format on a portable computing device. It would further be desirable to provide a means for controlling the display of the mathematical expression as it is entered into the portable computing device to maintain the textbook format without user assistance. It would further be desirable to provide syntax checking of a mathematical expression as it is entered in textbook format. It would further be desirable to permit simple editing of a mathematical expression displayed in textbook format. In accordance with a first aspect of the present invention, there is provided a computing device as defined by claim 1. In accordance with a second aspect of the present invention, there is provided a method for displaying in textbook format a mathematical expression comprised of objects, as defined in claim 6. It is therefore possible to display in textbook format a mathematical expression comprised of objects such as variables, operators, syntactic symbols and numbers. The apparatus comprises a plurality of keys for entering objects into the portable computing device to form a mathematical expression. Displaying means is responsive to a key press for displaying an object associated with the key in textbook format. A cursor (36) is responsive to a currently entered object for indicating where a next object to be entered will be displayed. The displaying means is further responsive to a currently entered object for controlling the display of the next object to maintain the textbook format of the expression. Additional features include the implicit entering and displaying of an object in response to entry of a predetermined pattern of objects, such as a multiplier operator automatically inserted between two objects forming the predetermined pattern. To further assist the user, means is also provided for checking the syntax of the mathematical expression as objects are entered to be displayed. For example, the syntax checking means checks the syntax of the mathematical expression after entry of an object following a mathematical operator. The foregoing and other features and advantages of the invention will become more apparent from the following detailed description of a preferred embodiment with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a view of a calculator which includes apparatus according to the invention. FIG. 2 is a flowchart illustrating the operation of the calculator according to the invention. FIGS. 3a-3f are views of the display screen of the calculator illustrating the display of a mathematical expression in textbook format as it is entered. FIG. 4 is a view of the display screen illustrating the implicit entry and display of an object in a mathematical expression in response to entry of a predetermined pattern of objects. FIGS. 5a-5g are views of the display screen illustrating the entering of a mathematical expression in textbook format into a storage location in the calculator and recall of the expression. FIGS. 6a-6e are views of the display screen illustrating the editing of a mathematical expression in textbook format. FIGS. 7a-7d are views of the display screen illustrating the insertion of an object from a storage location of the calculator into a mathematical expression in textbook format. FIGS. 8a-8e are views of the display screen illustrating the rearrangement of a mathematical expression in textbook format without changing the expression's value. DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT FIG. 1 illustrates a portable computing device such as a calculator 10 in which the present invention is implemented. From a hardware perspective, calculator 10 includes a keyboard 12, multi-line liquid crystal display screen 14, a central processing unit and program and data memory. Through programs executed by the central processing unit, textual and graphics characters entered at the keyboard 12 may be written to the display screen. Calculations are normally handled in a command line which appears near the bottom of screen 14. The command line displays information such as an equation as it is entered. Results from execution information on the command line may then be stored in various memory locations in the calculator. A good example of such a device is the Hewlett-Packard 28S calculator. Calculators of this type may also have multi-action keys, as indicated by the key definitions above, on and below each key. Each key has a primary key action shown on its face. Three of the primary keys, when pressed, redefine the key actions to match one of the other definitions. Key 16, for example activates the key action above and to the left of each key. Key 18 activates the key definition above and to the right of each key. And key 20 activates the key definition to the lower right of each key. The keys labeled 22-28 are cursor keys for controlling the movement of a cursor around the display screen 14. The top row 30 of keys are menu keys. The current functions of these keys are defined by menu labels that appear immediately above row 30 in the display screen. The menu labels are part of a menu selected by pressing a key. For example, pressing key 32 will display menu labels relating to math functions. With this background, the present invention is described as implemented in a calculator embodiment. FIG. 2 is a flowchart 33 that illustrates the operation of program routines according to the invention. It should be understood, however, that the following description of the invention is intended only as an example and not as a limitation to this embodiment. For clarity, items of information that can be separately entered or displayed are referred to as objects. An object may have parts or arguments that are also objects themselves. Expressions of objects such as a mathematical operator with arguments may also be referred to as objects. For example, A^B may be a subexpression of a larger mathematical expression. In different contexts, a subexpression may be entered and displayed as one object or its parts may be separately entered and displayed as objects. Other examples of objects include mathematical symbols, alpha characters (letters) and numbers. Referring now to FIGS. 1-3, the textbook format routine is entered by pressing keys 16 and 34 in succession. This action activates displaying means such as a program within the calculator's memory. The displaying means responds to further key presses by displaying objects associated with the keys in textbook format on the screen 14. By pressing various keys including action defining keys 16-18, a mathematical expression comprised of objects can be entered and displayed. In FIG. 3a, for example, several objects are shown displayed in response to key presses. At the end of the objects is a cursor 36 that responds to objects currently entered in the mathematical expression by indicating where a next object to be entered will be displayed. This responsiveness can be appreciated by comparing the positions of the cursor in FIG. 3a and FIG. 3b. In the first figure, the preceding objects are variables followed by an addition operator 38. The next object to be entered then appears opposite the addition operator. This next object entered (FIG. 3b) is an integral sign 40 which is positioned where the cursor previously appeared. An integral sign, however, takes two arguments that appear at the top and bottom of the sign, respectively. Cursor 36 responds to entry of the integral sign 40 by moving to the bottom of the sign to indicate where the next object, the lower limit of integration, will be displayed. The user thus does not have to determine where the next object is to be displayed. The means for displaying objects also responds to the context of the preceding expression structure in controlling the display of the next object. For example, the lower and upper limits of integration are displayed in their proper locations with appropriate sizing. And in FIG. 3e, the "d" preceding the variable of integration t is automatically inserted once t is entered. FIGS. 3c-3e also illustrate how a subexpression of objects is ended. In FIG. 3c, objects entered with the cursor at the lower limit will be considered part of a subexpression for that limit until the user ends the subexpression. Pressing the cursor key 26 ends the subexpression and causes the cursor 36 to move to the upper limit. In FIG. 3d, a subexpression is similarly entered and ended, causing the cursor to move back to the center of the integral for entry of the integrand. In FIG. 3e, pressing the cursor key 26 and "t" ends the integrand and causes the displaying means to respond to the context by displaying the "d" before the "t." The integral sign 40 is but one example of the context sensitivity of the displaying means. Other objects that clearly illustrate it include the summation and nth root functions. Means are also provided for entering a mathematical expression displayed in textbook format into a storage location of the calculator for computation. As shown in FIG. 3f, a program in the calculator's memory responds to the pressing of key 34 to display the expression in linear form. This action also serves to exit the textbook routine. Referring again to FIG. 2, means such as an additional program routine (41) is provided for implicitly entering and displaying an object in response to entry of a predetermined pattern of objects. FIG. 4 shows the operation for the case of multiplication. When "X" is entered immediately after "2", a multiplier operator "•" is automatically inserted between the two objects. These predetermined patterns include, among others, a number followed by an alpha character and an alpha character followed by a prefix function (a function whose arguments(s) appear after its name). For that reason a "•" is also automatically inserted between "Y" and "LOG" when the [LOG] key is pressed. Additional help for the user is provided by means for checking the syntax of the mathematical expression as objects are entered to be displayed. FIG. 2 illustrates operation of a program routine (43) for one type of syntax checking, that of checking against incorrect entries of mathematical operators. The program first checks to see if the sequence of characters entered is a legal object. If not, it alerts the user to the error. If yes, it then checks to see if the legal object is permitted in the context of the preceding structure of the expression. If not, it alerts the user to the error. As briefly described above, calculator 10 includes means for entering a mathematical expression displayed in textbook format into a storage location of the calculator 10 for purposes of computation. The converse is also true. Objects or expressions presently in a storage location can be recalled for display in textbook format. FIGS. 5a-5g illustrate the movement of a mathematical expression between a textbook format on the display screen 14 to a storage location 44 and its recall and combination with other objects to form a new mathematical expression. In FIG. 5a, a first expression 42 is entered and displayed in textbook format. In FIG. 5b and 5c, the expression is first entered into memory on the calculator's stack 44 and then stored in a storage location under the variable "RATE." In FIG. 5d, "RATE" is recalled to the stack. To insert "RATE" into another expression, keys 16 and 34 are again pressed and cursor 36 appears (FIG. 5e). Several objects 46 for a new expression may then be entered (FIG. 5f) before the expression represented by "RATE" is recalled and combined into a new mathematical expression 48. In addition to entry and recall of mathematical expression in textbook format, means are provided for editing such expressions. One such means comprises a program routine whose operation is illustrated in FIGS. 6a-6e. FIG. 6a illustrates a completed expression in which it is desired to change the multiplier operator of tangent argument 50 to a divisor operator. Pressing key 28 changes to a Selection menu and the menu labels change appropriately. The cursor 36 may then be moved to the multiplier operator of subexpression 50, as shown in FIG. 6b. The subexpression, for which the operator is the top level function, may then be highlighted, as in FIG. 6c, by pressing the menu key EXPR. This highlighting allows the user to determine if he has the correct object for editing. If so he presses another menu key EDIT, as shown in FIG. 6d, which returns the subexpression to the calculator's command line 52 for editing. The user then edits the subexpression using the appropriate keys and returns the subexpression to the display screen by pressing key 34 (FIG. 6e). Another editing means comprises a program routine whose operation is illustrated in FIGS. 7a-7d. The program allows for insertion of an object from a storage location of the calculator 10 into the mathematical expression at the current location of the cursor. FIG. 7a shows an object 54 that has been entered and then copied onto the calculator stack at some point. In FIG. 7b, the textbook format is activated by pressing keys 16 and 34 in succession and an integral sign 40 and its arguments are entered and displayed. By pressing the keys shown in FIG. 7c, the object 54 is then inserted from the stack into the displayed expression at the location of the cursor. FIG. 7d illustrates further entry of objects from the keyboard and insertion of another copy of object 54. This feature thus permits a user to create a library of frequently-used subexpressions for building larger mathematical expressions. Where the mathematical expression is an equation, an unknown to be solved for may initially appear on both sides of the equation. The present invention includes means such as a program routine for rearranging the expression to produce only one occurrence of the unknown without changing the equation's value. The unknown can then be isolated and solved for using the computational power of the calculator 10. FIGS. 8a-8e illustrate this feature. In FIG. 8a, an equation is entered in textbook format as previously described. The unknown variable "X" appears on both sides of the equation. To collect the Xs, the user activates the Selection menu by pressing the cursor key 28 and moves the cursor until it covers the = sign 56 (FIG. 8b). The user then selects the RULES menu 58, indicated by the left menu label, by pressing the associated menu key (FIG. 8c). The subexpression or term "B•X" is moved to the left side of the equation by pressing the menu key associated with "move term left" label 60 shown in FIG. 8d. With both occurrences of X now on the same side of the equation, they can be merged using the distributive property by pressing the menu key associated with a "merge" label 62 shown in FIG. 8e. X now occurs only once in the equation. From this point the equation can be entered into a storage location and, using other calculator commands, isolated for a solution.

Claims: A computing device (10) having a display screen (14), keyboard (12) and means for displaying in textbook format a mathematical expression comprised of objects, said means comprising: a plurality of keys (16-34) for entering objects to be displayed; means (33) responsive to a key press for displaying an object associated with the key in textbook format; and a cursor (36) responsive to a currently entered object for indicating where a next object to be entered will be displayed; the displaying means (33) being further responsive to a currently entered object for controlling the display of the next object to maintain the textbook format of the expression; characterised in that said device (10) is a portable calculator and further comprises: means for solving said textbook formatted mathematical expression. A device according to claim 1, including means (41) for implicitly entering and displaying an object in response to entry of a predetermined pattern of objects. A device according to claim 2, wherein the means (41) for implicitly entering and displaying an object enters and displays an operator between two objects. A device according to any one of claims 1 to 3, further including syntax checking means (43) for checking the syntax of the mathematical expression after entry of an object. A device according to any one of claims 1 to 4, including editing means comprising: means (36) for selecting an object (50) of the mathematical expression for editing; means for copying the selected object (50) from the display screen (14) to a command line editor (52) for editing; means for editing the object (50) while in the command line editor (52); and means for copying the edited object (50) from the command line editor (52) to the display screen (14). A method (33) for displaying in textbook format a mathematical expression comprised of objects, in a computing device (10) having a display screen (14) and keyboard (12), said method comprising: switching to a textbook format appearance in response to a selected key press; displaying in textbook format objects associated with keys pressed thereafter; in response to a currently displayed object, positioning a cursor (36) to indicate where a next object to be entered will be displayed; and controlling the display of the next object to maintain the textbook format of the expression; characterised in that said device is a portable calculator and in that said method further comprises: solving said textbook formatted mathematical expression. A method according to claim 6, including checking (43) the syntax of the mathematical expression as objects are entered to be displayed. A method according to claim 7 or claim 8, including entering and displaying an object implicitly in response to entry of a predetermined pattern of objects. A method according to claim 8, wherein the means (41) for implicitly entering and displaying an object enters and displays an operator between two objects.

Inventors: EISENSTEIN GABE L, EISENSTEIN, GABE L.
Applicants: HEWLETT PACKARD CO, HEWLETT-PACKARD COMPANY
Application year: 1991
Main classification: G06F15
IPC codes: G06F15, G06F17, G06F3