As mentioned above the stack of layers is enclosed in between two semi-infinite 'halfspaces'. Every correctly defined layer stack must have exactly two halfspace layers, namely the top and the bottom halfspace. The only thing to be done with halfspace layers is to assign a material to it.