equal
deleted
inserted
replaced
174 exception ASSIGN; (*Raised if not an assignment*) |
174 exception ASSIGN; (*Raised if not an assignment*) |
175 |
175 |
176 |
176 |
177 fun unify_types thy (T,U, env as Envir.Envir{asol,iTs,maxidx}) = |
177 fun unify_types thy (T,U, env as Envir.Envir{asol,iTs,maxidx}) = |
178 if T=U then env |
178 if T=U then env |
179 else let val (iTs',maxidx') = Type.unify (Sign.tsig_of thy) (iTs, maxidx) (U, T) |
179 else let val (iTs',maxidx') = Sign.typ_unify thy (U, T) (iTs, maxidx) |
180 in Envir.Envir{asol=asol,maxidx=maxidx',iTs=iTs'} end |
180 in Envir.Envir{asol=asol,maxidx=maxidx',iTs=iTs'} end |
181 handle Type.TUNIFY => raise CANTUNIFY; |
181 handle Type.TUNIFY => raise CANTUNIFY; |
182 |
182 |
183 fun test_unify_types thy (args as (T,U,_)) = |
183 fun test_unify_types thy (args as (T,U,_)) = |
184 let val str_of = Sign.string_of_typ thy; |
184 let val str_of = Sign.string_of_typ thy; |