Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. int main() {
  2. SmtEngine smt(&em);
  3. smt.setLogic("AUFLIRA"); // Set the logic
  4.  
  5. Expr three = em.mkConst(Rational(3));
  6. Expr four = em.mkConst(Rational(4));
  7.  
  8. // make the list of bound variables in CVC4
  9. Expr bound_var = em.mkBoundVar("x_bound", em.integerType());
  10. vector<Expr> bound_vars;
  11. bound_vars.push_back(bound_var);
  12. Expr bound_var_list = em.mkExpr(kind::BOUND_VAR_LIST, bound_vars);
  13.  
  14. Expr declare = em.mkExpr(kind::EQUAL, bound_var, three); //x_bound =3
  15.  
  16. Expr check = em.mkExpr(kind::EQUAL, bound_var, four); //x_bound=4
  17.  
  18. //forall x_bound, x_bound=3, the constraint I want to declare as true
  19. Expr expr = em.mkExpr(kind::FORALL, bound_var_list, declare);
  20.  
  21. smt.assertFormula(expr);
  22. smt.push();
  23.  
  24. // expect to be INVALID
  25. // I want to check that given forall x_bound, x_bound = 3
  26. // then I ask CVC4: is it true that x_bound=4, or is it false?
  27. std::cout << "Quantifier " << smt.query(check) << std::endl;
  28.  
  29. return 0;
  30. }
  31.  
  32. Quantifier not defined.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement