Lambda term can be:
- variable
- lambda abstraction (for example
\x.t) - application. If
tandsare lambda terms, thentsis an application.
So, application with abstraction in the left part (for example (\x.t)a) looks good. It looks like function calling. But what does application mean when left part is a variable or other application? What does mean ab, ((\x.x)a)b or a(\x.x) if a and b are variables?
((\x.x)b)cis a function application. Here It appliesbtoc.a(\x.y)is a function application, applying the functionato its sole argument, which happens to be a function, namely the function that returnsy(a free variable).One of the featues of the lamdba calculus is the ease in which functions can be applied to functions and functions can take other functions as arguments. Your two examples show both cases nicely.
EDIT There are (at least) two versions of the lambda calculus: the untyped and the typed. In the untyped calculus, which you are using here, anything can be applied to anything. In the typed calculus there exist base types which are not functions, such as the type of propositions and the type of “individuals.” So you would only be able to write
abif the type ofawere a function type mapping the type ofbto something.