"MathFormula" (Interpreter Type)
Details
- "MathFormula" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "MathFormula" requires connectivity to the Wolfram Cloud.
Allowed Forms
- Any free-form mathematical equality or inequality:
-
3 x^2 - x + 2 == 0 polynomial equationscos(y) = sqrt(3)/2 equations involving any mathematical function2^45 > 15! inequalities
Restriction Specifications
-
Restricted ["MathFormula" ,symbols] a formula involving only the given symbols (All , Automatic , or an explicit list)Restricted ["MathFormula" ,symbols,contexts] a formula involving only the given symbols or symbols in the given contexts (All , Automatic , or an explicit list)Restricted ["MathFormula" ,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
- "MathFormula" yields a representation of the formula in the Wolfram Language, usually with an Equal , Greater , GreaterEqual , Less , or LessEqual head. When the formula evaluates, a Boolean result can be returned.
Examples
Basic Examples (7)
Interpret mathematical formulas:
The resulting formula evaluates, which may lead to a Boolean result:
Restrict to a list of choices:
By default, all symbols are allowed. Restrict to a list of allowed symbols:
By default, new symbols are created in $Context , but a custom context can be specified:
Specify contexts for the allowed and output symbols:
Prevent the creation of any new symbol:
See Also
Interpreter SemanticImport Restricted Failure Equal Greater GreaterEqual Less LessEqual
Interpreter Types: HeldMathFormula InactiveMathFormula MathExpression Expression WolframLanguageSymbol HeldMathExpression InactiveMathExpression HeldExpression InactiveExpression SemanticExpression HeldSemanticExpression InactiveSemanticExpression ComputedWolframLanguageSymbol