コード例 #1
0
 public override Expr VisitOldExpr(OldExpr node) {
   Set freeVars = new Set();
   node.Expr.ComputeFreeVariables(freeVars);
   foreach (var v in freeVars) {
     // Note, "v" is either a Variable or a TypeVariable
     if (v is Variable) {
       FreeOldVars.Add((Variable)v);
     }
   }
   return node;  // don't visit subexpressions, since ComputeFreeVariables has already gone through those
 }
コード例 #2
0
ファイル: Set.cs プロジェクト: luckysunda/hice-dt
        public static GSet <T> /*!*/ Filter(GSet <T> /*!*/ a, Func <T, bool> filter)
        {
            Contract.Requires(filter != null);
            Contract.Requires(a != null);
            Contract.Ensures(Contract.Result <GSet <T> >() != null);
            GSet <T> inter = new GSet <T>();

            foreach (T elem in a)
            {
                Contract.Assert(elem != null);
                if (filter(elem))
                {
                    inter.Add(elem);
                }
            }
            return(inter);
        }