public virtual CatFxnType AddImplicitRhoVariables() { CatTypeVector cons = AddImplicitRhoVariables(GetCons()); CatTypeVector prod = AddImplicitRhoVariables(GetProd()); if (!(cons.GetBottom() is CatStackVar)) { CatStackVar rho = CatStackVar.CreateUnique(); cons.PushKindBottom(rho); prod.PushKindBottom(rho); } return(new CatFxnType(cons, prod, HasSideEffects())); }
public static CatFxnType RenameFreeVars(CatFxnType left, CatFxnType right, CatFxnType ft) { CatTypeVarList vars = ft.GetAllVars(); foreach (string s in vars.Keys) { CatKind k = vars[s]; if (IsFreeVar(k, left, right, ft)) { if (k is CatTypeVar) { vars[s] = CatTypeVar.CreateUnique(); } else { vars[s] = CatStackVar.CreateUnique(); } } } return(RenameVars(ft, vars)); }