Esempio n. 1
0
dreal_expr dreal_mk_forall(dreal_context c, dreal_expr * varlist, unsigned n, dreal_expr body) {
  assert(c);
  OpenSMTContext * c_ = static_cast<OpenSMTContext *>(c);
  OpenSMTContext & context = *c_;
  vector<pair<string, Snode *>> sorted_var_list;
  for (unsigned i = 0; i <n; ++i) {
      dreal_expr var = varlist[i];
      Enode * e = static_cast<Enode*>(var);
      Snode * sort = e->getSort();
      string name = e->getCar()->getNameFull();
      sorted_var_list.push_back(make_pair(name, sort));
  }
  Enode * e_body = static_cast<Enode*>(body);
  Enode * res = context.mkForall(sorted_var_list, e_body);
  return static_cast<void *>(res);
}
Esempio n. 2
0
opensmt_expr opensmt_mk_forall( opensmt_context c, opensmt_expr * varlist, unsigned n, opensmt_expr body ) {
  assert( c );
  OpenSMTContext * c_ = static_cast< OpenSMTContext * >( c );
  OpenSMTContext & context = *c_;
  vector<pair<string, Snode *>*>* sorted_var_list = new vector<pair<string, Snode *>*>();
  for (unsigned i = 0; i < n; ++i) {
      opensmt_expr var = varlist[i];
      Enode * e = static_cast<Enode*>(var);
      Snode * sort = e->getSort();
      string name = e->getCar()->getName();
      sorted_var_list->push_back(new pair<string, Snode *>(name, sort));
  }
  Enode * e_body = static_cast<Enode*>(body);
  Enode * res = context.mkForall(sorted_var_list, e_body);
  delete sorted_var_list;
  return static_cast< void * >( res );
}