7.1 Relation

Examples of relations in programming include comparison operators and functions. For example, the $ \le$ operator is a relation. To relate the mathematical definition of relations to the operator <=: $ \forall i, j \in \mathbb{I}: (i, j) \in L \Leftrightarrow (i \le j)$ .

For example, the tuple $ (2,2)$ is in $ L$ , therefore 2 <= 2 is true. The tuple $ (3,2)$ is not in $ L$ , therefore 3 <= 2 is false.

Generally speaking, in programming, we form a tuple, then ask whether the tuple is in a relation or not.

The application of relations, other than comparison operators, is somewhat diverse. For example, in Component Object Model (COM) programming, an interface needs to be ``equivalent'' with respect to the relation QueryInterface(). This means an interface needs to be reflexive, symmetric and transitive with respect to the relation QueryInterface(). COM programming predates Microsoft .net, and forms the framework of server-client programming that goes well beyond the flexibilities of object-oriented programming.



Copyright © 2006-10-28 by Tak Auyeung