556 in case (head_of t, head_of u) of |
556 in case (head_of t, head_of u) of |
557 (Var(v,T), Var(w,U)) => (*Check for identical variables...*) |
557 (Var(v,T), Var(w,U)) => (*Check for identical variables...*) |
558 if Term.eq_ix (v, w) then (*...occur check would falsely return true!*) |
558 if Term.eq_ix (v, w) then (*...occur check would falsely return true!*) |
559 if T=U then (env, add_tpair (rbinder, (t,u), tpairs)) |
559 if T=U then (env, add_tpair (rbinder, (t,u), tpairs)) |
560 else raise TERM ("add_ffpair: Var name confusion", [t,u]) |
560 else raise TERM ("add_ffpair: Var name confusion", [t,u]) |
561 else if TermOrd.indexname_ord (v, w) = LESS then (*prefer to update the LARGER variable*) |
561 else if Term_Ord.indexname_ord (v, w) = LESS then (*prefer to update the LARGER variable*) |
562 clean_ffpair thy ((rbinder, u, t), (env,tpairs)) |
562 clean_ffpair thy ((rbinder, u, t), (env,tpairs)) |
563 else clean_ffpair thy ((rbinder, t, u), (env,tpairs)) |
563 else clean_ffpair thy ((rbinder, t, u), (env,tpairs)) |
564 | _ => raise TERM ("add_ffpair: Vars expected", [t,u]) |
564 | _ => raise TERM ("add_ffpair: Vars expected", [t,u]) |
565 end; |
565 end; |
566 |
566 |