variable-substitution (math concept)
See also
python declaration class | python inclusion class | python sample
Definition
variable-substitution is the inference-rule:
Where:
\(\boldsymbol{P}\) is a formula-statement that includes \(n\) variables, where \(n\) is a natural-number
\(\boldsymbol{\Phi}\) is a finite tuple of \(n\) well-formed formulae,
\(\boldsymbol{P}\) is a modified version of \(\boldsymbol{P}\) whose variables have been substituted with the corresponding formulae in \(\boldsymbol{\Phi}\)
Multiple algorithms are possible to implement variable-substitution. Punctilious uses the following algorithm:
Parse \(\boldsymbol{P}\) top-down first, left-right second
Whenever a variable is newly encountered during parsing, assign it a sequential number
Following order, pair every variable in that sequence of variables with formulae in \(\boldsymbol{P}\)
Parse \(\boldsymbol{P}\) and substitute every occurrence of variables with its paired formula
In straightforward language, by substituting the variables in \(\boldsymbol{P}\) with the formulae in \(\boldsymbol{P}\), a new statement \(P'\) follows.