Closed Substitutions.
The map Sub[A,x,i] replace i for x in A. We assume that i is some closed term of the language (hence no renaming of free variables in i is required in order to avoid ``capture''). The only non-trivial clauses concern quantifiers: we do not replace x with i in Ex["x",A], Un["x",A], because x is bound in this case.
Substitution replaces substrings "x" by substrings i in the atomic subformulas of A. Substitution has a bug: if there are variables "x","x0", then Sub["x0=3","x","a"] is "a0=3". Avoid a variable name included, or including, another variable name.
In[103]:=
An example of substitution. Remark that when the variable we substitue upon is binded, the substitution does not take place.
In[111]:=
In[112]:=
Out[112]=
Out[113]=
Out[114]=
Created by Mathematica (October 17, 2006)