There is a connection between type-checking and logic.
E.g. The SML type of the identity function,
id:'t->'t], can be represented in Prolog (predicate logic) as
arrow(T,T).
It can be instantiated to
int->int, that is arrow(int,int), say,
but not to
int->bool, that is 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).
Semester-2, 2006,
B. Computer Science,
B. Software Engineering,
B. Sci. (CSci), and
double degrees,
Monash University,Australia, 3800.