Text this: A Logical Foundation for Environment Classifiers