Implementation of substitutions using finite maps.