-
See Also
- Interpreter
- Restricted
- Failure
- Inactive
- Inactivate
-
- Interpreter Types
- Expression
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- MathExpression
- MathFormula
- WolframLanguageSymbol
- HeldMathExpression
- InactiveMathExpression
- HeldMathFormula
- InactiveMathFormula
- ComputedWolframLanguageSymbol
- Related Guides
-
-
See Also
- Interpreter
- Restricted
- Failure
- Inactive
- Inactivate
-
- Interpreter Types
- Expression
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- MathExpression
- MathFormula
- WolframLanguageSymbol
- HeldMathExpression
- InactiveMathExpression
- HeldMathFormula
- InactiveMathFormula
- ComputedWolframLanguageSymbol
- Related Guides
-
See Also
"InactiveSemanticExpression" (Interpreter Type)
Details
- "InactiveSemanticExpression" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "InactiveSemanticExpression" does not require connectivity to the Wolfram Cloud.
- "InactiveSemanticExpression" keeps its result unevaluated by wrapping it in Inactivate.
Restriction Specifications
-
Restricted["InactiveSemanticExpression",{{choice1,…}}] one among choices Restricted["InactiveSemanticExpression",symbols] an expression involving only the given symbols (All, Automatic, or an explicit list) Restricted["InactiveSemanticExpression",symbols,contexts] an expression involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["InactiveSemanticExpression",symbols,contexts,resultcontext] an expression involving only the given symbols or symbols in the given contexts, where the new symbols are created in resultcontext
Interpretation
- "InactiveSemanticExpression" yields an Inactive Wolfram Language expression.
Examples
Basic Examples (7)
Interpret expressions and avoid evaluation:
Interpreter["InactiveSemanticExpression"]["two plus two"]Interpreter["InactiveSemanticExpression"]["d sin(x) / dx"]Find out Wolfram Language expressions corresponding to natural language queries:
Interpreter["InactiveSemanticExpression"]["height of the empire state building"]No evaluation is attempted when matching the choices:
Interpreter[Restricted["InactiveSemanticExpression", {{1, 2, 3, 4}}]]["two plus one"]Interpreter[Restricted["InactiveSemanticExpression", {{2, Inactivate[2 + 1]}}]]["two plus one"]By default, all symbols are allowed. Restrict to a list of allowed symbols:
Interpreter[Restricted["InactiveSemanticExpression", {Plus, Times, Equal}]]["6*4==16+8"]Interpreter[Restricted["InactiveSemanticExpression", {Plus, Times, Equal}]]["6/4==16+8"]By default, new symbols are created in $Context, but a custom context can be specified:
Interpreter[Restricted["InactiveSemanticExpression", All, Automatic, Automatic]]["y + 2"]
Context[y]Interpreter[Restricted["InactiveSemanticExpression", All, Automatic, "mycontext`"]]["j + 2"]
Context[j]Specify contexts for the allowed and output symbols:
mycontext`b = 10;
Interpreter[Restricted["InactiveSemanticExpression", Automatic, {"mycontext`", "System`"}, "mycontext`"]]["a+b"]
Context[a]Prevent the creation of any new symbol:
Interpreter[Restricted["InactiveSemanticExpression", Automatic, Automatic, None]]["cos(pi)"]Interpreter[Restricted["InactiveSemanticExpression", Automatic, Automatic, None]]["cos(x)"]See Also
Interpreter Restricted Failure Inactive Inactivate
Interpreter Types: Expression HeldExpression InactiveExpression SemanticExpression HeldSemanticExpression MathExpression MathFormula WolframLanguageSymbol HeldMathExpression InactiveMathExpression HeldMathFormula InactiveMathFormula ComputedWolframLanguageSymbol
Related Guides
History
Introduced in 2014 (10.0)