示例#1
0
        public int GetMaxConsumption()
        {
            int nCnt = 0;

            List <CatKind> list = mCons.GetKinds();

            for (int i = list.Count - 1; i >= 0; --i)
            {
                CatKind k = list[i];
                if (k is CatStackVar)
                {
                    if ((i == 0) && k.Equals(mProd.GetBottom()))
                    {
                        return(nCnt);
                    }
                    else
                    {
                        return(-1);
                    }
                }
                nCnt++;
            }

            return(nCnt);
        }
示例#2
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()));
        }