Reputation: 10429
I am doing a scala course at the moment. There is some discussion regarding the substitution model. It states:
def f(x1,...,xn) = B; ... f(v1,..., vn)
then
def f(x1,...,xn) = B; ... [v1/x1,...,vn/xn]B
Here, [v1/x1,...,vn/xn]B means:
The expression B in which all occurrences of xi have been replaced
by vi.
[v1/x1,...,vn/xn] is called a substitution
I have two questions here:
Is there any big concept here? To me it is just saying plug the values in
in a fancy way.
The notation being used for the substitution [v1/x1,...,vn/xn]
is this used anywhere else?
Upvotes: 4
Views: 881
Reputation: 56
You're right, it does essentially say "plug the values in" in a fancy way. It's still a good idea to have a formal and unambiguous notation for it, and in fact this is a standard notation in theoretical computer science (and not something the lecturer of your course made up).
In particular, "plug the values in" becomes more complicated in situation where you have to be worried about variables being bound that should be free and the other way round. If you are interested in details, grab a textbook with a good introduction of lambda calculus.
Upvotes: 4