예제 #1
0
        public override Answer CheckPredicate(Element /*!*/ e, IExpr /*!*/ pred)
        {
            //Contract.Requires(pred != null);
            //Contract.Requires(e != null);
            PolyhedraLatticeElement /*!*/ ple = (PolyhedraLatticeElement)Constrain(e, pred);

            Contract.Assert(ple != null);
            if (ple.lcs.IsBottom())
            {
                return(Answer.No);
            }

            // Note, "pred" may contain expressions that are not understood by the propFactory (in
            // particular, this may happen because--currently, and perhaps is a design we'll want
            // to change in the future--propFactory deals with BoogiePL expressions whereas "pred"
            // may also refer to Equivalences.UninterpFun expressions).  Thus, we cannot just
            // call propFactory.Not(pred) to get the negation of "pred".
            pred = new PolyhedraLatticeNegation(pred);
            ple  = (PolyhedraLatticeElement)Constrain(e, pred);
            if (ple.lcs.IsBottom())
            {
                return(Answer.Yes);
            }
            else
            {
                return(Answer.Maybe);
            }
        }
예제 #2
0
    public override Answer CheckPredicate(Element/*!*/ e, IExpr/*!*/ pred) {
      //Contract.Requires(pred != null);
      //Contract.Requires(e != null);
      PolyhedraLatticeElement/*!*/ ple = (PolyhedraLatticeElement)Constrain(e, pred);
      Contract.Assert(ple != null);
      if (ple.lcs.IsBottom()) {
        return Answer.No;
      }

      // Note, "pred" may contain expressions that are not understood by the propFactory (in
      // particular, this may happen because--currently, and perhaps is a design we'll want
      // to change in the future--propFactory deals with BoogiePL expressions whereas "pred"
      // may also refer to Equivalences.UninterpFun expressions).  Thus, we cannot just
      // call propFactory.Not(pred) to get the negation of "pred".
      pred = new PolyhedraLatticeNegation(pred);
      ple = (PolyhedraLatticeElement)Constrain(e, pred);
      if (ple.lcs.IsBottom()) {
        return Answer.Yes;
      } else {
        return Answer.Maybe;
      }
    }