DIRECTORY RatNums, ViewerClasses, Rope, Menus, IO, ViewerIO, ViewerTools, ViewerOps, TypeScript, Polynomials; Algebra: CEDAR MONITOR IMPORTS Menus, ViewerIO, ViewerTools, TypeScript, Polynomials = BEGIN OPEN Polynomials; ts: TypeScript.TS; -- the primary typescript in, out: IO.STREAM; -- global variables for log writing poly1, poly2: Polynomials.Polynomial; globalV: VariableList; SetVarList: Menus.MenuProc = { globalV _ VariableListFromRope[ViewerTools.GetSelectionContents[] ]; WriteVariableList[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:"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]; END. Algebra.mesa Last Edited by: Arnon, June 20, 1985 4:46:23 pm PDT 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) The general mode of operations is for commands to take the contents of the current selection as their argument, which they then parse. Lists of multiple arguments are built up in a separate viewer, then selected. Command output goes to the main work area viewer. Variable lists are extracted from arguments, where necessary, commands specify a variable and variable list reordering of arguments is done. Vax Steps: QFFWRL (linear write qff), New kind of df's (y is the ith root of F(x,y))?, routine to do qerd and write Cedar-readable database (clustering cad records all info it has about sample points; option to crawl either .savcl file or Cedar-readable database and construct all sample points) (either recompute projections with verbosity, or change projection operator to record verbosity as it works). Parser: read distributed polynomial according to specified variable list, convert to recursive form, read qff, handle arithmetic of polynomials, extract variable list on the fly, quantified formulas not in prenex form. Display distributed polynomials with exponents raised with Tioga superscript look. Cedar requirements: Rootisolater (to move plotting over). Polynomial evaluation at algebraic point. Cedar issues: Integration of autded.tex and cad databases (TeX, Preview, Whiteboards). What cad algorithm do we want to implement (impact of Prill?). Commander, Process, 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] = { dpoly: Polynomials.DPolynomial; SetDPoly: Menus.MenuProc = { dpoly _ DPolynomialFromRope[ViewerTools.GetSelectionContents[], globalV]; WriteDPolynomial[dpoly, globalV, out]; }; Menus.AppendMenuEntry[menu: ts.menu, entry:Menus.CreateEntry [name:"DPoly", proc: SetDPoly]]; DO out.PutChar[in.GetChar[] ]; ENDLOOP; }; Commander.Register[ key: "Algebra", proc: MakeCalculator, doc: "Simple algebra system"]; Κ+˜šœ ™ J™3—J™™ξJ™J™J™$J™J™˜>J˜J˜—š œ˜NšœH˜HJšœ>˜>J˜J˜—š œ˜Nšœ$˜$Jšœ>˜>J˜J˜—š  œ˜Nšœ ˜ Jšœ>˜>J˜J˜—š  œ˜!Nšœ)˜)Jšœ>˜>J˜J˜—š  œ˜!Nšœ)˜)Jšœ>˜>J˜—J˜Kšœ1˜1Jšœa˜aJšœ]™]Jšœ]˜]Jšœ]˜]Jšœ\˜\Jšœa˜aJšœf˜fJšœf˜fKšœN˜Nš™Jšœ™Jšœ™—J™—J˜šœ™JšœD™D—J˜Jšœ˜˜J™——…—ΐω