An S-expression consists of a function followed by zero or more arguments. Each argument is in turn also an S-expression. A function in an expression is called a node. Functions with no arguments, such as numeric constants, are called terminals. All functions return some value.
Functions can also perform actions, otherwise known as side effects.
Achieving Closure To do GP, you chop a piece off one program and stick it together with a piece of another program, on the off chance that something good may result. With S-expressions, though, you can rig the game so that you have a much higher probability of success. You design your functions so that they all return the same argument type, usually a floating-point number, and they all accept arguments of this type. This situation is called clos ure. Now you can use any expression as an argument for any other expression.