NSyntax20m.Scn.Fnt u8 bParcElemsAlloc Syntax12i.Scn.FntNSyntax14m.Scn.FntStyleElemsAlloc Title Syntax12.Scn.Fnt u8 Textj u8 Title u8 Text]F[ X   ϳ€Example  8FoldElemsNewSyntax12.Scn.Fnt ZStyleElemsAlloc TextSyntax10.Scn.Fnt X   ϳ€Exampleinterface(prettyprint = 0); interface(echo = 0); interface(warnlevel = 0); alias(const(infinity) = infinity): alias(const(e) = exp(1)): alias(const(pi) = Pi): alias(`factorial `= factorial): alias(gamma = GAMMA): alias(ceiling = ceil): alias(I = I): systemlimit := eval(limit): protect(systemlimit): unprotect(limit): limit := proc(f, x, x0, dir) local s; if type(x, 'equation') then systemlimit(args) else if dir = 1 then s := systemlimit(f, x = x0, right) elif dir = -1 then s := systemlimit(f, x = x0, left) else s := systemlimit(f, x = x0) fi; if type(s, 'range') then 'procname(args)' else s fi fi end: protect(limit): `print/limit` := proc(f, eq, dir) local d; if nargs = 4 then 'limit(args)' else if nargs = 3 then if dir = 'left' then d := -1 else d := 1 fi else d := 0 fi; 'limit'(f, lhs(eq), rhs(eq), d) fi end: systemint := eval(int): protect(systemint): unprotect(int): int := proc(f, x, a, b) if nargs = 2 then systemint(args) else systemint(f, x = a .. b) fi end: protect(int): `print/int` := proc(f, eq) if type(eq, 'equation') then 'int'(f, lhs(eq), op(rhs(eq))) else 'int(args)' fi end: `print/exp` := x -> exp(1)^(x): read `/dev/tty`:  8*8Syntax12.Scn.Fnt ZStyleElemsAlloc TextSyntax10.Scn.FntW X   ϳ€ExampleY# csh stty -echo -ocrnl -imaxbel -icanon min 1 time 0 maple -q < .qmapleinit stty sane  8< Z Text Z Title Text]spExprIconsAllocw( DTExprViewsAllocPlaceholderXBwcExprStdAllocInteger wc wc)BaEsExprStdAllocSymbolabEsbExprStdAllocBinaryOp+-*/Bwc {R*/B%yxEsxwc ExprStdAllocPower^8Bwc $y wc ^*/;Bwc #y ^*/FBwc "y ^*/Bwc l */wc +-@PByB +-^B  +- B +-B +-*/9}BO[BcEsc*/dEsd+-wcExprIconsAllocGraph X   ϳ€Example0EExprSlangAllocp"ExprSlangAlloc Z Text|L ! Z Text D X   ϳ€Example\EExprMapleAllocScriptFactorSyntax10.Scn.Fntp"ExprIconsAllocDT(DTExprViewsAllocPlaceholderExprIconsAllocGraph factor()p X   ϳ€Example0ExprSlangAlloc\EFactorSyntax10.Scn.Fntp"ExprIconsAllocDT(DTExprViewsAllocPlaceholderExprIconsAllocGraph factor() X   ϳ€Example5P4ExprSlangAlloc X   ϳ€Example MAAnihilateSyntax12i.Scn.Fnt8qExprIconsAlloc(DTExprViewsAllocPlaceholderExprIconsAllocGraph8q-p"p% X   ϳ€Example0"ExprSlangAlloc X   ϳ€ExampleMAAnihilateSyntax12i.Scn.Fnt8qExprIconsAlloc(DTExprViewsAllocPlaceholderExprIconsAllocGraph8q- X   ϳ€Example8"ExprSlangAlloc Z Text  TextKl Z Title? Z Text4 Z Text!K Syntax14b.Scn.Fnt(tExprMaple - User's Guide Wolfgang Weck Institute for Scientific Computing ETH Zrich Weck@inf.ethz.ch Introduction The ExprMaple package allows the ExpressionIcon editing package to interact with the Maple system. This interaction is limited in several aspects: Only singular operations on expressions are supported - in contrast to programming and the like. The interface does neither prohibit nor support other uses of Maple and has to be considered experimental with respect to this. Further, there is extra preparation needed for Maple to understand new extensions of the core package. In this version the expressions from the core package including the Lib0 extensions - but not the matrix extension - are supported. To increase portability of the entire system it is assumed that the user connects the system to Maple manually. It is described bellow how to do that. However, the Maple interface offers a programming interface too, thus allowing for programming script like modules. Setting up the Maple Interface The interface interacts with Maple through a serial communication link as provided by module Sessions. To install the interface in a specific session, execute the command ExprMaple.Install after marking a viewer that holds a terminal to that session. Maple is assumed to be running already in that session. Further, the echo of tty is supposed to be turned of and a special initialization file is expected to be executed by Maple, which needs to run in quiet mode. The typical sequence of actions on a Sparc computer is the following: Terminal.Open ~ given that .qmapleinit contains: .qmapleinit execute within that terminal the script qmaple: qmaple script mark the viewer containing the terminal ExprMaple.Install After this the terminal might be closed or as well kept open for a session protocol and to close the connection after the session. To remove the link from the interface to the current session execute ExprMaple.Remove . Evaluating with Maple Two possibilities exist to activate an evaluation by Maple: One can simply apply the command ExprMaple.Eval  to the least recent selected expression or activate a script. The former sends the selected expression to Maple and replaces it by the answer provided by Maple. This allows for simple simplifications of expressions:   ExprMaple.Eval   To execute more sophisticated transformations with Maple, scripts need to be employed. These are text elements. The command ExprMaple.InsertScript inserts a new and empty script at the current focus position (caret). To edit a script, it must be opened through a middle-left interclick on it. Opening will display a new text viewer allowing to edit the script's contents. Also, editing the viewers name will cause the script's name to change. To make changes permanent, execute Icons.Update in the menu area of the viewer. A script can be activated simply by clicking the middle mouse button on it. Upon activation the contents of the script will be sent to Maple literally. The only change happening is that every occurrence of an Placeholder-expression is substituted by the least recent selected expression. Assume a script  containing the text factor():     The script  holds the text - and should almost ever result in 0:      Whenever a Maple interface command is activated, the least recent selected expression is going to be replaced by the result of the Maple operation. If this selection is a text stretch it is immediately replaced by an icon. Thus, in any case, there exists a single icon in a document that is going to be changed through the Maple operation. This icon is being marked by horizontal lines as currently not valid. (If a subexpression within an icon has been selected, only this subexpression is going to be changed but the entire icon is marked.) However, this mark does not prevent the user from deleting or copying it. But note, that only the original instance of the icon is going to be affected by the Maple operation. If the user deletes that instance, the result will be lost. In case that the Maple operation produced an undesired result, the command ExprMaple.Undo can be used to undo a single. Again, this operation works on the icon used for display of the result only. Example: Interactive Paper on Formula Manipulation using Maple For further examples of useful scripts see the text ExprMaple.Tool text. As a more sophisticated example, MapleFormManip.Text containes a reformulated and slightly changed version of a paper entitled Formula Manipulation using Maple by Dominik Gruntz from The Maple Technical Newsletter, Issue 10. It has been compiled in a primitive example of an interactive paper - a small version of an interactive text book.