Fresh variable
In formal reasoning, in particular in mathematical logic, computer algebra, and automated theorem proving, a fresh variable is a variable that did not occur in the context considered so far. The concept is often used without explanation. Fresh variables may be used to replace other variables, to eliminate variable shadowing or capture. For instance, in alpha-conversion, the processing of terms in the lambda calculus into equivalent terms with renamed variables, replacing variables with fresh variables can be helpful as a way to avoid accidentally capturing variables that should be free. Another use for fresh variables involves the development of loop invariants in formal program verification, where it is sometimes useful to replace constants by newly introduced fresh variables.
In formal reasoning, in particular in mathematical logic, computer algebra, and automated theorem proving, a fresh variable is a variable that did not occur in the context considered so far. The concept is often used without explanation. Fresh variables may be used to replace other variables, to eliminate variable shadowing or capture. For instance, in alpha-conversion, the processing of terms in the lambda calculus into equivalent terms with renamed variables, replacing variables with fresh variables can be helpful as a way to avoid accidentally capturing variables that should be free. Another use for fresh variables involves the development of loop invariants in formal program verification, where it is sometimes useful to replace constants by newly introduced fresh variables. \operatorname{append}(\operatorname{cons}(x,y),z) \to \operatorname{cons}(x,\operatorname{append}(y,z)) and the term \operatorname{append}(\operatorname{cons}(x,\operatorname{cons}(y,\mathrm{nil})),\operatorname{cons}(3,\mathrm{nil})), attempting to find a matching substitution of the rule's left-hand side, \operatorname{append}(\operatorname{cons}(x,y),z) , within \operatorname{append}(\operatorname{cons}(x,\operatorname{cons}(y,\mathrm{nil})),\operatorname{cons}(3,\mathrm{nil})) will fail, since y cannot match \operatorname{cons}(y,\mathrm{nil}) . However, if the rule is replaced by a fresh copy \operatorname{append}(\operatorname{cons}(v_1,v_2),v_3) \to \operatorname{cons}(v_1,\operatorname{append}(v_2,v_3)) before, matching will succeed with the answer substitution \{ v_1 \mapsto x, \; v_2 \mapsto \operatorname{cons}(y,\mathrm{nil}), \; v_3 \mapsto \operatorname{cons}(3,\mathrm{nil}) \}.
References
No reference rows published for this article.
Cite this article
MLA
"Fresh variable." encyclopegia.org, 2025, https://encyclopegia.org/wiki/fresh-variable. Accessed 24 November 2026.
Chicago
"Fresh variable." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/fresh-variable.
APA
encyclopegia.org. (2025). Fresh variable. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/fresh-variable
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON