A cad database written on the Vax is parsed and written as a read-only Tioga document. Another (probably typescript) viewer is created as a main work area. Other viewers will be created as needed by operations. Available operations are:
+, -, * of polynomials
Int, Union, Diff of formulas.
Simplify formula (arbitary formula?)
Eval formula at point.
Plot cell, plot cluster, plot arbitrary collection of cells.
Plot formula (do cdsas, plot the cells).
Fork projection, cad, qe computation to Vax.
Browse adjacency graph: follow adjacency chain.
Coordinate change (to explore Prill adjacency algorithm)
Calculate: PROC[title: Rope.ROPE] = {
ts: TypeScript.TS; -- the primary typescript
in, out: IO.STREAM; -- global variables for log writing
poly1, poly2: Polynomials.Polynomial;
dpoly: Polynomials.DPolynomial;
globalV: VariableList;
SetVarList: Menus.MenuProc = {
globalV ← VariableListFromRope[ViewerTools.GetSelectionContents[] ];
WriteVariableList[globalV, out];
};
SetDPoly: Menus.MenuProc = {
dpoly ← DPolynomialFromRope[ViewerTools.GetSelectionContents[], globalV];
WriteDPolynomial[dpoly, globalV, out];
};
SetPoly1: Menus.MenuProc = {
poly1 ← PolynomialFromRope[ViewerTools.GetSelectionContents[], globalV];
WriteDPolynomial[DPolyFromPoly[poly1, globalV], globalV, out];
};
SetPoly2: Menus.MenuProc = {
poly2 ← PolynomialFromRope[ViewerTools.GetSelectionContents[], globalV];
WriteDPolynomial[DPolyFromPoly[poly2, globalV], globalV, out];
};
AddPolys: Menus.MenuProc = {
poly1 ← PolynomialAdd[poly1, poly2];
WriteDPolynomial[DPolyFromPoly[poly1, globalV], globalV, out];
};
NegatePoly: Menus.MenuProc = {
poly1 ← PolynomialNegate[poly1];
WriteDPolynomial[DPolyFromPoly[poly1, globalV], globalV, out];
};
SubtractPolys: Menus.MenuProc = {
poly1 ← PolynomialSubtract[poly1, poly2];
WriteDPolynomial[DPolyFromPoly[poly1, globalV], globalV, out];
};
MultiplyPolys: Menus.MenuProc = {
poly1 ← PolynomialMultiply[poly1, poly2];
WriteDPolynomial[DPolyFromPoly[poly1, globalV], globalV, out];
};
ts ← TypeScript.Create[info: [name: "Algebra"] ];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"VarList", proc: SetVarList]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"DPoly", proc: SetDPoly]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Poly1", proc: SetPoly1]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Poly2", proc: SetPoly2]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Add ", proc: AddPolys]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Negate ", proc: NegatePoly]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Subtract ", proc: SubtractPolys]];
Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"Multiply ", proc: MultiplyPolys]];
[in: in, out: out] ← ViewerIO.CreateViewerStreams[name: "Algebra",viewer: ts];
DO
out.PutChar[in.GetChar[] ];
ENDLOOP;
};