![]() |
Section 8.17.1.1: |
![]() |
This abstract class defines a state component which is a set of all instantiations of objects of any class sub-typing from this class in addition to the vdm model types used wherever this class name is used. Note that SAME has to be an instantiated class, not an abstract one.
NOTES | 1. See the important note about vdm state in the notes on vdm-sl usage in this specification. |
2. The vdm type Object_Type is defined solely in order to be able to specify the iterators at the end of this class definition. It is otherwise not used. |
This abstraction models the semantic notion of a character, ascribing to it all of those features which are not dependent upon any particular form of representation. One additional feature is, however, modelled - that a character is represented by one or more encodings - the class CHAR_CODE.
A character is created by this routine from the given code - which may be considered as some bit-pattern. The character, however, has all of the semantics associated with characters in human communication.
This routine creates a character from a single character code - which must not be a combining code as specified in ISO/IEC 10646-1:2000.
A character is created by this routine from the given control function name (as a code) - which may be considered as some bit-pattern. The resultant pseudo-character, however, has semantics associated with that control function in a rendering engine dependent manner. The given repertoire and encoding is needed to convert the bit-pattern of a control code into an appropriate pattern for the culture concerned. These differ principally in the number of bits needed.
create | ( |
function : CONTROL_CODES, | |
lib : LIBCHARS | |
) : SAME |
Since this is a creation routine with a larger range than the domain of control codes, the pre-condition is vacuously true.
This routine creates a 'character' from the given control function name and repertoire and encoding. The result is a pseudo-character which may be interpreted in some rendering engine specific manner.
Providing that self consists of only a single encoding this routine returns the corresponding single code character.
This routine returns the single coding character corresponding to self.
This is the first of two features which convert self into a character code - providing that it consists of only one encoding.
This routine returns the encoding corresponding to the single element of self, using the given encoding and repertoire.
This version of the conversion feature for turning self into a character code makes use of the default execution environment encoding and repertoire.
This routine returns the encoding corresponding to the single element of self, using the default execution environment encoding and repertoire.
This is the first of two features which convert self into a rune (which may have multiple encodings).
Since the range of the result is at least as large as the domain of self, the pre-condition is vacuously true.
This routine returns the encoding corresponding to the single element of self, using the given encoding and repertoire.
This version of the conversion feature for turning self into a rune makes use of the default execution environment encoding and repertoire.
Since the range of the result is at least as large as the domain of self, the pre-condition is vacuously true.
This routine returns the rune corresponding to the single element of self, using the default execution environment encoding and repertoire.
This feature returns true if and only if self is a letter as defined in the given encoding and repertoire.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of letters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a letter in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the values of self is a member of the domain of letters as defined in the default execution environment.
This feature returns true if and only if self is an upper case letter as defined in the given encoding and repertoire.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of upper case letters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is an upper case letter in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of upper case letters as defined in the default execution environment.
This feature returns true if and only if self is a lower case letter as defined in the given encoding and repertoire.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of lower case letters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a lower case letter in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of lower case letters as defined in the default execution environment.
This feature returns true if and only if self is an octal digit as defined in the given encoding and repertoire.
is_octal_digit | ( |
lib : LIBCHARS | |
) : BOOL |
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of octal digit characters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is an octal digit in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of octal digit characters as defined in the default execution environment.
This feature returns true if and only if self is a decimal digit as defined in the given encoding and repertoire.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of decimal digit characters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a decimal digit in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of decimal digit characters as defined in the default execution environment.
This feature returns true if and only if self is a hexa-decimal digit as defined in the given encoding and repertoire.
is_hex_digit | ( |
lib : LIBCHARS | |
) : BOOL |
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of hexadecimal digit characters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a hexadecimal digit in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of hexadecimal digit characters as defined in the default execution environment.
This feature returns true if and only if self is a number character as defined in the given encoding and repertoire. Note, particularly, that while this domain will usually include decimal digits that it is not restricted to characters which may be converted directly to numbers and used in arithmetic operations.
is_numeric | ( |
lib : LIBCHARS | |
) : BOOL |
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of number characters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a number character in the default execution environment. Note, particularly that characters which belong to this group will almost certainly include, but by no means be restricted to those which may take part in arithmetic operations.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of number characters as defined in the default execution environment.
This feature returns true if and only if self is an alpha-numeric character as defined in the given encoding and repertoire. Note, particularly, that while this domain will usually include characters of the classes alpha and digits, it may not be assumed that such characters are the only members of this class domain.
is_alphanum | ( |
lib : LIBCHARS | |
) : BOOL |
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of alpha-numeric characters as specified for the given encoding and repertoire.
This version of the predicate returns true if self is an alpha-numeric character in the default execution environment. Note, particularly that characters which belong to this group will almost certainly include, but by no means be restricted to, characters belonging to the classes alpha and digit.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of alpha-numeric characters as defined in the default execution environment.
This feature returns true if and only if self is a white space character as defined in the given encoding and repertoire. Note, particularly, that this class may include control function name codes.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of space characters (characters which, when rendered, occupy space in the image but have no visible glyph) as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a white space character which has no visible mark in the default execution environment. Note, particularly that characters which belong to this group may include control function name codes.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of space characters (characters which occupy space when rendered but do not have a visible glyph) as defined in the default execution environment.
This feature returns true if and only if self is a character which, when rendered is visible as defined in the given encoding and repertoire.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the value domain of characters which, when rendered, have a visible image as specified for the given encoding and repertoire.
This version of the predicate returns true if self is a character which has a visible mark when rendered in the default execution environment.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of characters which, when rendered, have a visible glyph as defined in the default execution environment.
This feature returns true if and only if self is a character which is defined as a punctuation mark in the given encoding and repertoire. Note that, while this will not includes characters detected as being letter, numbers and whitespace using the predicates above, it will not necessarily include all other visible characters.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the domain of characters which are defined as punctuation marks for the given encoding and repertoire.
This version of the predicate returns true if self is a character which is defined as a punctuation mark in the default execution environment. Note that while this will not include letters, numbers and spcae as detected using the above predicates, there may be other visible characters which are not in this domain.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is a member of the domain of characters which are defined as punctuation marks in the default execution environment.
This routine returns true if self is the code name of a control function in the given encoding and repertoire. Note that all internationally standardised encodings have the identical code names as defined by ISO 636. (see also the library class CONTROL_CODES).
is_control | ( |
lib : LIBCHARS | |
) : BOOL |
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This predicate returns true if and only if self is a member of the domain of characters which are defined as punctuation marks for the given encoding and repertoire.
This version of the predicate returns true if self is the code name of a control function in the default encoding and repertoire. Note that all internationally standardised encodings have the identical code names as defined by ISO 636.
Since this feature is a predicate, the pre-condition is vacuously true.
Since this feature is a predicate, the post-condition also is vacuously true.
This routine returns true if and only if the value of self is the code name of a control function in the default execution environment.
This routine returns the count of encodings in self. As given in ISO/IEC 10646, this will not exceed six.
Since the range of the result is greater than the range of components, the pre-condition is vacuously true.
This routine returns the count of the number of encodings in self.
This routine returns the upper case character corresponding to self if this exists, otherwise self. Note that there is not necessarily an upper case letter corresponding to every lower case letter (for example in the ISO 8859-1 encoding the letter "ß" is lower case but has no single character upper case equivalent).
Since this feature is a predicate, the pre-condition is vacuously true.
This routine returns the upper case character corresponding to self if it exists, otherwise self.
This routine returns the upper case character corresponding to the given lower case letter if this exists, otherwise self.
upper | : SAME |
Since the domain of self and of other are identical, the pre-condition is vacuously true.
This routine returns the upper case character corresponding to self in the default encoding and repertoire, provided that self is a lower case letter - otherwise self is returned.
This routine returns the lower case character corresponding to self if this exists, otherwise self. Note that there is not necessarily a lower case letter corresponding to every upper case letter.
Since this feature is a predicate, the pre-condition is vacuously true.
This routine returns the lower case character corresponding to self if it exists, otherwise self.
This routine returns the lower case character corresponding to the given upper case letter if this exists, otherwise self.
lower | : SAME |
Since the domain of self and of other are identical, the pre-condition is vacuously true.
This routine returns the lower case character corresponding to self in the default encoding and repertoire, provided that self is an upper case letter and the equivalent character is mapped - otherwise self is returned.
This routine returns the numeric value represented by self as an octal digit in the given repertoire and encoding.
octal_digit_value | ( |
lib : LIBCHARS | |
) : SAME |
This routine returns the numeric value corresponding to self, provided that it is an octal digit, otherwise CARD::maxval.
This routine returns the numeric value represented by self, if self is an octal digit.
This routine returns the numeric value which is represented by the octal digit character self if this exists, otherwise CARD::maxval.
This routine returns the numeric value represented by self as a decimal digit in the given repertoire and encoding.
digit_value | ( |
lib : LIBCHARS | |
) : SAME |
This routine returns the numeric value corresponding to self, provided that it is a decimal digit, otherwise CARD::maxval.
This routine returns the numeric value represented by self, if self is a decimal digit.
This routine returns the decimal numeric value of the digit which is represented by the character self if this exists, otherwise CARD::maxval.
This routine returns the numeric value represented by self as a hexa-decimal digit in the given repertoire and encoding.
hex_digit_value | ( |
lib : LIBCHARS | |
) : SAME |
This routine returns the numeric value corresponding to self, provided that it is a hexa-decimal digit, otherwise CARD::maxval.
This routine returns the numeric value represented by self, if self is a hexa-decimal digit.
This routine returns the hexa-decimal numeric value of the digit which is represented by the character self if this exists, otherwise CARD::maxval.
This iter yields successive encodings of self in the given encoding and repertoire.
Note that the formal name of the iter has been changed to replace the exclamation mark iter symbol to a name acceptable to vdm tools.
This post-condition makes use of the history concept from vdm++ (see the vdm dialect notes).
For quit actions see the specificatiion of the quit statement.
This iter yields successive encodings of self in the given encoding and repertoire.
This iter yields successive encodings of self in the default execution environment encoding and repertoire.
Note that the formal name of the iter has been changed to replace the exclamation mark iter symbol to a name acceptable to vdm tools.
This post-condition makes use of the history concept from vdm++ (see the vdm dialect notes).
For quit actions see the specificatiion of the quit statement.
This iter yields successive encodings of self in the default execution environment encoding and repertoire.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Text Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Thursday, 23 November 2000. |
![]() |