src/Pure/unify.ML
changeset 16934 9ef19e3c7fdd
parent 16664 7b2e29dcd349
child 17344 8b2f56aff711
equal deleted inserted replaced
16933:91ded127f5f7 16934:9ef19e3c7fdd
   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;