摘要 |
<p>A method and apparatus for identifying common subexpressions within a mathematical expression are disclosed. The expression is represented as a DAG (directed acyclic graph) or expression tree, and common subexpressions (syntactically identical subexpressions) are uniquely addressed as operator nodes in the tree. The method includes the steps of selecting a displayed subexpression, comparing the selected subexpression with predetermined subexpressions using the uniquely addressed operator nodes to determine if there is a match. If there is a match, a label (new name) is assigned to the selected subexpression, and all appearances of the selected subexpression are replaced (displayed) with the label. The apparatus comprises a keyboard with a mouse, a microprocessor, a read-only-memory with a stored program, a random access memory, and a cathode ray tube display. In response to applied data from the keyboard and/or mouse, the processor, under control of the stored program, labels (renames) subexpressions stored in the random access memory and displays the labeled subexpressions.</p> |