Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
STANDART PASCAL ISO 1990.doc
Скачиваний:
5
Добавлен:
17.11.2019
Размер:
251.66 Кб
Скачать

6.7.2.3 Boolean operators

Operands and results for Boolean operations shall be of Boolean-type. The Boolean operators or, and, and not shall denote respectively the logical operations of disjunction, conjunction, and negation.

Boolean-expression = expression .

A Boolean-expression shall be an expression that denotes a value of Boolean-type.

6.7.2.4 Set operators

The types of operands and results for set operations shall be as shown in table 5.

Where x denotes a value of the ordinal-type T and u and v are operands of a canonical-set-of-T-type, it shall be true for all x that

--- x is a member of the value u+v if and only if it is a member of the value of u or a member of the value of v;

--- x is a member of the value u-v if and only if it is a member of the value of u and not a member of the value of v;

--- x is a member of the value u*v if and only if it is a member of the value of u and a member of the value of v.

6.7.2.5 Relational operators

The types of operands and results for relational operations shall be as shown in table 6.

The operands of =, <>, <, >, >=, and <= shall be of compatible types, or they shall be of the same unpacked-canonical-set-of-T-type or packed-canonical-set-of-T-type, or one operand shall be of real-type and the other shall be of integer-type.

Table 6 --- Relational operations

OperatorType of operandsType of result

= <>Any simple-type, pointer-type, string-type, Boolean-type

unpacked-canonical-set-of-T-type

or packed-canonical-set-of-T-type

< >Any simple-type or string-type Boolean-type

<= >=Any simple-type, string-type, Boolean-type

unpacked-canonical-set-of-T-type

or packed-canonical-set-of-T-type

in Left operand: any ordinal-type T Boolean-type

right operand: the unpacked-canonical-set-of-T-type

or packed-canonical-set-of-T-type

The operators =, <>, <, and > shall stand for equal to, not equal to, less than, and greater than respectively.

Except when applied to sets, the operators <= and >= shall stand for less than or equal to and greater than or equal to respectively. Where u and v denote operands of a set-type, u <= v shall denote the inclusion of u in v and u >= v shall denote the inclusion of v in u.

NOTE --- Since the Boolean-type is an ordinal-type with false less than true, then if p and q are operands of Boolean-type, p = q denotes their equivalence and p <= q means p implies q.

When the relational-operators = , <> , < , > , <=, and >= are used to compare operands of compatible string-types (see 6.4.3.2), they shall denote the lexicographic relations defined below. This lexicographic ordering shall impose a total ordering on values of a string-type.

If s1 and s2 are two values of compatible string-types and n denotes the number of components of the compatible string-types, then

s1 = s2 iff for all i in [1..n]: s1[i] = s2[i]

s1 < s2 iff there exists a p in [1..n]: (for all i in [1..p-1]: s1[i] = s2[i]) and s1[p] < s2[p]

The definitions of operations >, <>>, <=, and >= are derived from the definitions of = and <.

The operator in shall yield the value true if the value of the operand of ordinal-type is a member of the value of the set-type; otherwise, it shall yield the value false.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]