Start Code
ASExprClass: PUBLIC Object ← AlgebraClasses.MakeClass["ASExprClass", NIL, NIL];
ASExprs: PUBLIC Object ← AlgebraClasses.MakeStructure["ASExprs", ASExprClass, NIL];
categoryMethod: Method ← AlgebraClasses.MakeMethod[Value, FALSE, NEW[AlgebraClasses.Category ← ring], NIL, "category"];
groundStructureMethod: Method ← AlgebraClasses.MakeMethod[Value, FALSE, NIL, NIL, "groundStructure"];
expressionStructureMethod: Method ← AlgebraClasses.MakeMethod[Value, FALSE, NIL, NIL, "expressionStructure"];
shortPrintNameMethod: Method ← AlgebraClasses.MakeMethod[ToRopeOp, FALSE, NEW[AlgebraClasses.ToRopeOp ← ShortPrintName], NIL, "shortPrintName"];
recastMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Recast], NIL, "recast"];
canRecastMethod: Method ← AlgebraClasses.MakeMethod[BinaryPredicate, TRUE, NEW[AlgebraClasses.BinaryPredicate ← CanRecast], NIL, "canRecast"];
toExprMethod: Method ← AlgebraClasses.MakeMethod[ToEXPROp, FALSE, NEW[AlgebraClasses.ToEXPROp ← ToEXPR], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "toExpr"];
fromExprMethod: Method ← AlgebraClasses.MakeMethod[FromEXPROp, FALSE, NEW[AlgebraClasses.FromEXPROp ← FromEXPR], NIL, "fromExpr"];
legalFirstCharMethod: Method ← AlgebraClasses.MakeMethod[LegalFirstCharOp, FALSE, NEW[AlgebraClasses.LegalFirstCharOp ← LegalFirstChar], NIL, "legalFirstChar"];
readMethod: Method ← AlgebraClasses.MakeMethod[ReadOp, FALSE, NEW[AlgebraClasses.ReadOp ← Read], NIL, "read"];
fromRopeMethod: Method ← AlgebraClasses.MakeMethod[FromRopeOp, TRUE, NEW[AlgebraClasses.FromRopeOp ← FromRope], NIL, "fromRope"];
toRopeMethod: Method ← AlgebraClasses.MakeMethod[ToRopeOp, FALSE, NEW[AlgebraClasses.ToRopeOp ← ToRope], NIL, "toRope"];
parenMethod: Method ← AlgebraClasses.MakeMethod[UnaryOp, FALSE, NEW[AlgebraClasses.UnaryOp ← AlgebraClasses.Copy], NIL, "paren"];
zeroMethod: Method ← AlgebraClasses.MakeMethod[NullaryOp, FALSE, NEW[AlgebraClasses.NullaryOp ← Zero], NIL, "zero"];
oneMethod: Method ← AlgebraClasses.MakeMethod[NullaryOp, FALSE, NEW[AlgebraClasses.NullaryOp ← One], NIL, "one"];
sumMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Add], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "sum"];
negationMethod: Method ← AlgebraClasses.MakeMethod[UnaryOp, TRUE, NEW[AlgebraClasses.UnaryOp ← Negate], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "negation"];
differenceMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Subtract], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "difference"];
productMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Multiply], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "product"];
powerMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Power], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "power"];
fractionMethod: Method ← AlgebraClasses.MakeMethod[BinaryOp, TRUE, NEW[AlgebraClasses.BinaryOp ← Divide], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "fraction"];
equalMethod: Method ← AlgebraClasses.MakeMethod[BinaryPredicate, TRUE, NEW[AlgebraClasses.BinaryPredicate ← Equal], NEW[AlgebraClasses.UnaryToListOp ← ASExprsDesired], "equals"];
AlgebraClasses.AddMethodToClass[$category, categoryMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$groundStructure, categoryMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$expressionStructure, expressionStructureMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$shortPrintName, shortPrintNameMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$recast, recastMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$canRecast, canRecastMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$toExpr, toExprMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$fromExpr, fromExprMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$legalFirstChar, legalFirstCharMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$read, readMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$fromRope, fromRopeMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$toRope, toRopeMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$paren, parenMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$zero, zeroMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$one, oneMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$sum, sumMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$negation, negationMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$difference, differenceMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$product, productMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$pow, powerMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$fraction, fractionMethod, ASExprClass];
AlgebraClasses.AddMethodToClass[$eqFormula, equalMethod, ASExprClass]; -- commented 9/27/89, to allow entry of expression with variables to be later evaluated in some environment
AlgebraClasses.InstallStructure[ASExprs]; -- do it later so methods from other structures found first (currently done in EvaluatorImpl)