-
See Also
- Interpreter
- Restricted
- Failure
- Inactive
- Inactivate
-
- Interpreter Types
- MathFormula
- HeldMathFormula
- MathExpression
- Expression
- WolframLanguageSymbol
- HeldMathExpression
- InactiveMathExpression
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- InactiveSemanticExpression
- ComputedWolframLanguageSymbol
- Related Guides
-
-
See Also
- Interpreter
- Restricted
- Failure
- Inactive
- Inactivate
-
- Interpreter Types
- MathFormula
- HeldMathFormula
- MathExpression
- Expression
- WolframLanguageSymbol
- HeldMathExpression
- InactiveMathExpression
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- InactiveSemanticExpression
- ComputedWolframLanguageSymbol
- Related Guides
-
See Also
"InactiveMathFormula" (Interpreter Type)
Details
- "InactiveMathFormula" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "InactiveMathFormula" requires connectivity to the Wolfram Cloud.
- "InactiveMathFormula" keeps its result unevaluated by wrapping it in Inactivate.
Restriction Specifications
-
Restricted["InactiveMathFormula",{{choice1,…}}] one among choices Restricted["InactiveMathFormula",symbols] a formula involving only the given symbols (All, Automatic, or an explicit list) Restricted["InactiveMathFormula",symbols,contexts] a formula involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["InactiveMathFormula",symbols,contexts,resultcontext] a formula involving only the given symbols or symbols in the given contexts, where the new symbols are created in resultcontext
Interpretation
- "InactiveMathFormula" yields an Inactive representation of the formula in the Wolfram Language, usually with an Equal, Greater, GreaterEqual, Less, or LessEqual head.
Examples
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 $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"]See Also
Interpreter Restricted Failure Inactive Inactivate
Interpreter Types: MathFormula HeldMathFormula MathExpression Expression WolframLanguageSymbol HeldMathExpression InactiveMathExpression HeldExpression InactiveExpression SemanticExpression HeldSemanticExpression InactiveSemanticExpression ComputedWolframLanguageSymbol
Related Guides
History
Introduced in 2014 (10.0)