Generalized Compactification In Heterotic String Theory