Similar Items: A Logical Foundation for Environment Classifiers