OpenersNotesSection(Spacer1)Details

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (7)

Interpret mathematical formulas:

Interpreter["InactiveMathFormula"]["x + 3y >= -2"]

Interpreter["InactiveMathFormula"]["sin(a)+1 = 1.5"]

Find out Wolfram Language representations of natural language queries:

Interpreter["InactiveMathFormula"]["limit of 1/x for x->0 = infinity"]

No evaluation is attempted when matching the choices:

Interpreter[Restricted["InactiveMathFormula",{{True, False}}]]["2=2"]

Interpreter[Restricted["InactiveMathFormula",{{ Inactive[Equal][2, 2] ,False}}]]["2=2"]

By default, all symbols are allowed. Restrict to a list of allowed symbols:

Interpreter[Restricted["InactiveMathFormula",{Greater}]]["x>2"]

Interpreter[Restricted["InactiveMathFormula",{Greater}]]["log e>2"]

By default, new symbols are created in (RefLink[$Context, paclet:ref/$Context]), but a custom context can be specified:

Interpreter[Restricted["InactiveMathFormula",All,Automatic,Automatic]]["x = y + 2"]
Context[y]

Interpreter[Restricted["InactiveMathFormula",All,Automatic,"mycontext`"]]["h = k^3"]
Context[h]

Specify contexts for the allowed and output symbols:

mycontext`b = 10;
Interpreter[Restricted["InactiveMathFormula",Automatic,{"mycontext`","System`"},"mycontext`"]]["a < b+c"]
Context[c]

Prevent the creation of any new symbol:

Interpreter[Restricted["InactiveMathFormula",Automatic,Automatic,None]]["cos(pi) = -1"]

Interpreter[Restricted["InactiveMathFormula",Automatic,Automatic,None]]["cos(z) = -1"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[Restricted, paclet:ref/Restricted])  ▪  (RefLink[Failure, paclet:ref/Failure])  ▪  (RefLink[Inactive, paclet:ref/Inactive])  ▪  (RefLink[Inactivate, paclet:ref/Inactivate])}, {Related Interpreter Types:  (RefLink[MathFormula, paclet:ref/interpreter/MathFormula])  ▪  (RefLink[HeldMathFormula, paclet:ref/interpreter/HeldMathFormula])  ▪  (RefLink[MathExpression, paclet:ref/interpreter/MathExpression])  ▪  (RefLink[Expression, paclet:ref/interpreter/Expression])  ▪  (RefLink[WolframLanguageSymbol, paclet:ref/interpreter/WolframLanguageSymbol])  ▪  (RefLink[HeldMathExpression, paclet:ref/interpreter/HeldMathExpression])  ▪  (RefLink[InactiveMathExpression, paclet:ref/interpreter/InactiveMathExpression])  ▪  (RefLink[HeldExpression, paclet:ref/interpreter/HeldExpression])  ▪  (RefLink[InactiveExpression, paclet:ref/interpreter/InactiveExpression])  ▪  (RefLink[SemanticExpression, paclet:ref/interpreter/SemanticExpression])  ▪  (RefLink[HeldSemanticExpression, paclet:ref/interpreter/HeldSemanticExpression])  ▪  (RefLink[InactiveSemanticExpression, paclet:ref/interpreter/InactiveSemanticExpression])  ▪  (RefLink[ComputedWolframLanguageSymbol, paclet:ref/interpreter/ComputedWolframLanguageSymbol])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}})}})