Sather Home
        Page

Section 7.2.2:
BOOL

immutable class BOOL

See also the Required Library class BOOL which provides a full range of logical operators as well as text and other conversion features in addition to those defined for this pervasive class.

Formal Types

types

SAME = BOOL ;

BOOL = bool

not

This feature provides the standard Boolean inversion operation.

not : SAME
Formal Signature

The name of the formal operation corresponding to 'not' has been modified since the word 'not' is a keyword in vdm-sl.

not_v(self : SAME) res : SAME
Post-condition
post res = not self

This feature returns the logical complement of self.


and

This feature provides the Boolean conjunction operation.

and (
other : SAME
) : SAME
Formal Signature

The name of the formal operation corresponding to 'and' has been modified since the word 'and' is a keyword in vdm-sl.

and_v(self : SAME, other : SAME) res : SAME
Post-condition
res = (self
and other)

This routine returns true if and only if self and other are both true, otherwise false.


or

This feature provides the operation of logical disjunction.

or (
other : SAME
) : SAME
Formal Signature

The name of the formal operation corresponding to 'or' has been modified since the word 'or' is a keyword in vdm-sl.

or_v(self : SAME, other : SAME) res : SAME
Post-condition
post res = (self
or other)

This routine returns true if and only if either self or other or both are true, otherwise false.


is_eq

This feature provides the logical equality operation for Boolean values. It may be used in infix logical expressions.

is_eq (
other : SAME
) : SAME
Formal Signature
is_eq(self : SAME, other : SAME) res : SAME
Post-condition
post res = (self
= other)

This routine returns true if and only if both self and other have the same value, otherwise false.


Language Index Library Index Section 7 Index
Comments or enquiries should be made to Keith Hopper.
Page last modified: Thursday, 18 May 2000.
Produced with Amaya