A molecular theory for the solid–liquid interface