Esempio n. 1
0
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            int j = 2 * this.x + 1;
            int i = 2 * this.y;

            affectedDimensions.Add(this.x);
            affectedDimensions.Add(this.y);

            if (this.c <= oct.octagon[Matpos2(i, j)])
            {
                oct.octagon[Matpos2(i, j)] = this.c;
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        ///<summary>
        /// Add this constraint to the octagon
        ///</summary>
        override public bool AddToOctagon(CoreOctagon oct, IMutableSet <int> affectedDimensions)
        {
            int j = 2 * this.x + 1;
            int i = 2 * this.x;

            affectedDimensions.Add(this.x);

            try
            {
                Rational c = this.c * 2;

                if (Rational.Min(c, oct.octagon[Matpos2(i, j)]) == c)
                {
                    oct.octagon[Matpos2(i, j)] = c;
                    return(true);
                }
            }
            catch (ArithmeticExceptionRational)
            {
                // We could not add the constraint because of an arithmetic exception

                return(false);
            }

            return(false);
        }
Esempio n. 3
0
 public bool Add(T item)
 {
     if (set.Add(item))
     {
         signal.Fire(new CollectionChange <T>(item.ToOption(), Seq.Empty <T>()));
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 4
0
    ///<summary>
    /// Add this constraint to the octagon
    ///</summary>
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      int j = 2 * this.x + 1;
      int i = 2 * this.x;

      affectedDimensions.Add(this.x);

      try
      {
        Rational c = this.c * 2;

        if (Rational.Min(c, oct.octagon[Matpos2(i, j)]) == c)
        {
          oct.octagon[Matpos2(i, j)] = c;
          return true;
        }
      }
      catch (ArithmeticExceptionRational)
      {
        // We could not add the constraint because of an arithmetic exception

        return false;
      }

      return false;
    }
Esempio n. 5
0
    override public bool AddToOctagon(CoreOctagon oct, IMutableSet<int> affectedDimensions)
    {
      int j = 2 * this.x + 1;
      int i = 2 * this.y;

      affectedDimensions.Add(this.x);
      affectedDimensions.Add(this.y);

      if (this.c <= oct.octagon[Matpos2(i, j)])
      {
        oct.octagon[Matpos2(i, j)] = this.c;
        return true;
      }
      return false;
    }
 private void first_dfs_end_visitor(object node)
 {
     nodes_in_graph.Add(node);
     nodes_desc_order.Push(node);
 }
Esempio n. 7
0
 private void FindReachable(IMutableSet reach, CfgBlock current, NormalFlowBlockNavigator nfnav) {
   if (reach.Contains(current)) return;
   reach.Add(current);
   foreach (CfgBlock next in nfnav.NextNodes(current)) {
     FindReachable(reach, next, nfnav);
   }
   // also follow exceptional path
   CfgBlock handler = (CfgBlock)this.b2exception_handler[current];
   if (handler != null) {
     FindReachable(reach, handler, nfnav);
   }
 }