Generic notations and theories
Polymorphism != overloading.
Example: the == computable equality
Polymorphism
Overloading : looking inside types
Object oriented flavor
Overloading may fail, polymorphism never
Type inference
We call eqType an interface. With some approximation
eqType is defined as follows:
Module Equality.
Structure type : Type := Pack {
sort : Type;
op : sort -> sort -> bool;
axiom : ∀x y, reflect (x = y) (op x y)
}.
End Equality
Interfaces
Mathematical Components defines a hierarchy
of interfaces. They group notations and
theorems.
Let's use the theory of eqType
Interfaces do apply to registered, concrete examples
such as bool or nat. They can also apply to variables,
as long as their type is rich
(eqType is richer than Type).
Theories over an interface
Interfaces can be used to parametrize an
entire theory
Others interfaces