예제 #1
0
        GuardedExp MkGuardedExp(object pat, object where, object given, object to = null)
        {
            Pattern     p  = (Pattern)pat;
            FExp        w  = (where == null ? BoolValue.True : (FExp) where);
            List <FExp> g  = (given == null ? new List <FExp>() : new List <FExp>((Cons <FExp>)given));
            FExp        t  = to as FExp;
            GuardedExp  ge = new GuardedExp(p, w, g, t);

            return(ge);
        }
예제 #2
0
        TreeDef MkTreeDef(object acc, object alph, object arg)
        {
            FastToken accToken  = (FastToken)acc;
            FastToken alphToken = (FastToken)alph;

            if (arg is object[])
            {
                BuiltinTransExp tran = (BuiltinTransExp)(((object[])arg)[0]);
                FExp            tree = (FExp)(((object[])arg)[1]);
                return(new TreeAppDef(accToken, alphToken, tran, tree));
            }
            else if (arg is BuiltinLangExp)
            {
                BuiltinLangExp lang = (BuiltinLangExp)arg;
                return(new TreeWitnessDef(accToken, alphToken, lang));
            }
            else
            {
                FExp expr = (FExp)arg;
                return(new TreeExpDef(accToken, alphToken, expr));
            }
        }