expr-stringimplicitmultiply-(optional) true or falselastread-(optional) unevaluated namenames-(optional) set or the string "all", as described belowcorenames-(optional) setvariables-(optional) set

<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>The Parse command accepts a string containing a Maple-syntax math expression, and returns an inert-form expression. By parsing to inert form you can avoid automatic simplification that is normally done on mathematical expressions. For example, parsing "1+1" using the parse command will give you the answer 2, because Maple automatically simplifies expressions where multiple integer constants are added. Using this parser, the same "1+1" will give %+(1,1), where the terms are all present in a form that can be easily manipulated in a predictable way. For more information on automatic simplification, refer to the Maple Expressions chapter of the Maple Programming Guide.The inert form rewrites the following (normally infix) operators: *, +, ^, /. It also prefixes all function calls with a percent character.Note that the unary negation operator is not rewritten. Parse of "-x" will return -x, and Parse of "a-b" will return %+(a,-b). Similarly Parse of "-a+b" will return %+(-a,b), so there is no ambiguity, and an inert minus is not necessary, except in the case of -0, which will be parsed to %*(0,-1).If a string contains multiple expressions separated by a semicolon, only the first expression is parsed. The lastread option can be used to find the character position of the last character included in the parsed result. Pass an unevaluated name, lastread='n', and the designated name will be assigned the integer position. This option should not be used in combination with implicitmultiply because some transformations are done to the string prior to true parsing, the offset returned will be unreliable.
<Text-field style="Heading 2" layout="Heading 2" bookmark="bkmrk1">Implicit Multiplication</Text-field>Adding the optional parameter, implicitmultiply, or implicitmultiply=true will cause the parser to interpret some situations as implied multiplication. An explicit space, such as in the expressions "2 x", or "x y", or "x 2", or "(x+4) y", is interpreted by Parse as multiplication. A number followed by a variable or open parenthesis with no space, such as "2x", or "2(x-4)" is interpreted as multiplication between the number and subsequent expression.Two back-to-back expressions surrounded by parentheses, such as "(x-1)(x+1)" is interpreted as multiplication between expressions.Multi-letter variable names, if not otherwise specified by either the names or corenames options are interpreted as single letter variables multiplied together. Thus "xy" is parsed as "x*y", but "norm(x)" is also interpreted as "n*o*r*m*x".The names option lets you specify which additional variable and function names should be accepted as a single entity. The additional names should be combined in set brackets, { } and denoted as strings. Calling Parse("norm(x)",implicitmultiply,names={"norm"}) will now be interpreted as a single function call, %norm(x) as opposed to multiplication of single-letter variables as in the previous paragraph.names="all" can be used to specify that all multi-letter names should be interpreted as single entities instead of a multiplication of single-letter variables.The corenames option works in conjunction with the names option to build a complete list of recognized multi-letter names. The union of corenames and names constitutes the full set of recognized names. corenames is predefined to include standard special functions like sin, cos, log, and Pi. For a complete definition, execute Describe(InertForm:-Parse).By setting corenames={} you can override and eliminate all known names.There is some ambiguity in identifying which names should be kept in the expression. Consider the case where expr = phi2, and names = {phi,phi2}. This could be interpreted as `%*`(phi,2) or as phi2. This command will return the latter. It matches the longest names first.Realated to names and corenames, the variables option lets you specify additional names that should always be treated as variables. For example, "x(y+1)" is normally interpreted as the function x called with arguments y+1. The other interpretation would be x multiplied by y+1. By specifying x in the set of variables, it will not be interpreted as a function name. See Describe(InertForm:-Parse) for the default list of variables (which includes x). When implicitmultiply is enabled, the input should be restricted to mathematical expressions. Constructs like procedures and modules are not supported, and will likely trigger a syntax error.
<Text-field style="Heading 2" layout="Heading 2" bookmark="bkmrk2">Package Usage</Text-field>This function is part of the InertForm package, so it can be used in the short form Parse(..) only after executing the command with(InertForm). However, it can always be accessed through the long form of the command by using InertForm[Parse](..).
<Text-field style="Heading 2" layout="Heading 2" bookmark="examples">Examples</Text-field>In this example we will start with parsing a string to an inert form.ex := InertForm:-Parse( "(1+2)/6" );Behind the scenes this inert form uses functional forms of %/ and %+ instead of infix operators. lprint(ex);To convert to regular, active-form, use the value command. This expression will simplify automatically.value(ex);Use the op command to access the raw data structure.op(0,ex);op(1,ex);op([1,0],ex);op([1,1],ex);op([1,2],ex);op(2,ex);Inert form are used behind the scenes in other Maple commands to prevent automatic simplification, such as in the Quiz Command, or some of the step-by-step solvers:Student:-Basics:-ExpandSteps((a^2-1)/((1/3)*a+1/3));Below are some examples that show how the implicitmultiply option works. It assumes names are single-characters unless told otherwise. InertForm:-Parse( "cx2", 'implicitmultiply' );InertForm:-Parse( "c x 2", 'implicitmultiply' );InertForm:-Parse( "cx2", 'implicitmultiply', names="all" );InertForm:-Parse( "cx2", 'implicitmultiply', names={x2} );InertForm:-Parse( "phi1phi2", 'implicitmultiply', names={phi,phi1,phi2} );InertForm:-Parse( "abcd", 'implicitmultiply', names={ab,cd,abc} );InertForm:-Parse("varx^2",'implicitmultiply',names={var});InertForm:-Parse("f(\"a b c\")",implicitmultiply);
<Text-field style="Heading 2" layout="Heading 2" bookmark="compatibility">Compatibility</Text-field>The InertForm[Parse] command was introduced in Maple 18.For more information on Maple 18 changes, see Updates in Maple 18.See AlsoInertForm:-DisplayparseProgrammingGuide/MapleExpressions