text:
/* ************************************************************************* */
/* elina_abstract0.c: generic interface */
/* ************************************************************************* */

#include "elina_abstract0.h"

/* ********************************************************************** */
/* 0. Utility and checking functions */
/* ********************************************************************** */

/* ====================================================================== */
/* 0.1 Checking typing w.r.t. manager */
/* ====================================================================== */

/*
  These functions return true if everything is OK, otherwise they raise an
  exception in the manager and return false.
*/

/* One abstract value */

void elina_abstract0_checkman1_raise(elina_funid_t funid, elina_manager_t* man, elina_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);
  elina_manager_raise_exception(man,
			     ELINA_EXC_INVALID_ARGUMENT,
			     funid,
			     str);
}

/* Two abstract values */
bool elina_abstract0_checkman2(elina_funid_t funid,
			    elina_manager_t* man, elina_abstract0_t* a1, elina_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){
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,
			       str);
  }
  return res;
}
/* Array of abstract values */
bool elina_abstract0_checkman_array(elina_funid_t funid,
				 elina_manager_t* man, elina_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);
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 funid,
				 str);
      return false;
    }
  }
  return true;
}

/* ====================================================================== */
/* 0.2 Checking compatibility of arguments: abstract values */
/* ====================================================================== */

/* Check that the 2 abstract values have the same dimensionality */
bool elina_abstract0_check_abstract2(elina_funid_t funid, elina_manager_t* man,
				  elina_abstract0_t* a1, elina_abstract0_t* a2)
{
  elina_dimension_t dim1 = _elina_abstract0_dimension(a1);
  elina_dimension_t dim2 = _elina_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);
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,str);
    return false;
  } else {
    return true;
  }
}

/* Check that the array of abstract values have the same dimensionality.*/
bool elina_abstract0_check_abstract_array(elina_funid_t funid, elina_manager_t* man,
				       elina_abstract0_t** tab, size_t size)
{
  size_t i=0;
  elina_dimension_t dim;
  elina_dimension_t dim0;
  bool res;

  res = true;

  if (size==0){
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,"array of abstract values of size 0");
    res = false;
  }
  else {
    dim0 = _elina_abstract0_dimension(tab[0]);
    for (i=1; i<size; i++){
      dim = _elina_abstract0_dimension(tab[i]);
      if ( (dim.intdim != dim0.intdim) || (dim.realdim != dim0.realdim) ){
	res = false;
	break;
      }
    }
  }
  if (!res){
    char str[160];
    if (size==0){
      snprintf(str,159,"array of size 0");
    }
    else {
      snprintf(str,159,"\
incompatible dimensions for the array of polyhedra:\n\
abstract0 0: (%3lu,%3lu)\n\
abstract0 %lu: (%3lu,%3lu)\
",
	       (unsigned long)dim0.intdim,(unsigned long)dim0.realdim,
	       (unsigned long)i,
	       (unsigned long)dim.intdim,(unsigned long)dim.realdim
	       );
    }
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,str);
  }
  return res;
}

/* ====================================================================== */
/* 0.3 Checking compatibility of arguments: dimensions */
/* ====================================================================== */

/* Check that the dimension makes sense in the given dimensionality */
void elina_abstract0_check_dim_raise(elina_funid_t funid, elina_manager_t* man,
				  elina_dimension_t dimension, elina_dim_t dim,
				  const char* prefix)
{
  char str[160];

  snprintf(str,159,"\
%s:\n\
abstract0:  (%3lu,%3lu)\n\
dimension:  %3lu\n",
	   prefix,
	   (unsigned long)dimension.intdim,
	   (unsigned long)dimension.realdim,
	   (unsigned long)dim);
  elina_manager_raise_exception(man,
			     ELINA_EXC_INVALID_ARGUMENT,
			     funid,str);
}

/* Check that the array of dimensions make sense in the given dimensionality */
bool elina_abstract0_check_dim_array(elina_funid_t funid, elina_manager_t* man,
				  elina_dimension_t dimension, elina_dim_t* tdim, size_t size)
{
  size_t i;
  for (i=0;i<size;i++){
    elina_dim_t dim = tdim[i];
    if (dim>=dimension.intdim+dimension.realdim){
      char str[80];
      sprintf(str,"incompatible %luth dimension in the array for the abstract value",(unsigned long)i);
      elina_abstract0_check_dim_raise(funid,man,dimension,dim,str);
      return false;
    }
  }
  return true;
}

/* ====================================================================== */
/* 0.4 Checking compatibility of arguments: expressions */
/* ====================================================================== */

void elina_abstract0_check_expr_raise(elina_funid_t funid, elina_manager_t* man,
				   elina_dimension_t dimension,
				   elina_dim_t dim,
				   char* prefix)
{
  char str[160];
  snprintf(str,159,"\
%s:\n\
abstract0: (%3lu,%3lu)\n\
dimension: %3lu\
",
	   prefix,
	   (unsigned long)dimension.intdim,(unsigned long)dimension.realdim,
	   (unsigned long)dim);
  elina_manager_raise_exception(man,
			     ELINA_EXC_INVALID_ARGUMENT,
			     funid,str);
}

/* Check that the linear expression makes sense in the given dimensionality */
elina_dim_t elina_abstract0_check_linexpr_check(elina_dimension_t dimension,
					  elina_linexpr0_t* expr)
{
  int i;
  size_t nbdims;
  elina_dim_t dim;

  nbdims = dimension.intdim+dimension.realdim;
  dim = 0;
  switch (expr->discr){
  case ELINA_LINEXPR_DENSE:
    if (expr->size > nbdims){
      dim = expr->size-1;
    }
    else {
      dim = ELINA_DIM_MAX;
    }
    break;
  case ELINA_LINEXPR_SPARSE:
    /* Assumed to be sorted (this is not checked */
    for (i=expr->size-1; i>=0; i--){
      dim = expr->p.linterm[i].dim;
      if (dim!=ELINA_DIM_MAX){
	if (dim < nbdims)
	  dim = ELINA_DIM_MAX;
	;
	break;
      }
    }
    if (!dim) dim = ELINA_DIM_MAX;
    break;
  default:
    abort();
  }
  return dim;
}

bool elina_abstract0_check_linexpr(elina_funid_t funid, elina_manager_t* man,
				elina_dimension_t dimension,
				elina_linexpr0_t* expr)
{
  elina_dim_t dim = elina_abstract0_check_linexpr_check(dimension,expr);
  if (dim!=ELINA_DIM_MAX){
    elina_abstract0_check_expr_raise(funid,man,dimension,dim,
				  "incompatible dimension in the linear expression for the abstract value");
    return false;
  } else {
    return true;
  }
}

/* Check that the tree expression makes sense in the given dimensionality */
elina_dim_t elina_abstract0_check_texpr_check(elina_dimension_t dimension,
					elina_texpr0_t* expr)
{
  elina_dim_t dim;

  dim = elina_texpr0_max_dim(expr);
  if (dim <= dimension.intdim+dimension.realdim)
    return ELINA_DIM_MAX;
  else
    return dim;
}

bool elina_abstract0_check_texpr(elina_funid_t funid, elina_manager_t* man,
			      elina_dimension_t dimension,
			      elina_texpr0_t* expr)
{
  elina_dim_t dim = elina_abstract0_check_texpr_check(dimension,expr);
  if (dim!=ELINA_DIM_MAX){
    elina_abstract0_check_expr_raise(funid,man,dimension,dim,
				  "incompatible dimension in the tree expression for the abstract value");
    return false;
  } else {
    return true;
  }
}

/* ====================================================================== */
/* 0.5 Checking compatibility of arguments: array of expressions/constraints/generators */
/* ====================================================================== */

/* Check that array of linear expressions makes sense in the given dimensionality */
bool elina_abstract0_check_linexpr_array(elina_funid_t funid, elina_manager_t* man,
				      elina_dimension_t dimension,
				      elina_linexpr0_t** texpr, size_t size)
{
  size_t i;

  for (i=0;i<size; i++){
    if (texpr[i]==NULL){
      char str[80];
      sprintf(str,"null pointer in the %luth expression of the array",(unsigned long)i);
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 funid,str);
      return false;
    }
    elina_dim_t dim = elina_abstract0_check_linexpr_check(dimension,texpr[i]);
    if (dim!=ELINA_DIM_MAX){
      char str[80];
      sprintf(str,"incompatible dimension in the %luth expression of the array",(unsigned long)i);
      elina_abstract0_check_expr_raise(funid,man,dimension,dim,str);
      return false;
    }
  }
  return true;
}
/* Check that array of linear constraint makes sense in the given dimensionality */
bool elina_abstract0_check_lincons_array(elina_funid_t funid, elina_manager_t* man,
				      elina_dimension_t dimension,
				      elina_lincons0_array_t* array)
{
  size_t i;

  for (i=0;i<array->size; i++){
    if (array->p[i].linexpr0==NULL){
      char str[80];
      sprintf(str,"null pointer in the %luth constraint of the array",(unsigned long)i);
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 funid,str);
      return false;
    }
    elina_dim_t dim = elina_abstract0_check_linexpr_check(dimension,array->p[i].linexpr0);
    if (dim!=ELINA_DIM_MAX){
      char str[80];
      sprintf(str,"incompatible dimension in the %luth constraint of the array",(unsigned long)i);
      elina_abstract0_check_expr_raise(funid,man,dimension,dim,str);
      return false;
    }
  }
  return true;
}

/* Check that array of tree expressions makes sense in the given dimensionality */
bool elina_abstract0_check_texpr_array(elina_funid_t funid, elina_manager_t* man,
				    elina_dimension_t dimension,
				    elina_texpr0_t** texpr, size_t size)
{
  size_t i;

  for (i=0;i<size; i++){
    if (texpr[i]==NULL){
      char str[80];
      sprintf(str,"null pointer in the %luth expression of the array",(unsigned long)i);
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 funid,str);
      return false;
    }
    elina_dim_t dim = elina_abstract0_check_texpr_check(dimension,texpr[i]);
    if (dim!=ELINA_DIM_MAX){
      char str[80];
      sprintf(str,"incompatible dimension in the %luth expression of the array",(unsigned long)i);
      elina_abstract0_check_expr_raise(funid,man,dimension,dim,str);
      return false;
    }
  }
  return true;
}
/* Check that array of tree constraint makes sense in the given dimensionality */
bool elina_abstract0_check_tcons_array(elina_funid_t funid, elina_manager_t* man,
				      elina_dimension_t dimension,
				      elina_tcons0_array_t* array)
{
  size_t i;

  for (i=0;i<array->size; i++){
    if (array->p[i].texpr0==NULL){
      char str[80];
      sprintf(str,"null pointer in the %luth constraint of the array",(unsigned long)i);
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 funid,str);
      return false;
    }
    elina_dim_t dim = elina_abstract0_check_texpr_check(dimension,array->p[i].texpr0);
    if (dim!=ELINA_DIM_MAX){
      char str[80];
      sprintf(str,"incompatible dimension in the %luth constraint of the array",(unsigned long)i);
      elina_abstract0_check_expr_raise(funid,man,dimension,dim,str);
      return false;
    }
  }
  return true;
}

/* ====================================================================== */
/* 0.6 Checking compatibility of arguments: dimchange */
/* ====================================================================== */

bool elina_abstract0_check_elina_dimchange_add(elina_funid_t funid, elina_manager_t* man,
					 elina_dimension_t dimension, elina_dimchange_t* dimchange)
{
  size_t i,size;
  bool res = true;
  /* Check consistency between intdim and the dimensions in the array */
  for (i=0; i<dimchange->intdim; i++){
    if (dimchange->dim[i]>dimension.intdim){

      res = false;
      break;
    }
  }
  size = dimchange->intdim+dimchange->realdim;
  if (res && size>0){
    /* Check sortedness */
    elina_dim_t dim = 0;
    for (i=1; i<size; i++){
      if (dim>dimchange->dim[i]){
	res = false;

	break;
      } else {
	dim = dimchange->dim[i];
      }
    }
    res = res && dimchange->dim[size-1]<=dimension.intdim+dimension.realdim;
  }
  if (!res){
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,
			       "dimchange->dim is not sorted or is inconsistent wrt dimchange->intdim or abstract0");
  }
  return res;
}

bool elina_abstract0_check_elina_dimchange_remove(elina_funid_t funid, elina_manager_t* man,
					    elina_dimension_t dimension, elina_dimchange_t* dimchange)
{
  size_t i,size;
  bool res = true;
  /* Check consistency between intdim and the dimensions in the array */
  for (i=0; i<dimchange->intdim; i++){
    if (dimchange->dim[i]>=dimension.intdim){
      res = false;
      break;
    }
  }
  size = dimchange->intdim+dimchange->realdim;
  if (res && size>0){
    /* Check sortedness */
    elina_dim_t dim = 0;
    for (i=1; i<dimchange->intdim+dimchange->realdim; i++){
      if (dim>=dimchange->dim[i]){
	res = false;
	break;
      } else {
	dim = dimchange->dim[i];
      }
    }
    res = res && dimchange->dim[size-1]<dimension.intdim+dimension.realdim;
  }
  if (!res){
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,
			       "dimchange->dim is not sorted, contains duplicatas, or is inconsistent wrt dimchange->intdim or abstract0");
  }
  return res;
}
bool elina_abstract0_check_dimperm(elina_funid_t funid, elina_manager_t* man,
				elina_dimension_t dimension, elina_dimperm_t* perm)
{
  size_t i;
  size_t size = dimension.intdim+dimension.realdim;
  bool res = (dimension.intdim+dimension.realdim==perm->size);
  if (res){
    for (i=0; i<perm->size; i++){
      if (perm->dim[i]>=size){
	res = false;
	break;
      }
    }
  }
  if (!res){
    elina_manager_raise_exception(man,
			       ELINA_EXC_INVALID_ARGUMENT,
			       funid,
			       "permutation is not valid");
  }
  return res;
}

/* ********************************************************************** */
/* I. General management */
/* ********************************************************************** */

/* ============================================================ */
/* I.1 Memory */
/* ============================================================ */

elina_abstract0_t* elina_abstract0_copy(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_COPY,man,a)){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_COPY];
    return elina_abstract0_cons(man,ptr(man,a->value));
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}

void elina_abstract0_free(elina_manager_t* man, elina_abstract0_t* a)
{
  if (a->man==NULL){
    fprintf(stderr,"elina_abstract0_c: elina_abstract0_free: the abstract value has probably already been deallocated !\n");
    abort();
  }
  if (elina_abstract0_checkman1(ELINA_FUNID_FREE,man,a)){
    void (*ptr)(elina_manager_t*,elina_abstract0_t*) = man->funptr[ELINA_FUNID_FREE];
    ptr(man,a->value);
  }
  else {
    void (*ptr)(elina_manager_t*,elina_abstract0_t*) = a->man->funptr[ELINA_FUNID_FREE];
    ptr(a->man,a->value);
  }
  elina_manager_free(a->man);
  a->man = NULL;
  a->value = NULL;
  free(a);
}
size_t elina_abstract0_size(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_ASIZE,man,a)){
    size_t (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_ASIZE];
    return ptr(man,a->value);
  }
  else {
    return 0;
  }
}

/* ============================================================ */
/* I.2 Control of internal representation */
/* ============================================================ */
void elina_abstract0_minimize(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_MINIMIZE,man,a)){
    void (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_MINIMIZE];
    ptr(man,a->value);
  }
}
void elina_abstract0_canonicalize(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_CANONICALIZE,man,a)){
    void (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_CANONICALIZE];
    ptr(man,a->value);
  }
}
int elina_abstract0_hash(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_CANONICALIZE,man,a)){
    int (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_HASH];
    return ptr(man,a->value);
  }
  else
    return 0;
}
void elina_abstract0_approximate(elina_manager_t* man, elina_abstract0_t* a, int n)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_APPROXIMATE,man,a)){
    void (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_APPROXIMATE];
    ptr(man,a->value,n);
  }
}

/* ============================================================ */
/* I.3 Printing */
/* ============================================================ */
void elina_abstract0_fprint(FILE* stream, elina_manager_t* man,
			 elina_abstract0_t* a,
			 char** name_of_dim)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_FPRINT,man,a)){
    void (*ptr)(FILE*,elina_manager_t*,...) = man->funptr[ELINA_FUNID_FPRINT];
    ptr(stream,man,a->value,name_of_dim);
  }
  else {
    fprintf(stream,"elina_abstract0_c: elina_abstract0_fprint: INVALID_ARGUMENT\n");
  }
}

void elina_abstract0_fprintdiff(FILE* stream, elina_manager_t* man,
			     elina_abstract0_t* a, elina_abstract0_t* b,
			     char** name_of_dim)
{
  if (elina_abstract0_checkman2(ELINA_FUNID_FPRINTDIFF,man,a,b) &&
      elina_abstract0_check_abstract2(ELINA_FUNID_FPRINTDIFF,man,a,b) ){
    void (*ptr)(FILE*,elina_manager_t*,...) = man->funptr[ELINA_FUNID_FPRINTDIFF];
    ptr(stream,man,a->value,b->value,name_of_dim);
  }
  else {
    fprintf(stream,"elina_abstract0_c: elina_abstract0_fprintdiff: INVALID ARGUMENT\n");
  }
}
void elina_abstract0_fdump(FILE* stream, elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_FDUMP,man,a)){
    void (*ptr)(FILE*,elina_manager_t*,...) = man->funptr[ELINA_FUNID_FDUMP];
    ptr(stream,man,a->value);
  }
  else {
    fprintf(stream,"elina_abstract0_c: elina_abstract0_fdump: INVALID_ARGUMENT\n");
  }
}

/* ============================================================ */
/* I.4 Serialization */
/* ============================================================ */
elina_membuf_t elina_abstract0_serialize_raw(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_SERIALIZE_RAW,man,a)){
    elina_membuf_t (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_SERIALIZE_RAW];
    return ptr(man,a->value);
  }
  else {
    elina_membuf_t res = { NULL, 0 };
    return res;
  }
}
elina_abstract0_t* elina_abstract0_deserialize_raw(elina_manager_t* man, void* p, size_t* size)
{
  void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_DESERIALIZE_RAW];
  return elina_abstract0_cons(man,ptr(man,p,size));
}

/* ********************************************************************** */
/* II. Constructor, accessors, tests and property extraction */
/* ********************************************************************** */
/* ============================================================ */
/* II.1 Basic constructors */
/* ============================================================ */
elina_abstract0_t* elina_abstract0_bottom(elina_manager_t* man, size_t intdim, size_t realdim)
{
  void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_BOTTOM];
  return elina_abstract0_cons(man,ptr(man,intdim,realdim));
}
elina_abstract0_t* elina_abstract0_top(elina_manager_t* man, size_t intdim, size_t realdim){
  void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_TOP];
  return elina_abstract0_cons(man,ptr(man,intdim,realdim));
}
elina_abstract0_t* elina_abstract0_of_box(elina_manager_t* man,
				    size_t intdim, size_t realdim,
				    elina_interval_t** tinterval){
  void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_OF_BOX];
  return elina_abstract0_cons(man,ptr(man,intdim,realdim,tinterval));
}

/* ============================================================ */
/* II.2 Accessors */
/* ============================================================ */
elina_dimension_t elina_abstract0_dimension(elina_manager_t* man, elina_abstract0_t* a)
{
  elina_abstract0_checkman1(ELINA_FUNID_DIMENSION,man,a);
  elina_dimension_t (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_DIMENSION];
  return ptr(a->man,a->value);
}

/* ============================================================ */
/* II.3 Tests */
/* ============================================================ */
bool elina_abstract0_is_bottom(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_IS_BOTTOM,man,a)){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_IS_BOTTOM];
    return ptr(man,a->value);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_is_top(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_IS_TOP,man,a)){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_IS_TOP];
    return ptr(man,a->value);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_is_leq(elina_manager_t* man, elina_abstract0_t* a1, elina_abstract0_t* a2)
{
  if (a1==a2){
    return true;
  }
  else if (elina_abstract0_checkman2(ELINA_FUNID_IS_LEQ,man,a1,a2) &&
	   elina_abstract0_check_abstract2(ELINA_FUNID_IS_EQ,man,a1,a2)){
    if (a1->value==a2->value) return true;
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_IS_LEQ];
    return ptr(man,a1->value,a2->value);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_is_eq(elina_manager_t* man, elina_abstract0_t* a1, elina_abstract0_t* a2)
{
  if (a1==a2){
    return true;
  }
  if (elina_abstract0_checkman2(ELINA_FUNID_IS_EQ,man,a1,a2) &&
      elina_abstract0_check_abstract2(ELINA_FUNID_IS_EQ,man,a1,a2)){
    if (a1->value==a2->value) return true;
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_IS_EQ];
    return ptr(man,a1->value,a2->value);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_sat_lincons(elina_manager_t* man, elina_abstract0_t* a, elina_lincons0_t* lincons)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_SAT_LINCONS,man,a) &&
      elina_abstract0_check_linexpr(ELINA_FUNID_SAT_LINCONS,man,_elina_abstract0_dimension(a),lincons->linexpr0) ){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_SAT_LINCONS];
    return ptr(man,a->value,lincons);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_sat_tcons(elina_manager_t* man, elina_abstract0_t* a, elina_tcons0_t* tcons)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_SAT_TCONS,man,a) &&
      elina_abstract0_check_texpr(ELINA_FUNID_SAT_TCONS,man,_elina_abstract0_dimension(a),tcons->texpr0) ){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_SAT_TCONS];
    return ptr(man,a->value,tcons);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_sat_interval(elina_manager_t* man, elina_abstract0_t* a,
			       elina_dim_t dim, elina_interval_t* interval)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_SAT_INTERVAL,man,a) &&
      elina_abstract0_check_dim(ELINA_FUNID_SAT_INTERVAL,man,_elina_abstract0_dimension(a),dim)){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_SAT_INTERVAL];
    return ptr(man,a->value,dim,interval);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}
bool elina_abstract0_is_dimension_unconstrained(elina_manager_t* man, elina_abstract0_t* a,
					     elina_dim_t dim)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_IS_DIMENSION_UNCONSTRAINED,man,a) &&
      elina_abstract0_check_dim(ELINA_FUNID_IS_DIMENSION_UNCONSTRAINED,man,_elina_abstract0_dimension(a),dim)){
    bool (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_IS_DIMENSION_UNCONSTRAINED];
    return ptr(man,a->value,dim);
  }
  else {
    man->result.flag_exact = false;
    return false;
  }
}

/* ============================================================ */
/* II.4 Extraction of properties */
/* ============================================================ */
elina_interval_t* elina_abstract0_bound_linexpr(elina_manager_t* man,
					  elina_abstract0_t* a, elina_linexpr0_t* expr)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_BOUND_LINEXPR,man,a) &&
      elina_abstract0_check_linexpr(ELINA_FUNID_BOUND_LINEXPR,man,_elina_abstract0_dimension(a),expr)){
    elina_interval_t* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_BOUND_LINEXPR];
    return ptr(man,a->value,expr);
  }
  else {
    elina_interval_t* itv = elina_interval_alloc();
    elina_interval_reinit(itv,man->option.scalar_discr);
    elina_interval_set_top(itv);
    return itv;
  }
}
elina_interval_t* elina_abstract0_bound_texpr(elina_manager_t* man,
					elina_abstract0_t* a, elina_texpr0_t* expr)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_BOUND_TEXPR,man,a) &&
      elina_abstract0_check_texpr(ELINA_FUNID_BOUND_TEXPR,man,_elina_abstract0_dimension(a),expr)){
    elina_interval_t* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_BOUND_TEXPR];
    return ptr(man,a->value,expr);
  }
  else {
    elina_interval_t* itv = elina_interval_alloc();
    elina_interval_reinit(itv,man->option.scalar_discr);
    elina_interval_set_top(itv);
    return itv;
  }
}
elina_interval_t* elina_abstract0_bound_dimension(elina_manager_t* man,
					    elina_abstract0_t* a, elina_dim_t dim)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_BOUND_DIMENSION,man,a) &&
      elina_abstract0_check_dim(ELINA_FUNID_BOUND_DIMENSION,man,_elina_abstract0_dimension(a),dim)){
    elina_interval_t* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_BOUND_DIMENSION];
    return ptr(man,a->value,dim);
  }
  else {
    elina_interval_t* itv = elina_interval_alloc();
    elina_interval_reinit(itv,man->option.scalar_discr);
    elina_interval_set_top(itv);
    return itv;
  }
}
elina_lincons0_array_t elina_abstract0_to_lincons_array(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_TO_LINCONS_ARRAY,man,a)){
    elina_lincons0_array_t (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_TO_LINCONS_ARRAY];
    return ptr(man,a->value);
  }
  else {
    elina_lincons0_array_t res = { NULL, 0 };
    return res;
  }
}
elina_tcons0_array_t elina_abstract0_to_tcons_array(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_TO_TCONS_ARRAY,man,a)){
    elina_tcons0_array_t (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_TO_TCONS_ARRAY];
    return ptr(man,a->value);
  }
  else {
    elina_tcons0_array_t res = { NULL, 0 };
    return res;
  }
}
elina_interval_t** elina_abstract0_to_box(elina_manager_t* man, elina_abstract0_t* a)
{
  if (elina_abstract0_checkman1(ELINA_FUNID_TO_BOX,man,a)){
    elina_interval_t** (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_TO_BOX];
    return ptr(man,a->value);
  }
  else {
    size_t i;
    elina_dimension_t d = _elina_abstract0_dimension(a);
    elina_interval_t** titv = elina_interval_array_alloc(d.intdim+d.realdim);
    for (i=0; i<d.intdim+d.realdim; i++){
      elina_interval_reinit(titv[i],man->option.scalar_discr);
      elina_interval_set_top(titv[i]);
    }
    return titv;
  }
}

/* ********************************************************************** */
/* III. Operations */
/* ********************************************************************** */
/* ============================================================ */
/* III.1 Meet and Join */
/* ============================================================ */

elina_abstract0_t* elina_abstract0_meetjoin(elina_funid_t funid,
				      elina_manager_t* man, bool destructive, elina_abstract0_t* a1, elina_abstract0_t* a2)
{
  if (elina_abstract0_checkman2(funid,man,a1,a2) &&
      elina_abstract0_check_abstract2(funid,man,a1,a2)){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[funid];
    void* value = ptr(man,destructive,a1->value,a2->value);
    return elina_abstract0_cons2(man,destructive,a1,value);
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a1);
    if (destructive) _elina_abstract0_free(a1);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}
elina_abstract0_t* elina_abstract0_meet(elina_manager_t* man, bool destructive, elina_abstract0_t* a1, elina_abstract0_t* a2){
  return  elina_abstract0_meetjoin(ELINA_FUNID_MEET,man,destructive,a1,a2);
}
elina_abstract0_t* elina_abstract0_join(elina_manager_t* man, bool destructive, elina_abstract0_t* a1, elina_abstract0_t* a2){
  return  elina_abstract0_meetjoin(ELINA_FUNID_JOIN,man,destructive,a1,a2);
}

elina_abstract0_t* elina_abstract0_meetjoin_array(elina_funid_t funid, elina_manager_t* man, elina_abstract0_t** tab, size_t size)
{
  if (elina_abstract0_checkman_array(funid,man,tab,size) &&
      elina_abstract0_check_abstract_array(funid,man,tab,size)){
    size_t i;
    elina_abstract0_t* res;
    void* (*ptr)(elina_manager_t*,...) = man->funptr[funid];
    void** ntab = malloc(size*sizeof(void*));
    for (i=0;i<size;i++) ntab[i] = tab[i]->value;
    res = elina_abstract0_cons(man,ptr(man,ntab,size));
    free(ntab);
    return res;
  }
  else {
    elina_dimension_t dimension = { 0, 0};
    if (size>0){
      dimension = _elina_abstract0_dimension(tab[0]);
    }
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}
elina_abstract0_t* elina_abstract0_meet_array(elina_manager_t* man, elina_abstract0_t** tab, size_t size){
  return elina_abstract0_meetjoin_array(ELINA_FUNID_MEET_ARRAY,man,tab,size);
}
elina_abstract0_t* elina_abstract0_join_array(elina_manager_t* man, elina_abstract0_t** tab, size_t size){
  return elina_abstract0_meetjoin_array(ELINA_FUNID_JOIN_ARRAY,man,tab,size);
}
elina_abstract0_t* elina_abstract0_meet_lincons_array(elina_manager_t* man,
						bool destructive,
						elina_abstract0_t* a,
						elina_lincons0_array_t* array)
{
  elina_dimension_t dimension = _elina_abstract0_dimension(a);
  if (elina_abstract0_checkman1(ELINA_FUNID_MEET_LINCONS_ARRAY,man,a) &&
      elina_abstract0_check_lincons_array(ELINA_FUNID_MEET_LINCONS_ARRAY,man,dimension,array) ){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_MEET_LINCONS_ARRAY];
    void* value = ptr(man,destructive,a->value,array);
    return elina_abstract0_cons2(man,destructive,a,value);
  }
  else {
    if (destructive) _elina_abstract0_free(a);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}
elina_abstract0_t* elina_abstract0_meet_tcons_array(elina_manager_t* man,
					      bool destructive,
					      elina_abstract0_t* a,
					      elina_tcons0_array_t* array)
{
  elina_dimension_t dimension = _elina_abstract0_dimension(a);
  if (elina_abstract0_checkman1(ELINA_FUNID_MEET_TCONS_ARRAY,man,a) &&
      elina_abstract0_check_tcons_array(ELINA_FUNID_MEET_TCONS_ARRAY,man,dimension,array) ){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_MEET_TCONS_ARRAY];
    void* value = ptr(man,destructive,a->value,array);
    return elina_abstract0_cons2(man,destructive,a,value);
  }
  else {
    if (destructive) _elina_abstract0_free(a);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}

/* ============================================================ */
/* III.2 Assignment and Substitutions */
/* ============================================================ */

elina_abstract0_t* elina_abstract0_asssub_linexpr_array(elina_funid_t funid,
						  elina_manager_t* man,
						  bool destructive,
						  elina_abstract0_t* a,
						  elina_dim_t* tdim,
						  elina_linexpr0_t** texpr,
						  size_t size,
						  elina_abstract0_t* dest)
{
  if (size==0){
    if (dest){
      return elina_abstract0_meet(man,destructive,a,dest);
    }
    else if (destructive){
      return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(funid,man,a) &&
	(dest!=NULL ? (elina_abstract0_checkman1(funid,man,dest) && elina_abstract0_check_abstract2(funid,man,a,dest)) : true) &&
	elina_abstract0_check_dim_array(funid,man,dimension,tdim,size) &&
	elina_abstract0_check_linexpr_array(funid,man,dimension,texpr,size) ){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[funid];
      void* value = ptr(man,destructive,a->value,tdim,texpr,size,dest ? dest->value : NULL);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim,
			      dimension.realdim);
    }
  }
}
elina_abstract0_t* elina_abstract0_assign_linexpr_array(elina_manager_t* man,
						  bool destructive,
						  elina_abstract0_t* a,
						  elina_dim_t* tdim,
						  elina_linexpr0_t** texpr,
						  size_t size,
						  elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_linexpr_array(ELINA_FUNID_ASSIGN_LINEXPR_ARRAY,
					   man,destructive,a,tdim,texpr,size,dest);
}
elina_abstract0_t* elina_abstract0_substitute_linexpr_array(elina_manager_t* man,
						      bool destructive,
						      elina_abstract0_t* a,
						      elina_dim_t* tdim,
						      elina_linexpr0_t** texpr,
						      size_t size,
						      elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_linexpr_array(ELINA_FUNID_SUBSTITUTE_LINEXPR_ARRAY,
					   man,destructive,a,tdim,texpr,size,dest);
}
elina_abstract0_t* elina_abstract0_asssub_texpr_array(elina_funid_t funid,
						elina_manager_t* man,
						bool destructive,
						elina_abstract0_t* a,
						elina_dim_t* tdim,
						elina_texpr0_t** texpr,
						size_t size,
						elina_abstract0_t* dest)
{
  if (size==0){
    if (dest){
      return elina_abstract0_meet(man,destructive,a,dest);
    }
    else if (destructive){
      return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(funid,man,a) &&
	(dest!=NULL ? (elina_abstract0_checkman1(funid,man,dest) && elina_abstract0_check_abstract2(funid,man,a,dest)) : true) &&
	elina_abstract0_check_dim_array(funid,man,dimension,tdim,size) &&
	elina_abstract0_check_texpr_array(funid,man,dimension,texpr,size) ){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[funid];
      void* value = ptr(man,destructive,a->value,tdim,texpr,size,dest ? dest->value : NULL);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim,
			      dimension.realdim);
    }
  }
}
elina_abstract0_t* elina_abstract0_assign_texpr_array(elina_manager_t* man,
						bool destructive,
						elina_abstract0_t* a,
						elina_dim_t* tdim,
						elina_texpr0_t** texpr,
						size_t size,
						elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_texpr_array(ELINA_FUNID_ASSIGN_TEXPR_ARRAY,
					 man,destructive,a,tdim,texpr,size,dest);
}
elina_abstract0_t* elina_abstract0_substitute_texpr_array(elina_manager_t* man,
						    bool destructive,
						    elina_abstract0_t* a,
						    elina_dim_t* tdim,
						    elina_texpr0_t** texpr,
						    size_t size,
						    elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_texpr_array(ELINA_FUNID_SUBSTITUTE_TEXPR_ARRAY,
					 man,destructive,a,tdim,texpr,size,dest);
}

/* ============================================================ */
/* III.3 Projections */
/* ============================================================ */

elina_abstract0_t* elina_abstract0_forget_array(elina_manager_t* man,
					  bool destructive,
					  elina_abstract0_t* a,
					  elina_dim_t* tdim, size_t size,
					  bool project)
{
  if (size==0){
    if (destructive){
      return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(ELINA_FUNID_FORGET_ARRAY,man,a) &&
	elina_abstract0_check_dim_array(ELINA_FUNID_FORGET_ARRAY,man,dimension,tdim,size)){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_FORGET_ARRAY];
      void* value = ptr(man,destructive,a->value,tdim,size,project);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim,
			      dimension.realdim);
    }
  }
}

/* ============================================================ */
/* III.4 Change and permutation of dimensions */
/* ============================================================ */

elina_abstract0_t* elina_abstract0_add_dimensions(elina_manager_t* man,
					    bool destructive,
					    elina_abstract0_t* a,
					    elina_dimchange_t* dimchange,
					    bool project)
{
  if (dimchange->intdim+dimchange->realdim==0){
    if (destructive){
      return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(ELINA_FUNID_ADD_DIMENSIONS,man,a) &&
	elina_abstract0_check_elina_dimchange_add(ELINA_FUNID_ADD_DIMENSIONS,man,dimension,dimchange)){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_ADD_DIMENSIONS];
      void* value = ptr(man,destructive,a->value,dimchange,project);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim+dimchange->intdim,
			      dimension.realdim+dimchange->realdim);
    }
  }
}
elina_abstract0_t* elina_abstract0_remove_dimensions(elina_manager_t* man,
					       bool destructive,
					       elina_abstract0_t* a,
					       elina_dimchange_t* dimchange)
{
  if (dimchange->intdim+dimchange->realdim==0){
    if (destructive){
      return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(ELINA_FUNID_REMOVE_DIMENSIONS,man,a) &&
	elina_abstract0_check_elina_dimchange_remove(ELINA_FUNID_REMOVE_DIMENSIONS,man,dimension,dimchange)){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_REMOVE_DIMENSIONS];
      void* value = ptr(man,destructive,a->value,dimchange);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim>=dimchange->intdim ? dimension.intdim-dimchange->intdim : 0,
			      dimension.realdim>=dimchange->realdim ? dimension.realdim-dimchange->realdim : 0);
    }
  }
}
elina_abstract0_t* elina_abstract0_permute_dimensions(elina_manager_t* man,
						bool destructive,
						elina_abstract0_t* a,
						elina_dimperm_t* perm)
{
  elina_dimension_t dimension = _elina_abstract0_dimension(a);
  if (elina_abstract0_checkman1(ELINA_FUNID_PERMUTE_DIMENSIONS,man,a) &&
      elina_abstract0_check_dimperm(ELINA_FUNID_PERMUTE_DIMENSIONS,man,dimension,perm)){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_PERMUTE_DIMENSIONS];
    void* value = ptr(man,destructive,a->value,perm);
    return elina_abstract0_cons2(man,destructive,a,value);
  }
  else {
    if (destructive) _elina_abstract0_free(a);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}

/* ============================================================ */
/* III.5 Expansion and folding of dimensions */
/* ============================================================ */
elina_abstract0_t* elina_abstract0_expand(elina_manager_t* man,
				    bool destructive,
				    elina_abstract0_t* a,
				    elina_dim_t dim,
				    size_t n)
{

  if (n==0){
    if (destructive){
	return a;
    }
    else {
      return elina_abstract0_copy(man,a);
    }
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a);
    if (elina_abstract0_checkman1(ELINA_FUNID_EXPAND,man,a) &&
	elina_abstract0_check_dim(ELINA_FUNID_EXPAND,man,dimension,dim)){
      void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_EXPAND];
      void* value = ptr(man,destructive,a->value,dim,n);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
    else {
      if (destructive) _elina_abstract0_free(a);
      return elina_abstract0_top(man,
			      dimension.intdim + (dim<dimension.intdim ? n : 0),
			      dimension.realdim + (dim<dimension.intdim ? 0 : n));
    }
  }
}
elina_abstract0_t* elina_abstract0_fold(elina_manager_t* man,
				  bool destructive,
				  elina_abstract0_t* a,
				  elina_dim_t* tdim,
				  size_t size)
{
  elina_dimension_t dimension = _elina_abstract0_dimension(a);
  if (elina_abstract0_checkman1(ELINA_FUNID_FOLD,man,a) &&
      elina_abstract0_check_dim_array(ELINA_FUNID_FOLD,man,dimension,tdim,size)){
    if (size==0){
	elina_manager_raise_exception(man,
				   ELINA_EXC_INVALID_ARGUMENT,
				   ELINA_FUNID_FOLD,
				   "The array of dimension is empty");
	goto _elina_abstract0_fold_exc;
    }
    /* Check also that the array is sorted and contains only integer or real
       dimensions */
    size_t i;
    for (i=1;i<size; i++){
      if (tdim[i-1]>=tdim[i]){
	elina_manager_raise_exception(man,
				   ELINA_EXC_INVALID_ARGUMENT,
				   ELINA_FUNID_FOLD,
				   "The array of dimension is not sorted");
	goto _elina_abstract0_fold_exc;
      }
    }
    if (tdim[0]<dimension.intdim && tdim[size-1]>=dimension.intdim){
      elina_manager_raise_exception(man,
				 ELINA_EXC_INVALID_ARGUMENT,
				 ELINA_FUNID_FOLD,
				 "Mixed integer and real dimensions in the array");
      goto _elina_abstract0_fold_exc;
    }
    /* OK now */
    if (size==1){
      if (destructive){
	return a;
      }
      else {
	void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_COPY];
	return elina_abstract0_cons(man,ptr(man,a->value));
      }
    }
    else {
      void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_FOLD];
      void* value = ptr(man,destructive,a->value,tdim,size);
      return elina_abstract0_cons2(man,destructive,a,value);
    }
  }
  else {
  _elina_abstract0_fold_exc:
    if (destructive) _elina_abstract0_free(a);
    return elina_abstract0_top(man,
			    dimension.intdim - ( (size>0 && tdim[0]<dimension.intdim) ? (size-1) : 0),
			    dimension.realdim - ( (size>0 && tdim[0]<dimension.intdim) ? 0 : (size-1)));
  }
}
/* ============================================================ */
/* III.6 Widening */
/* ============================================================ */
elina_abstract0_t* elina_abstract0_widening(elina_manager_t* man,
				      elina_abstract0_t* a1, elina_abstract0_t* a2)
{
  if (elina_abstract0_checkman2(ELINA_FUNID_WIDENING,man,a1,a2) &&
      elina_abstract0_check_abstract2(ELINA_FUNID_WIDENING,man,a1,a2)){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_WIDENING];
    void* value = ptr(man,a1->value,a2->value);
    return elina_abstract0_cons(man,value);
  }
  else {
    elina_dimension_t dimension = _elina_abstract0_dimension(a1);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}

/* ============================================================ */
/* III.7 Closure operation */
/* ============================================================ */
elina_abstract0_t* elina_abstract0_closure(elina_manager_t* man, bool destructive, elina_abstract0_t* a)
{
  elina_dimension_t dimension = _elina_abstract0_dimension(a);
  if (elina_abstract0_checkman1(ELINA_FUNID_CLOSURE,man,a)){
    void* (*ptr)(elina_manager_t*,...) = man->funptr[ELINA_FUNID_CLOSURE];
    void* value = ptr(man,destructive,a->value);
    return elina_abstract0_cons2(man,destructive,a,value);
  }
  else {
    if (destructive) _elina_abstract0_free(a);
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}

/* ********************************************************************** */
/* IV. Functions offered by the ELINA interface */
/* ********************************************************************** */

/* These functions do not correspond to functions in the underlying library. */

/*
   These two functions implement of_lincons/tcons_array constructors
   using top and meet_lincons/tcons_array operations.
*/
elina_abstract0_t* elina_abstract0_of_lincons_array(elina_manager_t* man,
					      size_t intdim, size_t realdim,
					      elina_lincons0_array_t* array)
{
  elina_abstract0_t* res = elina_abstract0_top(man,intdim,realdim);
  res = elina_abstract0_meet_lincons_array(man,true,res,array);
  return res;
}
elina_abstract0_t* elina_abstract0_of_tcons_array(elina_manager_t* man,
				  size_t intdim, size_t realdim,
				  elina_tcons0_array_t* array)
{
  elina_abstract0_t* res = elina_abstract0_top(man,intdim,realdim);
  res = elina_abstract0_meet_tcons_array(man,true,res,array);
  return res;
}

/*
  These four functions implement assignment and substitution of a single
  dimension by a single expression.
*/
elina_abstract0_t* elina_abstract0_assign_linexpr(elina_manager_t* man,
					    bool destructive,
					    elina_abstract0_t* a,
					    elina_dim_t dim, elina_linexpr0_t* expr,
					    elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_linexpr_array(ELINA_FUNID_ASSIGN_LINEXPR_ARRAY,
					   man,destructive,a,&dim,&expr,1,dest);
}
elina_abstract0_t* elina_abstract0_substitute_linexpr(elina_manager_t* man,
						bool destructive,
						elina_abstract0_t* a,
						elina_dim_t dim, elina_linexpr0_t* expr,
						elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_linexpr_array(ELINA_FUNID_SUBSTITUTE_LINEXPR_ARRAY,
					   man,destructive,a,&dim,&expr,1,dest);
}
elina_abstract0_t* elina_abstract0_assign_texpr(elina_manager_t* man,
					  bool destructive,
					  elina_abstract0_t* a,
					  elina_dim_t dim, elina_texpr0_t* expr,
					  elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_texpr_array(ELINA_FUNID_ASSIGN_TEXPR_ARRAY,
					 man,destructive,a,&dim,&expr,1,dest);
}
elina_abstract0_t* elina_abstract0_substitute_texpr(elina_manager_t* man,
					      bool destructive,
					      elina_abstract0_t* a,
					      elina_dim_t dim, elina_texpr0_t* expr,
					      elina_abstract0_t* dest)
{
  return elina_abstract0_asssub_texpr_array(ELINA_FUNID_SUBSTITUTE_TEXPR_ARRAY,
					 man,destructive,a,&dim,&expr,1,dest);
}

/* Applying an elina_dimchange2_t transformation (dimension adding followed by
   dimension removal/projection).  If project is true, the newly added
   dimension are projected on their 0-hyperplane. */
elina_abstract0_t* elina_abstract0_apply_dimchange2(elina_manager_t* man,
					      bool destructive,
					      elina_abstract0_t* a, elina_dimchange2_t* dimchange2,
					      bool project)
{
  elina_abstract0_t* res;
  if (dimchange2->add){
    res = elina_abstract0_add_dimensions(man,destructive,a,dimchange2->add,project);
    if (dimchange2->remove){
      res = elina_abstract0_remove_dimensions(man,true,res,dimchange2->remove);
    }
  }
  else if (dimchange2->remove){
    res = elina_abstract0_remove_dimensions(man,destructive,a,dimchange2->remove);
  }
  else {
    res = destructive ? a : elina_abstract0_copy(man,a);
  }
  return res;
}

/* This function implements widening with threshold, relying on the
   widening, sat_lincons and meet_lincons_array operations.
*/
elina_abstract0_t* elina_abstract0_widening_threshold(elina_manager_t* man,
						elina_abstract0_t* a1,
						elina_abstract0_t* a2,
						elina_lincons0_array_t* array)
{
  void* (*ptr)(elina_manager_t*,...);
  bool (*ptr2)(elina_manager_t*,...);
  void* value;
  size_t i,j,size;
  elina_lincons0_t tmp;

  elina_dimension_t dimension = _elina_abstract0_dimension(a1);
  if (elina_abstract0_checkman2(ELINA_FUNID_WIDENING,man,a1,a2) &&
      elina_abstract0_check_abstract2(ELINA_FUNID_WIDENING,man,a1,a2) &&
      elina_abstract0_check_lincons_array(ELINA_FUNID_WIDENING,man,dimension,array) ){
    ptr = man->funptr[ELINA_FUNID_WIDENING];
    value = ptr(man,a1->value,a2->value);

    ptr2 = man->funptr[ELINA_FUNID_SAT_LINCONS];
    size = array->size;
    i = j = 0;
    while (i<size-j){
      if (ptr2(man,a2->value,&array->p[i])){
	i++;
      }
      else {
	j++;
	tmp = array->p[i];
	array->p[i] = array->p[array->size-j];
	array->p[array->size-j] = tmp;
      }
    }
    if (i>0){
      array->size = i;
      ptr = man->funptr[ELINA_FUNID_MEET_LINCONS_ARRAY];
      value = ptr(man,true,value,array);
      array->size = size;
    }
    return elina_abstract0_cons(man,value);
  }
  else {
    return elina_abstract0_top(man,
			    dimension.intdim,
			    dimension.realdim);
  }
}


text:
package com.amazonservices.mws.orders.model;

import com.amazonservices.mws.client.*;

/**
 * ListOrdersByNextTokenRequest complex type.
 *
 * XML schema:
 *
 * <pre>
 * <complexType name="ListOrdersByNextTokenRequest">
 *    <complexContent>
 *       <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *          <sequence>
 *             <element name="SellerId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *             <element name="MWSAuthToken" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *             <element name="NextToken" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *          </sequence>
 *       </restriction>
 *    </complexContent>
 * </complexType>
 * </pre>
 */
public class ListOrdersByNextTokenRequest extends AbstractMwsObject {

    private String sellerId;

    private String mwsAuthToken;

    private String nextToken;

    /**
     * Get the value of SellerId.
     *
     * @return The value of SellerId.
     */
    public String getSellerId() {
        return sellerId;
    }

    /**
     * Set the value of SellerId.
     *
     * @param sellerId
     *            The new value to set.
     */
    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    /**
     * Check to see if SellerId is set.
     *
     * @return true if SellerId is set.
     */
    public boolean isSetSellerId() {
        return sellerId != null;
    }

    /**
     * Set the value of SellerId, return this.
     *
     * @param sellerId
     *             The new value to set.
     *
     * @return This instance.
     */
    public ListOrdersByNextTokenRequest withSellerId(String sellerId) {
        this.sellerId = sellerId;
        return this;
    }

    /**
     * Get the value of MWSAuthToken.
     *
     * @return The value of MWSAuthToken.
     */
    public String getMWSAuthToken() {
        return mwsAuthToken;
    }

    /**
     * Set the value of MWSAuthToken.
     *
     * @param mwsAuthToken
     *            The new value to set.
     */
    public void setMWSAuthToken(String mwsAuthToken) {
        this.mwsAuthToken = mwsAuthToken;
    }

    /**
     * Check to see if MWSAuthToken is set.
     *
     * @return true if MWSAuthToken is set.
     */
    public boolean isSetMWSAuthToken() {
        return mwsAuthToken != null;
    }

    /**
     * Set the value of MWSAuthToken, return this.
     *
     * @param mwsAuthToken
     *             The new value to set.
     *
     * @return This instance.
     */
    public ListOrdersByNextTokenRequest withMWSAuthToken(String mwsAuthToken) {
        this.mwsAuthToken = mwsAuthToken;
        return this;
    }

    /**
     * Get the value of NextToken.
     *
     * @return The value of NextToken.
     */
    public String getNextToken() {
        return nextToken;
    }

    /**
     * Set the value of NextToken.
     *
     * @param nextToken
     *            The new value to set.
     */
    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     * Check to see if NextToken is set.
     *
     * @return true if NextToken is set.
     */
    public boolean isSetNextToken() {
        return nextToken != null;
    }

    /**
     * Set the value of NextToken, return this.
     *
     * @param nextToken
     *             The new value to set.
     *
     * @return This instance.
     */
    public ListOrdersByNextTokenRequest withNextToken(String nextToken) {
        this.nextToken = nextToken;
        return this;
    }

    /**
     * Read members from a MwsReader.
     *
     * @param r
     *      The reader to read from.
     */
    @Override
    public void readFragmentFrom(MwsReader r) {
        sellerId = r.read("SellerId", String.class);
        mwsAuthToken = r.read("MWSAuthToken", String.class);
        nextToken = r.read("NextToken", String.class);
    }

    /**
     * Write members to a MwsWriter.
     *
     * @param w
     *      The writer to write to.
     */
    @Override
    public void writeFragmentTo(MwsWriter w) {
        w.write("SellerId", sellerId);
        w.write("MWSAuthToken", mwsAuthToken);
        w.write("NextToken", nextToken);
    }

    /**
     * Write tag, xmlns and members to a MwsWriter.
     *
     * @param w
     *         The Writer to write to.
     */
    @Override
    public void writeTo(MwsWriter w) {
        w.write("http://internal.amazon.com/coral/com.amazon.maws.coral/", "ListOrdersByNextTokenRequest",this);
    }

    /** Value constructor. */
    public ListOrdersByNextTokenRequest(String sellerId,String nextToken) {
        this.sellerId = sellerId;
        this.nextToken = nextToken;
    }

    /** Default constructor. */
    public ListOrdersByNextTokenRequest() {
        super();
    }

}

redpajama_set_name: RedPajamaGithub


text:
//
//  CMPConsentToolViewController.h
//  CMPConsentTool
//

#import <UIKit/UIKit.h>
#import "CMPSettings.h"

@class CMPConsentViewController;
@protocol CMPConsentViewControllerDelegate <NSObject>
- (void)consentToolViewController:(CMPConsentViewController *)consentToolViewController didReceiveConsentString:(NSString*)consentString;
- (void)consentToolViewController:(CMPConsentViewController *)consentToolViewController didReceiveURL:(NSURL *)url;
@end

@interface CMPConsentViewController : UIViewController

/**
 NSURL that is used to create and load the request into the WKWebView – it is the request for the consent webpage. This property is mandatory.
 */

/**
 Object that provides the API for storing and retrieving GDPR-related information
 */
@property (nonatomic, retain) CMPSettings *cmpSettings;

/**
 Optional delegate to receive callbacks from the CMP web tool
 */
@property (nonatomic, weak) id<CMPConsentViewControllerDelegate> delegate;
@end


text:
/*******************************************************************************
  Global event source file

  Company:
    Microchip Technology Inc.

  File Name:
    global_event.h

  Summary:
    Global event source file

  Description:
    Global event source file
*******************************************************************************/

//DOM-IGNORE-BEGIN
/*******************************************************************************
Copyright (c) 2016 released Microchip Technology Inc.  All rights reserved.

Microchip licenses to you the right to use, modify, copy and distribute Software
only when embedded on a Microchip microcontroller or digital  signal  controller
that is integrated into your product or third party  product  (pursuant  to  the
sublicense terms in the accompanying license agreement).

You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.

SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS  WITHOUT  WARRANTY  OF  ANY  KIND,
EITHER EXPRESS  OR  IMPLIED,  INCLUDING  WITHOUT  LIMITATION,  ANY  WARRANTY  OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A  PARTICULAR  PURPOSE.
IN NO EVENT SHALL MICROCHIP OR  ITS  LICENSORS  BE  LIABLE  OR  OBLIGATED  UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION,  BREACH  OF  WARRANTY,  OR
OTHER LEGAL  EQUITABLE  THEORY  ANY  DIRECT  OR  INDIRECT  DAMAGES  OR  EXPENSES
INCLUDING BUT NOT LIMITED TO ANY  INCIDENTAL,  SPECIAL,  INDIRECT,  PUNITIVE  OR
CONSEQUENTIAL DAMAGES, LOST  PROFITS  OR  LOST  DATA,  COST  OF  PROCUREMENT  OF
SUBSTITUTE  GOODS,  TECHNOLOGY,  SERVICES,  OR  ANY  CLAIMS  BY  THIRD   PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE  THEREOF),  OR  OTHER  SIMILAR  COSTS.
*******************************************************************************/
//DOM-IGNORE-END

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "global_event.h"

// *****************************************************************************
// *****************************************************************************
// Section: Data Declarations
// *****************************************************************************
// *****************************************************************************

global_events_t global_events = {false};

// *****************************************************************************
// *****************************************************************************
// Section: Global functions.
// *****************************************************************************
// *****************************************************************************

bool global_event_triggered(bool *pEvent)
{
    if (*pEvent >0)
    {
        (*pEvent)--;
        return true;
    }

    return false;
}

/*******************************************************************************
 End of File
*/


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Phyllosticta apii Halst.

### Remarks
null


text:
TESTLIB void test1()
{
	printf("hello from test1 !\n");
}


text:
package de.iritgo.aktera.base.database;

import de.iritgo.aktera.configuration.preferences.KeelPreferencesManager;
import de.iritgo.aktera.event.EventManager;
import de.iritgo.aktera.model.Model;
import de.iritgo.aktera.model.ModelException;
import de.iritgo.aktera.model.ModelRequest;
import de.iritgo.aktera.model.ModelResponse;
import de.iritgo.aktera.model.Output;
import de.iritgo.aktera.persist.ModuleVersion;
import de.iritgo.aktera.persist.PersistenceException;
import de.iritgo.aktera.persist.Persistent;
import de.iritgo.aktera.persist.PersistentFactory;
import de.iritgo.aktera.persist.PersistentMetaData;
import de.iritgo.aktera.persist.UpdateHandler;
import de.iritgo.aktera.spring.SpringTools;
import de.iritgo.aktera.tools.SystemTools;
import de.iritgo.simplelife.process.NullStreamHandler;
import org.apache.avalon.excalibur.datasource.DataSourceComponent;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.Logger;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.commons.dbutils.DbUtils;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.List;
import java.util.Properties;

/**
 *
 */
public class UpdateHelper
{
	public static boolean updateChecked = false;

	public static boolean updateNeeded = false;

	synchronized public static boolean needUpdate(ModelRequest req) throws ModelException, ConfigurationException
	{
		if (updateChecked)
		{
			return updateNeeded;
		}

		createVersionTableIfNotExists(req);

		PersistentFactory pf = (PersistentFactory) req.getService(PersistentFactory.ROLE, req.getDomain());

		List<Configuration> moduleConfigs = de.iritgo.aktera.base.module.ModuleInfo
						.moduleConfigsSortedByDependency(req);

		for (Configuration moduleConfig : moduleConfigs)
		{
			String moduleId = moduleConfig.getAttribute("id", "unkown");
			ModuleVersion newVersion = new ModuleVersion(moduleConfig.getChild("version").getValue());

			ModuleVersion currentVersion = new ModuleVersion();

			try
			{
				Persistent version = pf.create("aktera.Version");

				version.setField("type", "M");
				version.setField("name", moduleId);

				if (version.find())
				{
					currentVersion = new ModuleVersion(version.getFieldString("version"));
				}
				else
				{
					currentVersion = new ModuleVersion("0.0.0");
				}
			}
			catch (Exception x)
			{
			}

			if (newVersion.greater(currentVersion))
			{
				updateChecked = true;
				updateNeeded = true;

				return true;
			}
		}

		updateChecked = true;
		updateNeeded = false;

		return false;
	}

	public static void createVersionTableIfNotExists(ModelRequest request) throws ModelException
	{
		PersistentFactory pf = (PersistentFactory) request.getService(PersistentFactory.ROLE, request.getDomain());

		Persistent version = null;

		try
		{
			version = pf.create("aktera.Version");
			version.setField("type", "M");
			version.setField("name", "dummy");
			version.find();
		}
		catch (Exception x)
		{
			try
			{
				PersistentMetaData versionMeta = version.getMetaData();

				versionMeta.getDatabaseType().createTable(versionMeta, versionMeta.getDataSource());
			}
			catch (PersistenceException xx)
			{
				throw new ModelException(xx);
			}
		}
	}

	public static void update(ModelRequest request, ModelResponse response, Logger logger)
		throws ModelException, ServiceException
	{
		Output outModuleList = response.createOutput("modules");

		response.add(outModuleList);

		PersistentFactory pf = (PersistentFactory) request.getService(PersistentFactory.ROLE, request.getDomain());

		DataSourceComponent dataSourceComponent = (DataSourceComponent) request.getService(DataSourceComponent.ROLE,
						"keel-dbpool");

		updatePreProcessing(request, dataSourceComponent);

		boolean needReboot = false;
		boolean newUserPreferences = false;

		List<Configuration> moduleConfigs = de.iritgo.aktera.base.module.ModuleInfo
						.moduleConfigsSortedByDependency(request);

		for (Configuration moduleConfig : moduleConfigs)
		{
			String moduleId = moduleConfig.getAttribute("id", "unkown");
			String moduleName = moduleConfig.getChild("name").getValue("unkown");
			ModuleVersion newVersion = new ModuleVersion(moduleConfig.getChild("version").getValue(null));

			Output outModule = response.createOutput("module_" + moduleConfig.getAttribute("id", "unknown"));

			outModuleList.add(outModule);
			outModule.setAttribute("name", moduleName);
			outModule.setAttribute("description", moduleConfig.getChild("description").getValue(""));
			outModule.setAttribute("newVersion", newVersion.toString());

			ModuleVersion currentVersion = new ModuleVersion();

			try
			{
				Persistent version = pf.create("aktera.Version");

				version.setField("type", "M");
				version.setField("name", moduleId);

				if (version.find())
				{
					currentVersion = new ModuleVersion(version.getFieldString("version"));
				}
				else
				{
					currentVersion = new ModuleVersion("0.0.0");
				}
			}
			catch (Exception x)
			{
				outModule.setAttribute("oldVersion", currentVersion.toString());
				outModule.setAttribute("error", "unableToRetrieveCurrentVersion");
				outModule.setAttribute("errorException", x.toString());

				response.addOutput("updateError", "Y");

				continue;
			}

			outModule.setAttribute("oldVersion", currentVersion.toString());

			String updateHandlerClassName = moduleConfig.getChild("update").getAttribute("class", null);

			if (updateHandlerClassName != null)
			{
				try
				{
					System.out.println("UpdateDatabase: Updating module '" + moduleId + "' with handler '"
									+ updateHandlerClassName + "'");

					Class klass = Class.forName(updateHandlerClassName);

					if (klass != null)
					{
						UpdateHandler updateHandler = (UpdateHandler) klass.newInstance();

						Connection con = null;

						try
						{
							con = dataSourceComponent.getConnection();
							updateHandler.setConnection(con);
							updateHandler.updateDatabase(request, logger, con, pf, (ModuleVersion) currentVersion
											.clone(), newVersion);
						}
						finally
						{
							con.close();
						}

						needReboot = needReboot || updateHandler.needReboot();
						newUserPreferences = newUserPreferences || updateHandler.hasNewUserPreferences();
					}
					else
					{
						System.out.println("UpdateDatabase: Unable to find update handler for module '" + moduleId
										+ "'");
					}
				}
				catch (ClassNotFoundException x)
				{
					System.out
									.println("UpdateDatabase: Unable call update handler for module '" + moduleId
													+ "': " + x);
				}
				catch (Exception x)
				{
					outModule.setAttribute("error", "errorDuringUpdate");
					outModule.setAttribute("errorException", x.toString());

					response.addOutput("updateError", "Y");

					continue;
				}
			}

			try
			{
				Persistent version = pf.create("aktera.Version");

				version.setField("type", "M");
				version.setField("name", moduleId);

				if (version.find())
				{
					version.setField("version", newVersion.toString());
					version.update();
				}
				else
				{
					version.setField("version", newVersion.toString());
					version.add();
				}
			}
			catch (Exception x)
			{
				outModule.setAttribute("error", "unableToUpdateVersion");
				outModule.setAttribute("errorException", x.toString());
				response.addOutput("updateError", "Y");
			}
		}

		if (newUserPreferences)
		{
			try
			{
				Persistent sample = pf.create("keel.user");

				for (Persistent user : sample.query())
				{
					KeelPreferencesManager.createDefaultValues(request, user.getFieldInt("uid"));
				}
			}
			catch (PersistenceException x)
			{
				response.addOutput("updateError", "Y");
				response.addOutput("databaseError", x.getMessage());

				StringWriter stw = new StringWriter();
				PrintWriter pw = new PrintWriter(stw);

				x.printStackTrace(pw);
				response.addOutput("databaseErrorStackTrace", stw.getBuffer().toString().replaceAll("\n", "<br>"));
			}
		}

		if (response.get("updateError") == null)
		{
			try
			{
				Model appInfo = (Model) request.getService(Model.ROLE, "aktera.app-info");

				Configuration[] appConfigs = appInfo.getConfiguration().getChildren("app");

				for (int i = 0; i < appConfigs.length; ++i)
				{
					Configuration appConfig = appConfigs[i];

					Persistent version = pf.create("aktera.Version");

					version.setField("type", "A");
					version.setField("name", appConfig.getAttribute("id", "unkown"));

					if (version.find())
					{
						version.setField("version", appConfig.getChild("version").getValue("0.0.0"));
						version.update();
					}
					else
					{
						version.setField("version", appConfig.getChild("version").getValue("0.0.0"));
						version.add();
					}
				}
			}
			catch (Exception x)
			{
				System.out.println(x.toString());
			}
		}

		updatePostProcessing(request, dataSourceComponent);

		if (response.get("updateError") == null)
		{
			updateChecked = false;
			updateNeeded = false;

			if (needReboot)
			{
				response.addOutput("needReboot", "Y");

				try
				{
					new Thread()
					{
						public void run()
						{
							try
							{
								sleep(5000);

								Process proc = SystemTools.startAkteraProcess("/usr/bin/sudo", "/sbin/shutdown -r now");

								new NullStreamHandler(proc.getInputStream());
								new NullStreamHandler(proc.getErrorStream());
							}
							catch (Exception x)
							{
							}
						}
					}.start();
				}
				catch (Exception x)
				{
				}
			}
		}
	}

	private static void updatePreProcessing(ModelRequest request, DataSourceComponent dataSourceComponent)
	{
		Connection connection = null;

		try
		{
			connection = dataSourceComponent.getConnection();
			UpdateHandler handler = new UpdateHandler();
			handler.setConnection(connection);
			handler.update("ALTER TABLE version ALTER COLUMN name TYPE varchar(255)");
			handler.update("UPDATE version set name='iritgo-aktera-address' where name='svc-address' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-aktario' where name='svc-aktario' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-authentication' where name='svc-authentication-persist' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-authorization' where name='svc-authorization-persist' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-base' where name='aktera' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-configuration' where name='svc-configuration' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-crypto-bas64' where name='svc-crypto-base64' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-email' where name='svc-email' and type='M'");
			handler.update("DELETE FROM version where name='svc-mail-javamail' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-event' where name='svc-event' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-fsm' where name='svc-fsm' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-hibernate' where name='svc-persist-hibernate' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-i18n' where name='svc-i18n' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-importer' where name='svc-importer' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-jpassgen' where name='svc-password-jpassgen' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-logger' where name='svc-logger' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-model' where name='svc-model-default' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-permissions' where name='svc-permissions' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-persist-base' where name='svc-persist-base' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-persist-default' where name='svc-persist-default' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-query-jdbc' where name='svc-query-jdbc' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-reporting' where name='svc-reporting' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-scheduler' where name='svc-scheduler' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-script' where name='svc-script' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-spring' where name='svc-spring' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-startup' where name='svc-startup' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-tools' where name='svc-tools' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera-ui' where name='svc-ui' and type='M'");
			handler
							.update("UPDATE version set name='iritgo-aktera-usergroup' where name='svc-usergroup-persist' and type='M'");
			handler.update("UPDATE version set name='iritgo-aktera' where name='iritgo' and type='A'");
			handler.update("UPDATE version set name='system' where name='system' and type='A'");
		}
		catch (Exception x)
		{
			System.out.println("[UpdateHelper.updatePreProcessing] Error: " + x.getMessage());
			x.printStackTrace();
		}
		finally
		{
			DbUtils.closeQuietly(connection);
		}

		EventManager em = (EventManager) SpringTools.getBean(EventManager.ID);
		Properties props = new Properties();

		props.put("request", request);
		props.put("datasource", dataSourceComponent);
		em.fire("aktera.database.update.pre", request, props);
	}

	private static void updatePostProcessing(ModelRequest request, DataSourceComponent dataSourceComponent)
	{
		EventManager em = (EventManager) SpringTools.getBean(EventManager.ID);
		Properties props = new Properties();

		props.put("request", request);
		props.put("datasource", dataSourceComponent);
		em.fire("aktera.database.update.post", request, props);
	}

	public static boolean databaseExists(ModelRequest request)
	{
		Connection connection = null;
		Statement stmt = null;
		ResultSet res = null;

		try
		{
			DataSourceComponent dataSourceComponent = (DataSourceComponent) request.getService(
							DataSourceComponent.ROLE, "keel-dbpool");

			connection = dataSourceComponent.getConnection();
			stmt = connection.createStatement();
			res = stmt
							.executeQuery("SELECT value FROM systemconfig where name = 'databaseCreated' and category = 'system'");

			if (res.next())
			{
				return "true".equals(res.getString("value"));
			}

			return false;
		}
		catch (Exception x)
		{
			System.out.println("[UpdateHelper.databaseExists] Error: " + x.getMessage());
		}
		finally
		{
			DbUtils.closeQuietly(res);
			DbUtils.closeQuietly(stmt);
			DbUtils.closeQuietly(connection);
		}

		return false;
	}
}


text:
<?php

namespace Jazz\Application\Finder\Prepare;

require_once ('Jazz/Application/Finder/APrepare.php');

/**
 * Classes Preparation Finder Class
 *
 * @package Jazz
 * @subpackage Finder
 * @author Michael Luster <phpjazz@nyclagniappe.com>
 * @copyright Copyright (c) NYCLagniappe.com - All Rights Reserved
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @link https://github.com/nyclagniappe/phpjazz
 */

class Classes extends \Jazz\Application\Finder\APrepare {

    /** ACTION METHODS **/
    /**
     * Setup the Application Paths
     * @param \Jazz\Application\ISettings $settings
     * @param \Jazz\Loader\IEngine $engine
     */
    public function setupApplication(\Jazz\Application\ISettings $settings
                                    , \Jazz\Loader\IEngine $engine) {
        $engine->setIsClass(true);
        $engine->setReturnClassName(true);

        $path = $this->formatApplicationPath($settings);
        if (file_exists($path)) {
            $ns = $settings->getNamespaceApplication()
                    . $settings->getApplication()
                    . $settings->getSeparator();
            $engine->appendPath(new \Jazz\Loader\Path($path, $ns, null, null, 'php', $settings->getSeparator()));
        }

        $path = $this->formatLibraryPath($settings);
        if (file_exists($path)) {
            $ns = $settings->getNamespaceLibrary();
            $engine->appendPath(new \Jazz\Loader\Path($path, $ns, null, null, 'php', $settings->getSeparator()));
        }
    }

    /**
     * Setup the Component Paths
     * @param \Jazz\Application\ISettings $settings
     * @param \Jazz\Loader\IEngine $engine
     * @param string $name
     */
    public function setupComponent(\Jazz\Application\ISettings $settings
                                , \Jazz\Loader\IEngine $engine
                                , $name) {
        $engine->setIsClass(true);
        $engine->setReturnClassName(true);

        $path = $this->formatComponentPath($settings, $name);
        if (file_exists($path)) {
            $ns = $settings->getNamespaceComponent() . $name . $settings->getSeparator();
            $engine->appendPath(new \Jazz\Loader\Path($path, $ns, null, null, 'php', $settings->getSeparator()));
        }

        $path = $this->formatLibraryPath($settings);
        if (file_exists($path)) {
            $ns = ($settings->getNamespaceLibrary()
                    ? $settings->getNamespaceLibrary() . $settings->getSeparator()
                    : null);
            $engine->appendPath(new \Jazz\Loader\Path($path, $ns, null, null, 'php', $settings->getSeparator()));
        }
    }

}


text:
#include <mrpt/reactivenav.h>  // Precomp header

#include <mrpt/system/threads.h>

using namespace mrpt::reactivenav;
using namespace mrpt::synch;
using namespace mrpt::utils;
using namespace mrpt::system;
using namespace std;

/* --------------------------------------------------------
					thread_path_tracking

	Kalman-Filter tracking of the current robot state
   -------------------------------------------------------- */
void CPRRTNavigator::thread_path_tracking()
{
	// Set highest priority
	mrpt::system::changeCurrentProcessPriority(ppVeryHigh);
	mrpt::system::changeThreadPriority( mrpt::system::getCurrentThreadHandle(),tpHighest );

	cout << "[CPRRTNavigator:thread_path_tracking] Thread alive.\n";

	const double DESIRED_RATE = 15.0;
	const double DESIRED_PERIOD = 1.0/DESIRED_RATE;

	TTimeStamp  tim_last_iter = INVALID_TIMESTAMP;

	// Buffered data:
	TPathData	next_planned_point;  // target
	TTimeStamp	planned_path_time = INVALID_TIMESTAMP;

	while (!m_closingThreads)
	{
		if ( !m_initialized )  // Do nothing until we're loaded and ready.
		{
			mrpt::system::sleep(100);
			continue;
		}

		// Acquire the latest path plan --------------
		{
			CCriticalSectionLocker lock(& m_planned_path_cs );
			if (m_planned_path_time==INVALID_TIMESTAMP || m_planned_path.empty())
			{
				// There's no plan: Stop the robot:
				planned_path_time = INVALID_TIMESTAMP;
			}
			else  // Only update our copy if needed:
			{
				planned_path_time = m_planned_path_time;
				next_planned_point = m_planned_path.front();
			}
		} // end of CS

		// Path following ------------------------------
		if (planned_path_time == INVALID_TIMESTAMP)
		{
			// Stop the robot, now.
			onMotionCommand(0,0);
		}
		else
		{
			const bool ignore_trg_heading = INVALID_HEADING==next_planned_point.p.phi;

			// Acquire the current estimate of the robot state:
			// ----------------------------------------------------
			TPose2D  robotPose;
			float    robot_v,robot_w;
			if (!m_robotStateFilter.getCurrentEstimate(robotPose,robot_v,robot_w)) // Thread-safe call
			{
				// Error: Stop the robot, now.
				onMotionCommand(0,0);
			}
			else
			{	// we have proper localization

				// ==============================================================================
				// We want to approach to "next_planned_point"
				//   - Apply a sequence of tests to discover the shortests & easiest movement
				//      to that target.
				// ==============================================================================
				// Compute target in coordinates relative to the robot just now:
				const CPose2D trg_rel = CPose2D(next_planned_point.p) - CPose2D(robotPose);

//				if (next_planned_point.p.y==-1)	{
//					int a=0;
//				}

				// Current distances to target:
				const double trg_dist_lin = trg_rel.norm();
				const double trg_dist_ang = std::abs(trg_rel.phi());

				// Remaining Estimated Time for Arrival
				double ETA_target;
				if (std::abs(robot_v)>1e-4)
						ETA_target = std::max(0.05, (trg_dist_lin-params.pathtrack.radius_checkpoints)/std::abs(robot_v) );
				else if (std::abs(robot_w)>1e-4)
						ETA_target = trg_dist_ang/std::abs(robot_w);
				else	ETA_target = 1000.0;

				//cout << format("ETA: %f\n",ETA_target);
				//cout << format("d_lin=%f d_ang=%f\n",trg_dist_lin,RAD2DEG(trg_dist_ang));

				// If we have reached one point, remove it from the front of the list:
				if ((trg_dist_lin<params.pathtrack.radius_checkpoints || trg_dist_lin<std::abs(robot_v)*3*DESIRED_PERIOD )&&
					(ignore_trg_heading || trg_dist_ang<DEG2RAD(10) || trg_dist_ang<std::abs(robot_w)*3*DESIRED_PERIOD )
					)
				{
					CCriticalSectionLocker lock(& m_planned_path_cs );
					if (m_planned_path_time==planned_path_time)
						m_planned_path.pop_front();
				}
				else
				{
					// ------------------------------------------------------------------------------------
					//   CASE 1: Direct arc.
					//     (tx,ty,ta) all are compatible with a direct arc from our current pose
					// ------------------------------------------------------------------------------------
					bool   good_cmd_found = false;
					double good_cmd_v=0,good_cmd_w=0;

					{
						// predicted heading at (tx,ty):
						double  predict_phi;
						double cmd_v=0,cmd_w=0;

						if (trg_rel.y()==0)
						{	// In real-world conditions this might never happen, but just in case:
							predict_phi = 0;
							cmd_v = next_planned_point.max_v * sign(trg_rel.x());
							cmd_w = 0;
						}
						else
						{
							const double R = square(trg_dist_lin)/(2*trg_rel.y());
							// predicted heading at (tx,ty):
							predict_phi = atan2(trg_rel.x(),R-trg_rel.y());

							cmd_v = next_planned_point.max_v * sign(trg_rel.x());
							cmd_w = cmd_v/R;
						}

						// Good enough?
						if (ignore_trg_heading ||
							std::abs( wrapToPi(trg_rel.phi()-predict_phi))<DEG2RAD(7) )
						{
							good_cmd_found = true;
							good_cmd_v=cmd_v;
							good_cmd_w=cmd_w;
						}
					} // end case 1

					// ------------------------------------------
					// Scale velocities to the actual ranges:
					// ------------------------------------------
					if (good_cmd_found)
					{
						// SCALE: For maximum segment speeds:
						// ----------------------------------------
						if (std::abs(good_cmd_v)>next_planned_point.max_v)
						{
							const double K = next_planned_point.max_v / std::abs(good_cmd_v);
							good_cmd_v *= K;
							good_cmd_w *= K;
						}
						if (std::abs(good_cmd_w)>next_planned_point.max_w)
						{
							const double K = next_planned_point.max_w / std::abs(good_cmd_w);
							good_cmd_v *= K;
							good_cmd_w *= K;
						}

						// SCALE: Take into account the desired velocities when arriving at the target.
						// ------------------------------------------------------------------------------
						const double Av_to_trg = next_planned_point.trg_v - robot_v;
						const double min_At_to_change_to_trg_v = std::abs(Av_to_trg)/params.max_accel_v;

						if (good_cmd_v!=0 && ETA_target<=min_At_to_change_to_trg_v)
						{
							// We have to adapt velocity so we can get to the target right:
							const double new_v = next_planned_point.trg_v - (ETA_target/min_At_to_change_to_trg_v)*Av_to_trg;

							const double K = new_v / std::abs(good_cmd_v);
							good_cmd_v *= K;
							good_cmd_w *= K;
						}

						// SCALE: Is the command compatible with the maximum accelerations, wrt the current speed??
						// ----------------------------------------
						const double max_Av = params.max_accel_v * 0.2 /*sec*/;
						const double max_Aw = params.max_accel_w * 0.2 /*sec*/;
						if ( std::abs( good_cmd_v - robot_v )>max_Av )
						{
							if (good_cmd_v!=0)
							{
								const double rho = good_cmd_w/good_cmd_v;
								good_cmd_v = (good_cmd_v>robot_v) ? robot_v+max_Av :  robot_v-max_Av;
								good_cmd_w = rho*good_cmd_v;
							}
						}
						if ( std::abs( good_cmd_w - robot_w )>max_Aw )
						{
							if (good_cmd_w!=0)
							{
								const double R = good_cmd_v/good_cmd_w;
								good_cmd_w = (good_cmd_w>robot_w) ? robot_w+max_Aw :  robot_w-max_Aw;
								good_cmd_v = R*good_cmd_w;
							}
						}

						// Ok, send the command:
						// ----------------------------------------
						onMotionCommand(good_cmd_v,good_cmd_w);
					}
					else
					{
						// No valid motion found??!!
						// TODO: Raise some error.
						onMotionCommand(0,0);
					}

				} // end we haven't reached the target
			} // end we have proper localization
		} // end do path following

		// Run at XX Hz -------------------------------
		const TTimeStamp tim_now = now();
		int delay_ms;
		if (tim_last_iter != INVALID_TIMESTAMP)
		{
			const double tim_since_last = mrpt::system::timeDifference(tim_last_iter,tim_now);
			delay_ms = std::max(1, round( 1000.0*(DESIRED_PERIOD-tim_since_last) ) );
		}
		else delay_ms = 20;

		tim_last_iter = tim_now; // for the next iter.
		mrpt::system::sleep(delay_ms); // do the delay
	};
	cout << "[CPRRTNavigator:thread_path_tracking] Exit.\n";
}


text:
package com.jaregu.database.queries;

public interface RelativeQueries extends QueriesFinder<String> {

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Verh. bot. Ver. Prov. Brandenb. 70: 192 (1928)

#### Original name
Verrucaria erichsenii Zschacke

### Remarks
null


text:
package org.onlab.graph;

import org.junit.Test;
import java.util.Set;

import static com.google.common.collect.ImmutableSet.of;
import static org.junit.Assert.assertEquals;
//import static org.junit.Assert.assertTrue;

/**
 * Test of the Suurballe backup path algorithm.
 */
public class SuurballeGraphSearchTest extends BreadthFirstSearchTest {

    @Override
    protected AbstractGraphPathSearch<TestVertex, TestEdge> graphSearch() {
        return new SuurballeGraphSearch<>();
    }

    @Override
    public void defaultGraphTest() {

    }

    @Override
    public void defaultHopCountWeight() {

    }

    @Test
    public void basicGraphTest() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D),
                                                                      of(new TestEdge(A, B),
                                                                         new TestEdge(B, C),
                                                                         new TestEdge(A, D),
                                                                         new TestEdge(D, C)));
        executeSearch(graphSearch(), graph, A, C, null, 1, new ScalarWeight(4.0));
    }

    @Test
    public void multiplePathOnePairGraphTest() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D, E),
                                                                      of(new TestEdge(A, B, W1),
                                                                         new TestEdge(B, C, W1),
                                                                         new TestEdge(A, D, W1),
                                                                         new TestEdge(D, C, W1),
                                                                         new TestEdge(B, E, W2),
                                                                         new TestEdge(C, E, W1)));
        executeSearch(graphSearch(), graph, A, E, weigher, 1, new TestDoubleWeight(6.0));
    }

    @Test
    public void multiplePathsMultiplePairs() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D, E),
                                                                      of(new TestEdge(A, B, W1),
                                                                         new TestEdge(B, E, W1),
                                                                         new TestEdge(A, C, W1),
                                                                         new TestEdge(C, E, W1),
                                                                         new TestEdge(A, D, W1),
                                                                         new TestEdge(D, E, W1),
                                                                         new TestEdge(A, E, W2)));
        GraphPathSearch.Result<TestVertex, TestEdge> result =
                graphSearch().search(graph, A, E, weigher, GraphPathSearch.ALL_PATHS);
        Set<Path<TestVertex, TestEdge>> paths = result.paths();
        System.out.println("\n\n" + paths + "\n\n\ndone\n");
        assertEquals("incorrect paths count", 3, paths.size());
        DisjointPathPair<TestVertex, TestEdge> dpp = (DisjointPathPair<TestVertex, TestEdge>) paths.iterator().next();
        assertEquals("incorrect disjoint paths per path", 2, dpp.size());
    }

    @Test
    public void differingPrimaryAndBackupPathLengths() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D, E),
                                                                      of(new TestEdge(A, B),
                                                                         new TestEdge(B, C),
                                                                         new TestEdge(A, D),
                                                                         new TestEdge(D, C),
                                                                         new TestEdge(B, E),
                                                                         new TestEdge(C, E)));
        executeSearch(graphSearch(), graph, A, E, weigher, 1, new TestDoubleWeight(5.0));
    }

    @Test
    public void onePath() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D),
                                                                      of(new TestEdge(A, B, W1),
                                                                         new TestEdge(B, C, W1),
                                                                         new TestEdge(A, C, W4),
                                                                         new TestEdge(C, D, W1)));
        GraphPathSearch.Result<TestVertex, TestEdge> result =
                graphSearch().search(graph, A, D, weigher, GraphPathSearch.ALL_PATHS);
        Set<Path<TestVertex, TestEdge>> paths = result.paths();
        assertEquals("incorrect paths count", 1, paths.size());
        DisjointPathPair<TestVertex, TestEdge> dpp = (DisjointPathPair<TestVertex, TestEdge>) paths.iterator().next();
        assertEquals("incorrect disjoint paths count", 1, dpp.size());
    }

    @Test
    public void noPath() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D),
                                                                      of(new TestEdge(A, B, W1),
                                                                         new TestEdge(B, C, W1),
                                                                         new TestEdge(A, C, W4)));
        GraphPathSearch.Result<TestVertex, TestEdge> result =
                graphSearch().search(graph, A, D, weigher, GraphPathSearch.ALL_PATHS);
        Set<Path<TestVertex, TestEdge>> paths = result.paths();
        assertEquals("incorrect paths count", paths.size(), 0);
    }

    @Test
    public void disconnected() {
        Graph<TestVertex, TestEdge> graph = new AdjacencyListsGraph<>(of(A, B, C, D),
                                                                      of());
        GraphPathSearch.Result<TestVertex, TestEdge> result =
                graphSearch().search(graph, A, D, weigher, GraphPathSearch.ALL_PATHS);
        Set<Path<TestVertex, TestEdge>> paths = result.paths();
        assertEquals("incorrect paths count", 0, paths.size());
    }
}


text:
These tests can be run by loading the entire Typo.js project as a Chrome
extension and then loading the tests/index.html file in the browser. A
manifest.json file is included in the project root to make this as easy
as possible.


text:
FROM quay.io/pypa/manylinux2014_x86_64:2022-08-29-0fd77fa

# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH

# TODO(jtattermusch): revisit which of the deps are really required
RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel

###################################
# Install Python build requirements
RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
    && tar -zxf ccache.tar.gz \
    && cd ccache-4.5.1 \
    && mkdir build && cd build \
    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
    && make -j4 && make install \
    && cd ../.. \
    && rm -rf ccache-4.5.1 ccache.tar.gz

RUN git config --global --add safe.directory /var/local/jenkins/grpc


text:
package com.backendless.messaging;

public class MessageStatus implements Comparable<MessageStatus>
{
  private String messageId;
  private PublishStatusEnum status;
  private String errorMessage;

  public MessageStatus()
  {
  }

  public MessageStatus( String messageId )
  {
    this.messageId = messageId;
  }

  public PublishStatusEnum getStatus()
  {
    return status;
  }

  public String getMessageId()
  {
    return messageId;
  }

  public void setStatus( PublishStatusEnum status )
  {
    this.status = status;
  }

  public void setMessageId( String messageId )
  {
    this.messageId = messageId;
  }

  @Override
  public boolean equals( Object o )
  {
    if( this == o )
      return true;
    if( o == null || getClass() != o.getClass() )
      return false;

    MessageStatus that = (MessageStatus) o;

    if( messageId != null ? !messageId.equals( that.messageId ) : that.messageId != null )
      return false;
    if( status != that.status )
      return false;

    return true;
  }

  @Override
  public int hashCode()
  {
    int result = messageId != null ? messageId.hashCode() : 0;
    result = 31 * result + status.hashCode();
    return result;
  }

  @Override
  public String toString()
  {
    return "MessageStatus{" +
            "messageId='" + messageId + '\'' +
            ", status=" + status +
            '}';
  }

  @Override
  public int compareTo( MessageStatus o )
  {
    if( this == o )
      return 0;

    MessageStatus arg = (MessageStatus) o;

    int statusDiff = this.status == null ? (arg.getStatus() == null ? 0 : -1) : this.status.compareTo( arg.getStatus() );
    if( statusDiff != 0 )
      return statusDiff;

    return this.messageId == null ? (arg.getMessageId() == null ? 0 : -1) : this.messageId.compareTo( arg.getMessageId() );
  }

  public String getErrorMessage()
  {
    return errorMessage;
  }

  public void setErrorMessage( String errorMessage )
  {
    this.errorMessage = errorMessage;
  }
}


text:
package com.google.cloud.tools.eclipse.appengine.deploy;

import com.google.cloud.tools.appengine.AppEngineException;
import com.google.cloud.tools.appengine.configuration.AppEngineWebXmlProjectStageConfiguration;
import com.google.cloud.tools.appengine.configuration.AppYamlProjectStageConfiguration;
import com.google.cloud.tools.appengine.operations.AppEngineWebXmlProjectStaging;
import com.google.cloud.tools.appengine.operations.AppYamlProjectStaging;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubMonitor;

/**
 * Calls the staging operation on an App Engine project.
 */
public class CloudSdkStagingHelper {

  public static final String STANDARD_STAGING_GENERATED_FILES_DIRECTORY =
      "WEB-INF/appengine-generated";

  /**
   * @param explodedWarDirectory the input of the staging operation
   * @param stagingDirectory where the result of the staging operation will be written
   * @param appEngineStandardStaging executes the staging operation
   * @throws AppEngineException when staging fails
   */
  public static void stageStandard(IPath explodedWarDirectory, IPath stagingDirectory,
      AppEngineWebXmlProjectStaging appEngineStandardStaging, IProgressMonitor monitor)
          throws AppEngineException {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException("canceled early");
    }

    SubMonitor progress = SubMonitor.convert(monitor, 1);
    progress.setTaskName(Messages.getString("task.name.stage.project")); //$NON-NLS-1$

    AppEngineWebXmlProjectStageConfiguration stagingConfig =
        AppEngineWebXmlProjectStageConfiguration.builder(
            explodedWarDirectory.toFile().toPath(), stagingDirectory.toFile().toPath())
            .enableJarSplitting(true)
            .disableUpdateCheck(true)
            .build();

    appEngineStandardStaging.stageStandard(stagingConfig);

    progress.worked(1);
  }

  /**
   * @param appEngineDirectory directory containing {@code app.yaml}
   * @param deployArtifact project to be deploy (such as WAR or JAR)
   * @param stagingDirectory where the result of the staging operation will be written
   * @throws AppEngineException when staging fails
   * @throws OperationCanceledException when user cancels the operation
   */
  public static void stageFlexible(IPath appEngineDirectory, IPath deployArtifact,
      IPath stagingDirectory, IProgressMonitor monitor) throws AppEngineException {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException("canceled early"); //$NON-NLS-1$
    }

    SubMonitor progress = SubMonitor.convert(monitor, 1);
    progress.setTaskName(Messages.getString("task.name.stage.project")); //$NON-NLS-1$

    AppYamlProjectStageConfiguration stagingConfig =
        AppYamlProjectStageConfiguration.builder(appEngineDirectory.toFile().toPath(),
            deployArtifact.toFile().toPath(), stagingDirectory.toFile().toPath()).build();

    AppYamlProjectStaging staging = new AppYamlProjectStaging();
    staging.stageArchive(stagingConfig);

    progress.worked(1);
  }
}