Shell-model calculation of the spectral function for l=0 proton states in12C