DIRECTORY Basics, List, Rope, MathExpr USING [AtomClass, CompoundClass, MatrixClass]; MathDB: CEDAR DEFINITIONS ~ BEGIN AtomClass: TYPE ~ MathExpr.AtomClass; CompoundClass: TYPE ~ MathExpr.CompoundClass; MatrixClass: TYPE ~ MathExpr.MatrixClass; ROPE: TYPE ~ Rope.ROPE; AList: TYPE ~ List.AList; AtomClassNames: READONLY LIST OF ATOM; CompoundClassNames: READONLY LIST OF ATOM; MatrixClassNames: READONLY LIST OF ATOM; ResetAtomClasses: PROC[]; ResetCompoundClasses: PROC[]; ResetMatrixClasses: PROC[]; InstallAtomClass: PROC[class: AtomClass]; InstallCompoundClass: PROC[class: CompoundClass]; InstallMatrixClass: PROC[class: MatrixClass]; LookupAtomClass: PROC[name: ATOM] RETURNS[AtomClass]; LookupCompoundClass: PROC[name: ATOM] RETURNS[CompoundClass]; LookupMatrixClass: PROC[name: ATOM] RETURNS[MatrixClass]; KillAtomClass: PROC[name: ATOM]; KillCompoundClass: PROC[name: ATOM]; KillMatrixClass: PROC[name: ATOM]; DescriptionFromName: PROC[className: ATOM] RETURNS[ROPE]; DescriptionsFromNames: PROC[in: LIST OF ATOM] RETURNS[LIST OF ROPE]; ResetOperatorLists: PROC[]; AddOperator: PROC[class: CompoundClass, familyName: ATOM]; OpFamiliesNames: PROC[] RETURNS[LIST OF ATOM]; OpFamilyNames: PROC[familyName: ATOM] RETURNS[LIST OF ATOM]; CompareOps: PROC[op1, op2: ATOM] RETURNS[Basics.Comparison]; RopesFromAtoms: PROC [in: LIST OF ATOM] RETURNS[LIST OF ROPE]; KillAssoc: PROC [key: REF ANY, aList: AList] RETURNS[AList]; notFound: ERROR; END. ΜMathDB.mesa Carl Waldspurger, August 22, 1986 3:28:18 pm PDT Definitions for Math "DataBase" Operations Abbreviations from Imported Interfaces Public Lists of Expression Class Names, by Expr Type Operations on Public Lists of Expression Class Names, by Expr Type effects: Resets (i.e. destroys) the global AtomClass DataBase effects: Resets (i.e. destroys) the global CompoundClass DataBase effects: Resets (i.e. destroys) the global MatrixClass DataBase effects: Installs class in global AtomClass DataBase. Replaces existing occurrence of an AtomClass with same name, if any, and otherwise places class at the tail of AtomClass DataBase. effects: Installs class in global CompoundClass DataBase. Replaces existing ... effects: Installs class in global MatrixClass DataBase. Replaces existing ... effects: Returns the AtomClass object associated with name. SIGNALS notFound if no association exists effects: Returns the CompoundClass object associated with name. SIGNALS notFound if no association exists effects: Returns the MatrixClass object associated with name. SIGNALS notFound if no association exists effects: delete the AtomClass object associated with name, if present. Only needed when want to delete a given AtomClass name entirely, not if just want to replace. effects: delete the CompoundClass object associated with name, if present. Only needed ... effects: delete the MatrixClass object associated with name, if present. Only needed ... effects: lookup the class in the entire (Atom, Compound, and Matrix) Expression Class database, and return its description. Signals error if not found. effects: lookup the class of each element in the entire (Atom, Compound, and Matrix) Expression Class database, and return its description. Signals error if some class not found not found. Public Lists of Operator Names (Operators assumed to be CompoundExprs) OpFamilyNames: READONLY LIST OF ATOM; ArithmeticOpsNames: READONLY LIST OF ATOM; ListOpsNames: READONLY LIST OF ATOM; AnalysisOpsNames: READONLY LIST OF ATOM; LogicalOpsNames: READONLY LIST OF ATOM; SetOpsNames: READONLY LIST OF ATOM; MatrixOpsNames: READONLY LIST OF ATOM; DecorationOpsNames: READONLY LIST OF ATOM; Operations on Public Table of Operator Families effects: Resets (i.e. destroys) the public lists of operator names effects: Installs an operator name in the public lists effects: Returns the list of all Op families effects: Returns the list of Op Names associated with familyName. SIGNALS notFound if no association exists Operator Precedence effects: compute operator precedence Utility Procs Apply RopeFromAtom to each element Removes the first (key, value) pair, if any, from aList. Destructive to list structure, and only removes the first occurrence. Hence if there is exactly one such (key, value) pair in aList, then after KillAssoc, there will be no (key, value) pairs, i.e. key will no longer be known. Like List.DRemove. Signals & Errors Κι˜Jšœ ™ Jšœ0™0J˜Jšœ*™*J˜codešΟk ˜ Kšœ˜Kšœ˜Kšœ˜Kšœ œ)˜7K˜K˜—šΟnœœ œ˜K˜Kš˜—headšž&™&Kšœ œ˜%Kšœœ˜-Kšœ œ˜)Kšœœœ˜Kšœœ˜—šž4™4Kšžœ œœœ˜&Kšžœ œœœ˜*Kš žœœœœœ˜(—šžB™Bšžœœ˜Kšœ>™>K˜—šžœœ˜KšœB™BK™—šžœœ˜Kšœ@™@—K˜šžœœ˜)Kšœ½™½K˜—šžœœ˜1KšœQ™QK™—šžœœ˜-KšœO™O—K™šžœœœœ ˜5Kšœ<™™>Kšœ3™3—K˜šž œœœ˜ Kšœ¦™¦K˜—šžœœœ˜$Kšœ[™[K™—šžœœœ˜"KšœY™YK™—š žœœ œœœ˜9Kšœ™™™K™—šžœœœœœœœœœ˜DKšœΎ™Ύ——šžF™FKš ž œœœœœ™%K™Kšžœ œœœ™*Kšž œ œœœ™$Kš žœœœœœ™(Kš žœœœœœ™'Kš ž œœœœœ™#Kš žœœœœœ™&Kš žœœœœœ™*—šž/™/šžœœ˜KšœC™CK™—šž œœ#œ˜:Kšœ7™7—K™š žœœœœœœ˜.Kšœ-™-K™—šž œœ œœœœœ˜Jšœ"™"K™—š ž œœœœœ˜