C# Transitive Closure

Many important demands of the C# language involve the type hierarchy and inheritance. For example, you need a way to determine what interfaces can be considered base interfaces to a certain interface. With the concept of transitive closure, we attempt to understand inheritance in the language.

Transitive closure (Wikipedia)

This article describes transitive closure in brief. The C# language applies transitive closure.

Read the specification

The most important document about the C# language is the C# language specification. In the specification, let's examine the description of interfaces and base interfaces. The set of base interfaces contains "the explicit base interfaces and their base interfaces." In other words, an interface has the base interface of its immediate ancestor and all of its further ancestors in the hierarchy. (Section 13.1.3 Base Interfaces.)

The C# Programming Language: Specification

Transitive closure

The C# programming language

This property of interfaces in the C# language can also be described with the concept of transitive closure. With transitive closure, you could start at the most derived interface and then "close" it upon all its more derived descendants at once. Then, each descendant can do the same: this satisfies the "complete" part of transitive closure.

Summary

With graph theory and transitive closure, we can understand the type hierarchy in object-oriented languages. In the C# language, then, we can know exactly what interfaces we can use as a base interface by traversing the chain of ancestor nodes.

Wikipedia reference Interface Types
.NET