Generalized Consistency and Preferences Representation by Pairwise Comparisons