Esempio n. 1
0
/* Two abstract values */
bool ap_abstract0_checkman2(ap_funid_t funid,
			    ap_manager_t* man, ap_abstract0_t* a1, ap_abstract0_t* a2)
{
  bool res;
  char str[160];

  res = true;
  if (man->library != a1->man->library){
    snprintf(str,159,"\
The first abstract value of type %s is not of the type %s expected by the manager\
",
	     a1->man->library,man->library);
    res = false;
  }
  else if (man->library != a2->man->library){
    snprintf(str,159,"\
The second abstract value of type %s is not of the type %s expected by the manager\
",
	     a2->man->library,man->library);
    res = false;
  }
  if (!res){
    ap_manager_raise_exception(man,
			       AP_EXC_INVALID_ARGUMENT,
			       funid,
			       str);
  }
  return res;
}
Esempio n. 2
0
void ap_abstract1_raise_invalid_var(ap_manager_t* man,
				    ap_funid_t funid,
				    ap_var_t var)
{
  char msg[160];
  char* b = ap_var_operations->to_string(var);
  snprintf(msg,159,"unknown variable %s in the environment",b);
  free(b);
  ap_manager_raise_exception(man,AP_EXC_INVALID_ARGUMENT,funid,msg);
}
Esempio n. 3
0
/* NOT IMPLEMENTED: do nothing */
ap_membuf_t ucons_serialize_raw(ap_manager_t * man, ucons_t * a) {
	ucons_internal_t *pr = ucons_init_from_manager(man, AP_FUNID_SERIALIZE_RAW,
			0);
	ap_membuf_t buf;
	buf.size = 0;
	buf.ptr = NULL;
	ap_manager_raise_exception(man, AP_EXC_NOT_IMPLEMENTED, pr->funid,
			"not implemented");
	return buf;
}
Esempio n. 4
0
void ap_abstract0_checkman1_raise(ap_funid_t funid, ap_manager_t* man, ap_abstract0_t* a)
{
  char str[160];
  snprintf(str,159,"\
The abstract value of type %s is not of the type %s expected by the manager\
",
	   a->man->library,man->library);
  ap_manager_raise_exception(man,
			     AP_EXC_INVALID_ARGUMENT,
			     funid,
			     str);
}
Esempio n. 5
0
/* NOT IMPLEMENTED: do nothing */
ap_membuf_t
mset_serialize_raw (ap_manager_t * man, mset_t * a)
{
  mset_internal_t *pr =
    mset_init_from_manager (man, AP_FUNID_SERIALIZE_RAW, 0);
  ap_membuf_t buf;
  buf.size = 0;
  buf.ptr = (size_t *) a;       /* to remove warning */
  ap_manager_raise_exception (man, AP_EXC_NOT_IMPLEMENTED, pr->funid,
                              "not implemented");
  return buf;
}
Esempio n. 6
0
/* Array of abstract values */
bool ap_abstract0_checkman_array(ap_funid_t funid,
				 ap_manager_t* man, ap_abstract0_t** tab, size_t size)
{
  size_t i;
  for (i=0;i<size;i++){
    if (man->library != tab[i]->man->library){
      char str[160];
      snprintf(str,159,"\
The %luth abstract value of the array is of type %s and not of the type %s expected by the manager\
",
	       (unsigned long)i,tab[i]->man->library,man->library);
      ap_manager_raise_exception(man,
				 AP_EXC_INVALID_ARGUMENT,
				 funid,
				 str);
      return false;
    }
  }
  return true;
}
Esempio n. 7
0
/* Check that the 2 abstract values have the same dimensionality */
bool ap_abstract0_check_abstract2(ap_funid_t funid, ap_manager_t* man,
				  ap_abstract0_t* a1, ap_abstract0_t* a2)
{
  ap_dimension_t dim1 = _ap_abstract0_dimension(a1);
  ap_dimension_t dim2 = _ap_abstract0_dimension(a2);
  if ( (dim1.intdim != dim2.intdim) || (dim1.realdim != dim2.realdim) ){
    char str[160];

    snprintf(str,159,"\
incompatible dimensions for the two arguments:\n\
first abstract0:  (%3lu,%3lu)\n\
second abstract0: (%3lu,%3lu)",
	     (unsigned long)dim1.intdim,
	     (unsigned long)dim1.realdim,
	     (unsigned long)dim2.intdim,
	     (unsigned long)dim2.realdim);
    ap_manager_raise_exception(man,
			       AP_EXC_INVALID_ARGUMENT,
			       funid,str);
    return false;
  } else {
Esempio n. 8
0
/* We throw an exception just like APRON */
void opt_oct_approximate(ap_manager_t* man, opt_oct_t* o, int algorithm)
{
    opt_oct_internal_t* pr = opt_oct_init_from_manager(man,AP_FUNID_APPROXIMATE,0);
    ap_manager_raise_exception(man,AP_EXC_NOT_IMPLEMENTED,pr->funid,
                               "not implemented");
}
Esempio n. 9
0
/* We throw an exception just like APRON */
void opt_oct_canonicalize(ap_manager_t* man, opt_oct_t* o)
{
    opt_oct_internal_t* pr = opt_oct_init_from_manager(man,AP_FUNID_CANONICALIZE,0);
    ap_manager_raise_exception(man,AP_EXC_NOT_IMPLEMENTED,pr->funid,
                               "not implemented");
}