The graph below shows the results of testing type unifiers.
Read the nodes as follows:
1. Types'a
and'a
can be unified, but your unifier failed with the messageCannot unify 'a and 'a
.
2a. Unifyingint
and'a
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
3a. Unifying'a
and('a)
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
3b. Types'a
and('a)
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
4a. Unifying'a
and('b 'a)
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
4b. Types'a
and('b 'a)
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
5. Types((int))
and((int))
can be unified, but your unifier failed with the messageCannot unify int and int
.
6a. Types(list 'a)
and(tuple 'b)
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
7a. Unifying(list 'a)
and(list 'a 'b)
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
8a. Unifying(((list)) (('a 'b)))
and('c 'b)
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
8b. Types(((list)) (('a 'b)))
and('c 'b)
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
9. Types(list ('b 'a))
and(list ('a 'b))
can be unified, but your unifier failed with the messageCannot unify 'a 'b and 'b 'a
.
9a. Given input types tau1 =(list ('b 'a))
and tau2 =(list ('a 'b))
, your 'unify(tau1, tau2)' function returned a substitution theta that is not a unifier. The two types theta tau1 and theta tau2 should be equal, but theta tau1 =(list ('b 'a))
, and theta tau2 =(list ('a 'b))
are different.
10a. Types(tuple 'a 'a)
and(tuple int bool)
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
11a. Unifying((ref) (('a 'a array 'b)))
and(('b) ('b))
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
11b. Types((ref) (('a 'a array 'b)))
and(('b) ('b))
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
12a. Unifying(((list)) ((bool list) (array) bool))
and('a ((bool list) 'b 'a))
raised an exception other than TypeError, which is the only exception that 'unify' may raise.
12b. Types(((list)) ((bool list) (array) bool))
and('a ((bool list) 'b 'a))
are not unifiable, but instead of raising the 'TypeError' exception, your 'unify' function returned a substitution.
13. Types('a (('b 'c 'c array) ('d 'd ref bool 'd)))
and('c (('b 'd 'c array) ('d 'b ref bool 'a)))
can be unified, but your unifier failed.
13a. Given input types tau1 =('a (('b 'c 'c array) ('d 'd ref bool 'd)))
and tau2 =('c (('b 'd 'c array) ('d 'b ref bool 'a)))
, your 'unify(tau1, tau2)' function returned a substitution theta that is not a unifier.