There is a connection between type-checking and logic.
E.g. The type of the identity function,
id:'t->'t, can be represented in predicate logic/ Prolog as
arrow(T,T).
It can be instantiated to
int->int (arrow(int,int)), say,
but not to
int->bool (arrow(int,bool)), say.
E.g. map : ('a->'b)->'a list->'b list,
map's type can be represented as
arrow(arrow(A,B), arrow(list(A), list(B))).
If this is matched against
arrow(arrow(char,int), arrow(list(char), T))
we not only discover that it does match but also that
A = char,
B = int, and
T = list(int).
7/2OO5,
Computer Science and Software Engineering,
Monash University, Victoria 3800,
Australia.