Vanishing theorems and string backgrounds