Similar Items: Logic and Computation