Intensional vs. Extensional
Understanding the difference between intensional and extensional statements is incredibly helpful, as it comes up frequently in building software systems, especially when you’re building an API or a DSL.
Some informal definitions:
- Intensional = quantified across a universe, as in “all the red triangles”.
- Extensional = enumerated instances, as in “triangles A, B, and C”.
A more thorough discussion is found in Amnon Eden and Rick Kazman, Architecture, design, implementation, ICSE 2003.
Traditionally, intensional specifications define a concept via a list of constraints. For example, mathematical concepts are usually defined intensionally. For instance, “A prime number is a number that divides only by itself and by the number 1.”. In contrast, the North Atlantic Treaty defines the set of NATO members extensionally, namely, by itemizing its members: United States, United Kingdom, Norway, and so forth.
They caveat that their formal definition “diverges slightly” from the philosophical concept. Section 3 of the paper gives a careful formal definition.