| Name | Expression | Precondition | Semantics | Postcondition |
| Character assignment | X::assign(c1, c2) | | Performs the assignment c1 = c2 | X::eq(c1, c2) is true. |
| Character equality | X::eq(c1, c2) | | Returns true if and only if c1 and c2 are equal. | |
| Character comparison | X::lt(c1, c2) | | Returns true if and only if c1 is less than c2 . Note that for any two value values c1 and c2 , exactly one of X::lt(c1, c2), X::lt(c2, c1) , and X::eq(c1, c2) should be true. | |
| Range comparison | X::compare(p1, p2, n) | [p1, p1+n) and [p2, p2+n) are valid ranges. | Generalization of strncmp. Returns 0 if every element in [p1, p1+n) is equal to the corresponding element in [p2, p2+n), a negative value if there exists an element in [p1, p1+n) less than the corresponding element in [p2, p2+n) and all previous |