FullForm[expr]
显示 expr 的完全形式,不使用特殊句法.
FullForm
FullForm[expr]
显示 expr 的完全形式,不使用特殊句法.
更多信息和选项
- FullForm 通常使用 "PrintableASCII" 作为 $CharacterEncoding 的设置.
- 选项 NumberMarks 可以用来指定 ` 标记是否用来显示类型、精度或近似数的准确度. »
- 作为输入时,FullForm[expr] 的排版形式被解释为与 expr 一样. »
- 当输入的运算结果为 FullForm[expr] 时,FullForm 不会出现在输出中. »
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (8)
基本对象 (2)
Integer、Rational、Real 和 Complex 数:
Map[FullForm, {123, 1 / 23, 1.23, 1 + 23I}]FullForm /@ N[{10 / 3, 10 / 3I}, 20]FullForm /@ {I, π, E}FullForm /@ {"a", "α", "⊕"}FullForm["A first line
A second line"]特殊输入形式 (4)
视为 Power 表达式的不同输入:
FullForm /@ {a ^ x, a^x, Sqrt[a], Sqrt[a], a^(1/(3)), Exp[x], 1 / x, (1/x)}FullForm /@ {y'[x], ∫y[x]ⅆx, Subsuperscript[∑, k = 1, n]y[k], Subsuperscript[∏, k = 1, n]y[k], x∈Reals, x∧y∨z}FullForm[{1, 2, 3}]FullForm /@ {(| | | |
| - | - | - |
| a | b | c |
| d | e | f |), {{a, b, c}, {d, e, f}}}FullForm /@ {Subscript[x, a], Overscript[x, a], Underscript[x, a]}FullForm /@ {Subscript[x, - ], Overscript[x, _], Underscript[x, _]}在这个上标例子中,不仅仅解释为 Power:
FullForm /@ {x^a, Subsuperscript[x, b, a], x^†}特殊输出形式 (2)
Series[Sin[x], {x, 0, 3}]FullForm[%]i = Interpolation[{1, 2, 3, 1}]s = SparseArray[{{1, 2} -> 1}, {5, 5}]在隐含的 FullForm中,省略部分是可见的:
FullForm[i]FullForm[s]选项 (2)
NumberMarks (2)
FullForm[4.567]FullForm[N[10 / 3, 20]]FullForm[4.567, NumberMarks -> False]FullForm[N[10 / 3, 20], NumberMarks -> False]expr = N[10, 4]Sin[.25x]FullForm[expr]FullForm[expr, NumberMarks -> False]应用 (4)
FullForm 将显示运算符的优先级:
FullForm[a b + c]FullForm[a (b + c)]查看一个 TraditionalForm 输出的内在解释:
TraditionalForm[Sin[I Pi / n]]FullForm[%]{{a}, b, {{c}}}//FullForm{{a}, b, {{c}}} /. List -> newhead乘法具有头部 Times:
expr = a + b(c - d)FullForm[expr]Cases[expr, _Times, Infinity]Map[FullForm, %]属性和关系 (4)
作为输入时,FullForm[expr] 的排版形式被解释为与 expr 一样:
{FullForm[x ^ 2]}复制输出,将其粘贴到输入单元. Power[x,2] 被解释为 x2:
{Power[x, 2]}当输入的运算结果为 FullForm[expr] 时,FullForm 不会出现在输出中:
FullForm[x ^ 2]%没有特殊语法的 FullForm 有线性格式:
FullForm[1 / a + x ^ 2]作为线性输入的 InputForm 格式:
InputForm[1 / a + x ^ 2]TreeForm 图形显示一个表达式的树形结构:
FullForm[1 / (a + b)x ^ 2]TreeForm[1 / (a + b)x ^ 2]可能存在的问题 (2)
即便输出省略了上一层的 FullForm,子表达式中依然存在:
e = FullForm[x ^ 2]输出中没有 FullForm:
%但是,变量 e 含有 FullForm,可能会影响后续的计算:
FullForm[e]由于 FullForm 的存在,不能计算乘积:
x * e先对变量赋值,然后对结果应用 FullForm,使计算可以进行:
(f = x ^ 2)//FullFormx * f模式匹配是基于 FullForm:
1 / Sqrt[2] /. {Sqrt[2] -> sq2}之前的分式表示为一个单个 Power 表达式:
1 / Sqrt[2]//FullForm1 / Sqrt[2] /. Power[2, -1 / 2] -> 1 / sq2相关的工作流程
- 找出表达式的底层树结构
历史
1988年引入 (1.0) | 在以下年份被更新:2003 (5.0)
文本
Wolfram Research (1988),FullForm,Wolfram 语言函数,https://reference.wolfram.com/language/ref/FullForm.html (更新于 2003 年).
CMS
Wolfram 语言. 1988. "FullForm." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2003. https://reference.wolfram.com/language/ref/FullForm.html.
APA
Wolfram 语言. (1988). FullForm. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/FullForm.html 年
BibTeX
@misc{reference.wolfram_2026_fullform, author="Wolfram Research", title="{FullForm}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/FullForm.html}", note=[Accessed: 05-December-2026]}
BibLaTeX
@online{reference.wolfram_2026_fullform, organization={Wolfram Research}, title={FullForm}, year={2003}, url={https://reference.wolfram.com/language/ref/FullForm.html}, note=[Accessed: 05-December-2026]}