Ejemplo n.º 1
0
        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()));
        }
Ejemplo n.º 2
0
        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));
        }