CaminoRealMain.mesa
Last Edited by: Arnon, August 20, 1986 10:06:51 am PDT
DIRECTORY
Commander,
Process,
ViewerClasses,
Rope,
Menus,
IO,
Convert,
ViewerIO,
ViewerTools,
TypeScript,
AlgebraClasses,
Points,
Bools,
Ints,
BigRats,
RatIntervals,
Reals,
Complexes,
Variables,
Polynomials,
AlgebraicNumbers,
ExtensionFields,
Matrices,
Formulas,
MathCommunication,
MathExpr;
CaminoRealMain: CEDAR PROGRAM
IMPORTS Menus, ViewerIO, IO, Convert, Rope, ViewerTools, TypeScript, Ints, AlgebraClasses, Points, Bools, BigRats, RatIntervals, Reals, Complexes, Variables, Polynomials, AlgebraicNumbers, ExtensionFields, Matrices, Formulas, MathCommunication
= BEGIN OPEN AC: AlgebraClasses, PTS: Points, INTS: Ints, BR: BigRats, RI: RatIntervals, VARS: Variables, AN: AlgebraicNumbers, EF: ExtensionFields, POL: Polynomials, MAT: Matrices, QFF: Formulas;
windowCount: INT ← 0; -- a count of the number of calculators created
MakeCalculator: ENTRY Commander.CommandProc = BEGIN
Puts up a calculator window.
title: Rope.ROPE;
windowCount ← windowCount+1;
title ← IO.PutFR["Algebra machine number %g", IO.int[windowCount]];
TRUSTED {Process.Detach[FORK Calculate[title]];}
END;
Calculate: PROC[title: Rope.ROPE] = {
computeTS: TypeScript.TS;
computeIn, computeOut: IO.STREAM;
structureTS: TypeScript.TS;
structureIn, structureOut: IO.STREAM;
workingVariableSequence: VARS.VariableSeq;
workingMatrixSize: NAT;
workingRatInt: RI.RatInterval ← NIL;
workingAlgNum, workingRealAlgNum: AN.AlgebraicNumber ← NIL;
workingStructure, XStructure, YStructure, AuxStructure: AC.Structure ← NIL;
X, Y, Aux: AC.Object ← NIL;
XViewer: ViewerClasses.Viewer ← MathCommunication.Create[NIL,"X Register"];
YViewer: ViewerClasses.Viewer ← MathCommunication.Create[NIL,"Y Register"];
AuxViewer: ViewerClasses.Viewer ← MathCommunication.Create[NIL,"Auxiliary Register"];
PrintStructure:
PROC [structure:
AC.Structure, identifier: Rope.
ROPE] ~ {
IF structure #
NIL
THEN
structureOut.PutRope[ Rope.Cat[identifier, " set to (",
Rope.Cat[AC.StructureCategoryToRope[structure.class.category], ") ", structure.class.printName[structure], "\n\n"] ] ]
ELSE
structureOut.PutRope[Rope.Concat[identifier, " undefined"] ];
};
SetIntegers: Menus.MenuProc = {
workingStructure ← INTS.Ints;
PrintStructure[workingStructure, "Working Structure"];
};
SetRationals: Menus.MenuProc = {
workingStructure ← BR.BigRats;
PrintStructure[workingStructure, "Working Structure"];
};
SetReals: Menus.MenuProc = {
workingStructure ← Reals.Reals;
PrintStructure[workingStructure, "Working Structure"];
};
SetComplexes: Menus.MenuProc = {
workingStructure ← Complexes.Complexes;
PrintStructure[workingStructure, "Working Structure"];
};
SetVarSeq: Menus.MenuProc = {
workingVariableSequence ← VARS.VariableSeqFromRope[ViewerTools.GetSelectionContents[] ];
structureOut.PutRope[ Rope.Cat["Variables = ", VARS.VariableSeqToRope[workingVariableSequence], "\n\n"] ];
};
MakePolyRing: Menus.MenuProc = {
workingStructure ← POL.MakePolynomialStructure[workingStructure, workingVariableSequence];
PrintStructure[workingStructure, "Working Structure"];
};
MakeFormulaAlgebra: Menus.MenuProc = {
IF NOT POL.IsPolynomialRing[workingStructure] THEN ERROR;
workingStructure ← QFF.MakeFormulaAlgebra[workingStructure];
PrintStructure[workingStructure, "Working Structure"];
};
SetGenAlgebraicNum: Menus.MenuProc = {
data: POL.PolynomialRingData ← NARROW[AuxStructure.instanceData];
groundStructure: AC.Structure ← data.coeffRing;
IF groundStructure.class.category # field AND groundStructure.class.category # divisionAlgebra THEN ERROR;
IF groundStructure.class.algebraicallyClosedField THEN ERROR;
workingAlgNum ← AN.MakeAlgebraicNumber[AuxStructure, NARROW[Aux, POL.Polynomial]];
AN.WriteAlgebraicNumber[workingAlgNum, structureOut]; structureOut.PutF["\n"];
};
MakeGenExtField: Menus.MenuProc = {
IF workingAlgNum = NIL THEN ERROR;
workingStructure ← EF.MakeExtensionField[workingAlgNum];
PrintStructure[workingStructure, "Working Structure"];
};
SetRatInt: Menus.MenuProc = {
workingRatInt ← RI.RatIntervalFromRope[ViewerTools.GetSelectionContents[] ];
RI.WriteRatInterval[workingRatInt, structureOut]; structureOut.PutF["\n"];
};
SetRealAlgebraicNum: Menus.MenuProc = {
IF workingRatInt = NIL THEN ERROR;
workingRealAlgNum ← AN.MakeAlgebraicNumber[AuxStructure, NARROW[Aux, POL.Polynomial], TRUE, workingRatInt ];
AN.WriteAlgebraicNumber[workingRealAlgNum, structureOut]; structureOut.PutF["\n"];
};
MakeRealExtField: Menus.MenuProc = {
IF workingRealAlgNum = NIL THEN ERROR;
workingStructure ← EF.MakeExtensionField[workingRealAlgNum];
PrintStructure[workingStructure, "Working Structure"];
};
SetMatrixSize: Menus.MenuProc = {
workingMatrixSize ← Convert.CardFromRope[ViewerTools.GetSelectionContents[] ];
structureOut.PutF["Matrix/Point Size = %g\n\n", IO.card[workingMatrixSize] ];
};
MakeMatrixRing: Menus.MenuProc = {
workingStructure ← MAT.MakeMatrixStructure[workingStructure, workingMatrixSize];
PrintStructure[workingStructure, "Working Structure"];
};
MakePointStructure: Menus.MenuProc = {
workingStructure ← PTS.MakePointStructure[workingStructure, workingMatrixSize];
PrintStructure[workingStructure, "Working Structure"];
};
SetXStruct: Menus.MenuProc = {
XStructure ← workingStructure;
X ← NIL; -- set corresponding Camino variable to NIL, but don't touch Meddle viewer
PutExpr[ XStructure, X, XViewer];
PrintStructure[XStructure, "X Structure"];
};
SetYStruct: Menus.MenuProc = {
YStructure ← workingStructure;
Y ← NIL;
PutExpr[ YStructure, Y, YViewer];
PrintStructure[YStructure, "Y Structure"];
};
SetAuxStruct: Menus.MenuProc = {
AuxStructure ← workingStructure;
Aux ← NIL;
PutExpr[ AuxStructure, Aux, AuxViewer];
PrintStructure[AuxStructure, "Aux Structure"];
};
ShowXStruct: Menus.MenuProc = {
PrintStructure[XStructure, "X Structure"];
};
ShowYStruct: Menus.MenuProc = {
PrintStructure[YStructure, "Y Structure"];
};
ShowAuxStruct: Menus.MenuProc = {
PrintStructure[AuxStructure, "Aux Structure"];
};
PutExpr:
PROC [structure:
AC.Structure, structureElement:
AC.Object, viewer: ViewerClasses.Viewer] ~ {
IF structureElement =
NIL
THEN {
computeOut.PutF["structureElement = NIL\n\n"];
MathCommunication.SetContents[viewer, NIL ];
RETURN;
};
structure.class.write[computeOut, structureElement];
computeOut.PutRope["\n\n"];
IF structure.class.toExpr = NIL THEN RETURN;
MathCommunication.SetContents[viewer, structure.class.toExpr[structureElement] ];
};
XFromY: Menus.MenuProc = {
X ← Y;
XStructure ← YStructure;
PutExpr[ XStructure, X, XViewer];
PrintStructure[XStructure, "X Structure"];
};
XFromAux: Menus.MenuProc = {
X ← Aux;
XStructure ← AuxStructure;
PutExpr[ XStructure, X, XViewer];
PrintStructure[XStructure, "X Structure"];
};
YFromX: Menus.MenuProc = {
Y ← X;
YStructure ← XStructure;
PutExpr[ YStructure, Y, YViewer];
PrintStructure[YStructure, "Y Structure"];
};
YFromAux: Menus.MenuProc = {
Y ← Aux;
YStructure ← AuxStructure;
PutExpr[ YStructure, Y, YViewer];
PrintStructure[YStructure, "Y Structure"];
};
AuxFromX: Menus.MenuProc = {
Aux ← X;
AuxStructure ← XStructure;
PutExpr[ AuxStructure, Aux, AuxViewer];
PrintStructure[AuxStructure, "Aux Structure"];
};
AuxFromY: Menus.MenuProc = {
Aux ← Y;
AuxStructure ← YStructure;
PutExpr[ AuxStructure, Aux, AuxViewer];
PrintStructure[AuxStructure, "Aux Structure"];
};
CaminoGetX: Menus.MenuProc = {
X ← XStructure.class.fromRope[ViewerTools.GetSelectionContents[], XStructure];
PutExpr[ XStructure, X, XViewer ];
};
MeddleGetX: Menus.MenuProc = {
X ← XStructure.class.fromRope[MathCommunication.GetContents[XViewer], XStructure];
PutExpr[ XStructure, X, XViewer ];
};
CaminoGetY: Menus.MenuProc = {
Y ← YStructure.class.fromRope[ViewerTools.GetSelectionContents[], YStructure];
PutExpr[ YStructure, Y, YViewer ];
};
MeddleGetY: Menus.MenuProc = {
Y ← YStructure.class.fromRope[MathCommunication.GetContents[YViewer], YStructure];
PutExpr[ YStructure, Y, YViewer ];
};
CaminoGetAux: Menus.MenuProc = {
Aux ← AuxStructure.class.fromRope[ViewerTools.GetSelectionContents[], AuxStructure];
PutExpr[ AuxStructure, Aux, AuxViewer ];
};
MeddleGetAux: Menus.MenuProc = {
Aux ← AuxStructure.class.fromRope[MathCommunication.GetContents[AuxViewer], AuxStructure];
PutExpr[ AuxStructure, Aux, AuxViewer ];
};
SetScalar: Menus.MenuProc = {
groundStructure: AC.Structure;
dataMatrix: Matrices.MatrixStructureData;
dataGenExtField: EF.ExtensionFieldData;
dataRealExtField: EF.ExtensionFieldData;
dataVectorSpace:
IF XStructure.class.category # vectorSpace AND XStructure.class.category # algebra AND XStructure.class.category # divisionAlgebra THEN ERROR;
IF Matrices.IsMatrixRing[XStructure]
THEN{
dataMatrix ← NARROW[XStructure.instanceData];
groundStructure ← dataMatrix.elementStructure;
}
ELSE
IF
EF.IsGeneralExtensionField[XStructure]
THEN {
dataPolynomial: POL.PolynomialRingData;
dataGenExtField ← NARROW[XStructure.instanceData];
dataPolynomial ← NARROW[dataGenExtField.primitiveElement.minPolyRing.instanceData];
groundStructure ← dataPolynomial.coeffRing;
}
ELSE
IF
EF.IsRealExtensionField[XStructure]
THEN {
dataPolynomial: POL.PolynomialRingData;
dataRealExtField ← NARROW[XStructure.instanceData];
dataPolynomial ← NARROW[dataRealExtField.primitiveElement.minPolyRing.instanceData];
groundStructure ← dataPolynomial.coeffRing;
}
ELSE ERROR;
Aux ← groundStructure.class.fromRope[ViewerTools.GetSelectionContents[], groundStructure];
AuxStructure ← groundStructure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
AddStructureElements: Menus.MenuProc = {
X ← XStructure.class.add[X, Y];
PutExpr[ XStructure, X, XViewer ];
};
NegateStructureElement: Menus.MenuProc = {
X ← XStructure.class.negate[X];
PutExpr[ XStructure, X, XViewer ];
};
SubtractStructureElements: Menus.MenuProc = {
X ← XStructure.class.subtract[X, Y];
PutExpr[ XStructure, X, XViewer ];
};
MultiplyStructureElements: Menus.MenuProc = {
X ← XStructure.class.multiply[X, Y];
PutExpr[ XStructure, X, XViewer ];
};
InvertStructureElement: Menus.MenuProc = {
IF XStructure.class.invert =
NIL
THEN {
computeOut.PutRope["No invert op in this structure\n\n" ];
RETURN;
};
X ← XStructure.class.invert[X];
PutExpr[ XStructure, X, XViewer ];
};
DivideStructureElements: Menus.MenuProc = {
IF XStructure.class.divide =
NIL
THEN {
computeOut.PutRope["No divide op in this structure\n\n" ];
RETURN;
};
X ← XStructure.class.divide[X, Y];
PutExpr[ XStructure, X, XViewer ];
};
RemainderStructureElements: Menus.MenuProc = {
IF XStructure.class.remainder =
NIL
THEN {
computeOut.PutRope["No remainder op in this structure\n\n" ];
RETURN;
};
X ← XStructure.class.remainder[X, Y];
PutExpr[ XStructure, X, XViewer ];
};
ScalarMultiply: Menus.MenuProc = {
IF XStructure.class.scalarMultiply =
NIL
THEN {
computeOut.PutRope["No scalarMultiply op in this structure\n\n" ];
RETURN;
};
IF Aux = NIL THEN ERROR;
X ← XStructure.class.scalarMultiply[Aux, X];
PutExpr[ XStructure, X, XViewer ];
};
MatrixTranspose: Menus.MenuProc = {
IF
NOT Matrices.IsMatrixRing[XStructure]
THEN {
computeOut.PutRope["Structure is not a matrix ring\n\n" ];
RETURN;
};
X ← Matrices.Transpose[XStructure][X];
PutExpr[ XStructure, X, XViewer ];
};
MatrixDeterminant: Menus.MenuProc = {
data: Matrices.MatrixStructureData;
IF
NOT Matrices.IsMatrixRing[XStructure]
THEN {
computeOut.PutRope["Structure is not a matrix ring\n\n" ];
RETURN;
};
data ← NARROW[XStructure.instanceData];
Aux ← Matrices.Determinant[XStructure][X];
AuxStructure ← data.elementStructure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
PolynomialDiff: Menus.MenuProc = {
IF
NOT
POL.IsPolynomialRing[XStructure]
THEN {
computeOut.PutRope["Structure is not a polynomial ring\n\n" ];
RETURN;
};
Aux ← POL.Differentiate[XStructure][X];
AuxStructure ← XStructure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
MainVarEval: Menus.MenuProc = {
IF
POL.IsPolynomialRing[XStructure]
THEN {
dataPolynomial: POL.PolynomialRingData ← NARROW[XStructure.instanceData];
coeffRing: AC.Structure ← dataPolynomial.coeffRing;
Aux ← POL.MainVarEval[XStructure][NARROW[X, POL.Polynomial], Y ];
AuxStructure ← coeffRing;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
}
ELSE computeOut.PutRope["No MainVarEval op in this structure\n\n" ];
};
AllVarEval: Menus.MenuProc = {
IF
POL.IsPolynomialRing[XStructure]
THEN {
dataPolynomial: POL.PolynomialRingData ← NARROW[XStructure.instanceData];
baseCoeffRing: AC.Structure ← dataPolynomial.baseCoeffRing;
evalPoint: Points.Point ← NARROW[Y];
Aux ← POL.AllVarEval[XStructure][NARROW[X, POL.Polynomial], evalPoint];
AuxStructure ← baseCoeffRing;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
RETURN;
}
ELSE
IF
QFF.IsFormulaAlgebra[XStructure]
THEN {
evalPoint: Points.Point ← NARROW[Y];
Aux ← QFF.AllVarEval[XStructure][NARROW[X, QFF.Formula], evalPoint];
AuxStructure ← Bools.Bools;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
}
ELSE computeOut.PutRope["No AllVarEval op in this structure\n\n" ];
};
DoSubst: Menus.MenuProc = {
Aux ← POL.Subst[XStructure][NARROW[X, POL.Polynomial], NARROW[Y, POL.Polynomial]];
AuxStructure ← XStructure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
SylvesterMatrix: Menus.MenuProc = {
matrix: Matrices.Matrix ← NARROW[POL.SylvesterMatrix[XStructure][NARROW[X, POL.Polynomial], NARROW[Y, POL.Polynomial] ] ];
Aux ← matrix;
AuxStructure ← matrix.structure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
Resultant: Menus.MenuProc = {
matrix: Matrices.Matrix ← NARROW[POL.SylvesterMatrix[XStructure][NARROW[X, POL.Polynomial], NARROW[Y, POL.Polynomial] ] ];
data: Matrices.MatrixStructureData ← NARROW[matrix.structure.instanceData];
Aux ← Matrices.Determinant[matrix.structure][matrix];
AuxStructure ← data.elementStructure;
PutExpr[ AuxStructure, Aux, AuxViewer ];
PrintStructure[AuxStructure, "Aux Structure"];
};
structureTS ← TypeScript.Create[info: [name: "CaminoReal Structures" ] ];
Menus.ChangeNumberOfLines[menu: structureTS.menu, newLines: 4];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Ints", proc: SetIntegers]];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"BigRats", proc: SetRationals]];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Reals", proc: SetReals]];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Complexes", proc: SetComplexes]];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"VarSeq", proc: SetVarSeq], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"PolyRing", proc: MakePolyRing], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Formulas", proc: MakeFormulaAlgebra], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"GenAlgNum", proc: SetGenAlgebraicNum], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"GenExtField", proc: MakeGenExtField], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"RatInterval", proc: SetRatInt], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"RealAlgNum", proc: SetRealAlgebraicNum], line:1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"RealExtField", proc: MakeRealExtField], line: 1];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Matrix/PointSize", proc: SetMatrixSize], line: 2];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"MatrixRing", proc: MakeMatrixRing], line: 2];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"Points", proc: MakePointStructure], line: 2];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"SetXStruct", proc: SetXStruct], line: 3];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"SetYStruct", proc: SetYStruct], line: 3];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"SetAuxStruct", proc: SetAuxStruct], line: 3];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"ShowXStruct", proc: ShowXStruct], line: 3];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"ShowYStruct", proc: ShowYStruct], line: 3];
Menus.AppendMenuEntry[menu: structureTS.menu, entry:Menus.CreateEntry [name:"ShowAuxStruct", proc: ShowAuxStruct], line: 3];
computeTS ← TypeScript.Create[info: [name: "CaminoReal Compute" ] ];
Menus.ChangeNumberOfLines[menu: computeTS.menu, newLines: 4];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Add ", proc: AddStructureElements], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Neg ", proc: NegateStructureElement], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Sub ", proc: SubtractStructureElements], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Mult", proc: MultiplyStructureElements], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Inv", proc: InvertStructureElement], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Div", proc: DivideStructureElements], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Rem", proc: RemainderStructureElements], line: 0];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Deriv ", proc: PolynomialDiff], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"MainVarEv", proc: MainVarEval], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"AllVarEv", proc: AllVarEval], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Subst", proc: DoSubst], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"SylvMat", proc: SylvesterMatrix], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Resultant", proc: Resultant], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Transpose ", proc: MatrixTranspose], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"Det ", proc: MatrixDeterminant], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"ScaMult", proc: ScalarMultiply], line: 1];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"XFromY", proc: XFromY], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"XFromAux", proc: XFromAux], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"YFromX", proc: YFromX], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"YFromAux", proc: YFromAux], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"AuxFromX", proc: AuxFromX], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"AuxFromY", proc: AuxFromY], line: 2];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"MeddleGetX", proc: MeddleGetX], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:" CaminoGetX", proc: CaminoGetX], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"MeddleGetY", proc: MeddleGetY], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"CaminoGetY", proc: CaminoGetY], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"MeddleGetAux", proc: MeddleGetAux], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"CaminoGetAux", proc: CaminoGetAux], line: 3];
Menus.AppendMenuEntry[menu: computeTS.menu, entry:Menus.CreateEntry [name:"SetScalar", proc: SetScalar], line: 3];
[in: computeIn, out: computeOut] ← ViewerIO.CreateViewerStreams[name: "CaminoReal Compute",viewer: computeTS ];
[in: structureIn, out: structureOut] ← ViewerIO.CreateViewerStreams[name: "CaminoReal Structures",viewer: structureTS ];
DO
out.PutChar[in.GetChar[] ];
ENDLOOP;
};
Commander.Register[
key: "Algebra", proc: MakeCalculator, doc: "Simple algebra system"];
END.