MathDB.mesa
Carl Waldspurger, August 22, 1986 3:28:18 pm PDT
Definitions for Math "DataBase" Operations
DIRECTORY
Basics,
List,
Rope,
MathExpr USING [AtomClass, CompoundClass, MatrixClass];
MathDB: CEDAR DEFINITIONS ~
BEGIN
Abbreviations from Imported Interfaces
AtomClass: TYPE ~ MathExpr.AtomClass;
CompoundClass: TYPE ~ MathExpr.CompoundClass;
MatrixClass: TYPE ~ MathExpr.MatrixClass;
ROPE: TYPE ~ Rope.ROPE;
AList: TYPE ~ List.AList;
Public Lists of Expression Class Names, by Expr Type
AtomClassNames: READONLY LIST OF ATOM;
CompoundClassNames: READONLY LIST OF ATOM;
MatrixClassNames: READONLY LIST OF ATOM;
Operations on Public Lists of Expression Class Names, by Expr Type
ResetAtomClasses: PROC[];
effects: Resets (i.e. destroys) the global AtomClass DataBase
ResetCompoundClasses: PROC[];
effects: Resets (i.e. destroys) the global CompoundClass DataBase
ResetMatrixClasses: PROC[];
effects: Resets (i.e. destroys) the global MatrixClass DataBase
InstallAtomClass: PROC[class: AtomClass];
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.
InstallCompoundClass: PROC[class: CompoundClass];
effects: Installs class in global CompoundClass DataBase. Replaces existing ...
InstallMatrixClass: PROC[class: MatrixClass];
effects: Installs class in global MatrixClass DataBase. Replaces existing ...
LookupAtomClass: PROC[name: ATOM] RETURNS[AtomClass];
effects: Returns the AtomClass object associated with name.
SIGNALS notFound if no association exists
LookupCompoundClass: PROC[name: ATOM] RETURNS[CompoundClass];
effects: Returns the CompoundClass object associated with name.
SIGNALS notFound if no association exists
LookupMatrixClass: PROC[name: ATOM] RETURNS[MatrixClass];
effects: Returns the MatrixClass object associated with name.
SIGNALS notFound if no association exists
KillAtomClass: PROC[name: ATOM];
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.
KillCompoundClass: PROC[name: ATOM];
effects: delete the CompoundClass object associated with name, if present. Only needed ...
KillMatrixClass: PROC[name: ATOM];
effects: delete the MatrixClass object associated with name, if present. Only needed ...
DescriptionFromName: PROC[className: ATOM] RETURNS[ROPE];
effects: lookup the class in the entire (Atom, Compound, and Matrix) Expression Class database, and return its description. Signals error if not found.
DescriptionsFromNames: PROC[in: LIST OF ATOM] RETURNS[LIST OF ROPE];
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
ResetOperatorLists: PROC[];
effects: Resets (i.e. destroys) the public lists of operator names
AddOperator: PROC[class: CompoundClass, familyName: ATOM];
effects: Installs an operator name in the public lists
OpFamiliesNames: PROC[] RETURNS[LIST OF ATOM];
effects: Returns the list of all Op families
OpFamilyNames: PROC[familyName: ATOM] RETURNS[LIST OF ATOM];
effects: Returns the list of Op Names associated with familyName.
SIGNALS notFound if no association exists
Operator Precedence
CompareOps: PROC[op1, op2: ATOM] RETURNS[Basics.Comparison];
effects: compute operator precedence
Utility Procs
RopesFromAtoms: PROC [in: LIST OF ATOM] RETURNS[LIST OF ROPE];
Apply RopeFromAtom to each element
KillAssoc: PROC [key: REF ANY, aList: AList] RETURNS[AList];
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
notFound: ERROR;
END.