A Theory of Similarity and Uncertainty