Example #1
0
 public Object leq(Object exp1, Object exp2) {
   try {
     return vc.leExpr((Expr) exp1, (Expr) exp2);
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException("## Error CVC3: Exception caught in CVC3 JNI: \n" + e);
   }
 }
Example #2
0
 public Object leq(int value, Object exp) {
   try {
     return vc.leExpr(vc.ratExpr(value), (Expr) exp);
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException("## Error CVC3: Exception caught in CVC3 JNI: \n" + e);
   }
 }
Example #3
0
 public Object neq(Object exp, double value) {
   try {
     return vc.notExpr(vc.eqExpr((Expr) exp, vc.ratExpr(Double.toString(value), base)));
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException("## Error CVC3: Exception caught in CVC3 JNI: \n" + e);
   }
 }
Example #4
0
 public void post(Object constraint) {
   try {
     listConstraint.add((Expr) constraint);
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException(
         "## Error CVC3: Exception caught making Int Var in CVC3 ???: \n" + e);
   }
 }
Example #5
0
 public Object makeIntVar(String name, int min, int max) {
   try {
     /*
      * Type sType = vc.subrangeType(vc.ratExpr(min), vc.ratExpr(max)); return
      * vc.varExpr(name, sType);
      */
     Expr expr = vc.varExpr(name, vc.intType());
     return expr;
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException("## Error CVC3: Exception caught in CVC3 JNI: \n" + e);
   }
 }
Example #6
0
 public Object makeRealVar(String name, double min, double max) {
   // WARNING: need to downcast double to int - I don't see
   // a way in CVC3 to create a sub-range for real types
   // other choice is not to bound and use vc.realType() to
   // create the expression
   int minInt = (int) min;
   int maxInt = (int) max;
   try {
     // Expr x = vc.varExpr(name, vc.realType());
     /*
      * Type sType = vc.subrangeType(vc.ratExpr(minInt), vc.ratExpr(maxInt));
      * return vc.varExpr(name, sType);
      */
     Expr expr = vc.varExpr(name, vc.intType());
     return expr;
   } catch (Exception e) {
     e.printStackTrace();
     throw new RuntimeException("## Error CVC3: Exception caught in CVC3 JNI: \n" + e);
   }
 }