Пример #1
0
 protected override void ResolveTriggers(ResolutionContext rc)
 {
     //Contract.Requires(rc != null);
     for (Trigger tr = this.Triggers; tr != null; tr = tr.Next)
     {
         int prevErrorCount = rc.ErrorCount;
         tr.Resolve(rc);
         if (prevErrorCount == rc.ErrorCount)
         {
             // for positive triggers, make sure all bound variables are mentioned
             if (tr.Pos)
             {
                 Set /*Variable*/ freeVars = new Set/*Variable*/ ();
                 tr.ComputeFreeVariables(freeVars);
                 foreach (Variable /*!*/ v in Dummies)
                 {
                     Contract.Assert(v != null);
                     if (!freeVars[v])
                     {
                         rc.Error(tr, "trigger must mention all quantified variables, but does not mention: {0}", v);
                     }
                 }
             }
         }
     }
 }