Nationalism and Its Logical Foundations