New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[basic.type.qualifier] The ordering defined on cv-qualifiers is not a partial ordering #4908
Comments
I don't think the problem as you stated is correct.
This is not true. A partial order need not be defined on every pair of elements. The partial order axioms only apply to those orderings that are defined. For example, "if a < b and b < c, then a < c" -- but it is not required that a and b are comparable to begin with. See also https://en.wikipedia.org/wiki/Partially_ordered_set. (Consider the canonical example of the "subset" relation on the elements of the power set of any given set.) |
Hello tkoeppe, A relation R over a set S may be defined as a subset of S × S, and therefore must be either true or false for any two elements in S, because the statement (x,y) ∈ R is either true or false. |
I'm not sure if there is a contradiction here. As you say, R is a subset (and usually a strict one!) of S × S, so some elements may be related, but others may not. X is more cv-qualfied than Y if (X, Y) is a relation, otherwise it is not so. The table you quote describes precisely that set R of relations, everything not in the table is not a relation. |
Hello tkoeppe,
Nevertheless, you remind me of that we may treat all relations not defined on the table as if they are false (e.g. const < volatile is not defined on the table, so const < volatile is false). And this is a valid interpretation. Anyway, thank you for your review. :) |
Yes, and again I don't think there's any problem or contradiction here. For example, you may say "const < volatile is false", if you like, that's accurate, and consistent with what we say in the standard (where "<" means "more cv-qualified"), or in other words, "it is not the case that const is more cv-qualified than volatile". Your original complaint that an ordering is not defined for all pairs is merely a restatement of the observation that there exist x, y such that (x, y) ∉ R. Or in yet other words, in order to state a partial order, it suffices to state R, and it is not necessary to also state the complement of R. |
The fourth paragraph in [basic.type.qualifier] says that
However, the ordering defined in table
basic.type.qualifier.rel
is not a partial ordering, since that there exists two cv-qualifiers (namely, const and volatile) for which the ordering is not defined.I guess it intends to mean that the ordering is partially defined on the cv-qualifiers. But the term partially ordering is not defined this way. The definition of a partially ordered set requires that the ordering is defined on every two elements of the set (i.e. the ordering relation is either true or false between any two elements).
I don't know if this issue seems to be overcorrect... I noticed the phrase "partial ordering" because I recently learned concepts about ordered sets. I apologize if the issue is really overcorrect.
The text was updated successfully, but these errors were encountered: