Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 245804 | Differences between
and this patch

Collapse All | Expand All

(-)apron-0.9.9-orig/ppl/README (-14 / +9 lines)
Lines 2-8 Link Here
2
#
2
#
3
# APRON Library / Parma Polyhedra Library
3
# APRON Library / Parma Polyhedra Library
4
#
4
#
5
# Copyright (C) Antoine Mine' 2006
5
# Copyright (C) Antoine Mine' 2006-2009
6
6
7
# This file is part of the APRON Library, released under GPL license.
7
# This file is part of the APRON Library, released under GPL license.
8
# Please read the COPYING file packaged in the distribution
8
# Please read the COPYING file packaged in the distribution
Lines 13-19 Link Here
13
Requirements:
13
Requirements:
14
- APRON
14
- APRON
15
- ITV
15
- ITV
16
- PPL library version 0.9, with GMP support
16
- PPL library version 0.9 or 0.10, with GMP support
17
- GMPXX (normally installed with GMP)
17
- GMPXX (normally installed with GMP)
18
- for apron_ppl_test: NewPolka APRON module
18
- for apron_ppl_test: NewPolka APRON module
19
19
Lines 21-39 Link Here
21
will automatically build and install this module.
21
will automatically build and install this module.
22
22
23
23
24
IMPORTANT
24
9/2/2009 changes
25
25
- the wrapper has been updated to compile PPL version 0.10
26
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- it should still compile with version 0.9 of PPL provided that you apply
27
27
the provided patch
28
   PPL 0.9 misses Grid_Generator::coefficient and must be patched
29
30
   please apply ppl.patch against PPL 0.9 as follows:
31
32
   1. go to the directoy containing the ppl-0.9 directory
28
   1. go to the directoy containing the ppl-0.9 directory
33
   2. type 'patch -p0 <PREFIX/apron/ppl/ppl.patch'
29
   2. type 'patch -p0 <PREFIX/apron/ppl/ppl.patch'
34
   and then compile ppl
30
   and then compile ppl
35
31
- you can also compile with version 0.10 of PPL _without applying any patch_
36
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
32
- calls to depreciated _and_minimize functions have been removed
37
33
38
34
39
What is provided:
35
What is provided:
Lines 51-58 Link Here
51
- Polyhedra and grids are experimental but tested
47
- Polyhedra and grids are experimental but tested
52
- semantics of assign and subst on grids with integer variables is not
48
- semantics of assign and subst on grids with integer variables is not
53
  fully aggreed upon and may change
49
  fully aggreed upon and may change
54
- no support for other domains in PPL (BD_Shape, Powerset)
50
- no support for other domains in PPL (BD_Shape, Octagonal_Shape, Powerset)
55
- only PPL 0.9 was tested, other PPL version might not work
56
- not implemented: fprintfdiff, (de)serialize_raw
51
- not implemented: fprintfdiff, (de)serialize_raw
57
- precision could be improved for:
52
- precision could be improved for:
58
  . sat_lincons
53
  . sat_lincons
(-)apron-0.9.9-orig/ppl/ppl_grid.cc (-8 / +53 lines)
Lines 17-24 Link Here
17
#include <assert.h>
17
#include <assert.h>
18
#include "ap_generic.h"
18
#include "ap_generic.h"
19
#include "ap_ppl.h"
19
#include "ap_ppl.h"
20
#include "ppl_grid.hh"
21
#include "ppl_user.hh"
20
#include "ppl_user.hh"
21
#include "ppl_grid.hh"
22
22
23
#include <ppl.hh>
23
#include <ppl.hh>
24
using namespace std;
24
using namespace std;
Lines 60-72 Link Here
60
void PPL_Grid::reduce() 
60
void PPL_Grid::reduce() 
61
{
61
{
62
  for (size_t i=0;i<intdim;i++)
62
  for (size_t i=0;i<intdim;i++)
63
    p->add_congruence_and_minimize((Variable(i) %=0) / 1);
63
    p->add_congruence((Variable(i) %=0) / 1);
64
}
64
}
65
65
66
void PPL_Grid::forget_dim(size_t dim)
66
void PPL_Grid::forget_dim(size_t dim)
67
{
67
{
68
  if (intdim>dim) p->add_generator_and_minimize(Grid_Generator::parameter(Variable(dim)));
68
#ifndef PPL_0_9
69
  else p->add_generator_and_minimize(Grid_Generator::line(Variable(dim)));
69
  if (intdim>dim) p->add_grid_generator(Grid_Generator::parameter(Variable(dim)));
70
  else p->add_grid_generator(Grid_Generator::grid_line(Variable(dim)));
71
#else
72
  if (intdim>dim) p->add_generator(Grid_Generator::parameter(Variable(dim)));
73
  else p->add_generator(Grid_Generator::line(Variable(dim)));
74
#endif
70
}
75
}
71
76
72
PPL_Grid::~PPL_Grid() { delete p; }
77
PPL_Grid::~PPL_Grid() { delete p; }
Lines 221-227 Link Here
221
    ((PPL_Grid*)a)->reduce();
226
    ((PPL_Grid*)a)->reduce();
222
    /* the calls force in-place minimisation */
227
    /* the calls force in-place minimisation */
223
    (void)a->p->minimized_congruences();
228
    (void)a->p->minimized_congruences();
229
#ifndef PPL_0_9
230
    (void)a->p->minimized_grid_generators();
231
#else
224
    (void)a->p->minimized_generators();
232
    (void)a->p->minimized_generators();
233
#endif
225
  }
234
  }
226
  CATCH_WITH_VOID(AP_FUNID_MINIMIZE);
235
  CATCH_WITH_VOID(AP_FUNID_MINIMIZE);
227
}
236
}
Lines 235-241 Link Here
235
    ((PPL_Grid*)a)->reduce();
244
    ((PPL_Grid*)a)->reduce();
236
    /* the calls force in-place minimisation */
245
    /* the calls force in-place minimisation */
237
    (void)a->p->minimized_congruences();
246
    (void)a->p->minimized_congruences();
247
#ifndef PPL_0_9
248
    (void)a->p->minimized_grid_generators();
249
#else
238
    (void)a->p->minimized_generators();
250
    (void)a->p->minimized_generators();
251
#endif
239
  }
252
  }
240
  CATCH_WITH_VOID(AP_FUNID_CANONICALIZE);
253
  CATCH_WITH_VOID(AP_FUNID_CANONICALIZE);
241
}
254
}
Lines 244-249 Link Here
244
{ 
257
{ 
245
  man->result.flag_exact = man->result.flag_best = true;
258
  man->result.flag_exact = man->result.flag_best = true;
246
  try {
259
  try {
260
    ((PPL_Grid*)a)->reduce();
261
    /* the calls force in-place minimisation */
262
    (void)a->p->minimized_congruences();
263
#ifndef PPL_0_9
264
    (void)a->p->minimized_grid_generators();
265
#else
266
    (void)a->p->minimized_generators();
267
#endif
247
    return a->p->total_memory_in_bytes(); 
268
    return a->p->total_memory_in_bytes(); 
248
  }
269
  }
249
  CATCH_WITH_VAL(AP_FUNID_HASH,0);
270
  CATCH_WITH_VAL(AP_FUNID_HASH,0);
Lines 305-311 Link Here
305
    ap_lincons0_array_clear(&ar);
326
    ap_lincons0_array_clear(&ar);
306
    /* dump generators */
327
    /* dump generators */
307
    fprintf(stream,"generators: ");
328
    fprintf(stream,"generators: ");
329
#ifndef PPL_0_9
330
    ap_generator0_array_t ar2 = ap_ppl_to_generator_array(a->p->grid_generators());
331
#else
308
    ap_generator0_array_t ar2 = ap_ppl_to_generator_array(a->p->generators());
332
    ap_generator0_array_t ar2 = ap_ppl_to_generator_array(a->p->generators());
333
#endif
309
    ap_generator0_array_fprint(stream,&ar2,NULL);
334
    ap_generator0_array_fprint(stream,&ar2,NULL);
310
    ap_generator0_array_clear(&ar2);
335
    ap_generator0_array_clear(&ar2);
311
  }
336
  }
Lines 371-377 Link Here
371
    Congruence_System c;
396
    Congruence_System c;
372
    if (!ap_ppl_of_box(c,tinterval,intdim,realdim))
397
    if (!ap_ppl_of_box(c,tinterval,intdim,realdim))
373
      man->result.flag_exact = man->result.flag_best = false;
398
      man->result.flag_exact = man->result.flag_best = false;
374
    r->p->add_recycled_congruences_and_minimize(c);
399
    r->p->add_recycled_congruences(c);
375
    return r;
400
    return r;
376
  }
401
  }
377
  CATCH_WITH_DIM(AP_FUNID_OF_BOX,intdim,realdim);
402
  CATCH_WITH_DIM(AP_FUNID_OF_BOX,intdim,realdim);
Lines 520-526 Link Here
520
{
545
{
521
  man->result.flag_exact = man->result.flag_best = true;
546
  man->result.flag_exact = man->result.flag_best = true;
522
  try {
547
  try {
548
#ifndef PPL_0_9
549
    Grid_Generator g = Grid_Generator::grid_line(Variable(dim));
550
#else
523
    Grid_Generator g = Grid_Generator::line(Variable(dim));
551
    Grid_Generator g = Grid_Generator::line(Variable(dim));
552
#endif
524
    return a->p->relation_with(g) == Poly_Gen_Relation::subsumes();
553
    return a->p->relation_with(g) == Poly_Gen_Relation::subsumes();
525
  }
554
  }
526
  CATCH_WITH_VAL(AP_FUNID_IS_DIMENSION_UNCONSTRAINED,false);
555
  CATCH_WITH_VAL(AP_FUNID_IS_DIMENSION_UNCONSTRAINED,false);
Lines 671-677 Link Here
671
{
700
{
672
  man->result.flag_exact = man->result.flag_best = true;
701
  man->result.flag_exact = man->result.flag_best = true;
673
  try {
702
  try {
703
#ifndef PPL_0_9
704
    return ap_ppl_to_generator_array(a->p->grid_generators());
705
#else
674
    return ap_ppl_to_generator_array(a->p->generators());
706
    return ap_ppl_to_generator_array(a->p->generators());
707
#endif
675
  }
708
  }
676
  CATCH_WITH_VAL(AP_FUNID_TO_GENERATOR_ARRAY,ap_ppl_generator_universe(a->p->space_dimension()));
709
  CATCH_WITH_VAL(AP_FUNID_TO_GENERATOR_ARRAY,ap_ppl_generator_universe(a->p->space_dimension()));
677
}
710
}
Lines 706-712 Link Here
706
  try {
739
  try {
707
    PPL_Grid* r = destructive ? a1 : new PPL_Grid(*a1);
740
    PPL_Grid* r = destructive ? a1 : new PPL_Grid(*a1);
708
    /* TODO: should we use join_assign_if_exact? */
741
    /* TODO: should we use join_assign_if_exact? */
742
#ifndef PPL_0_9
743
    r->p->upper_bound_assign(*a2->p);
744
#else
709
    r->p->join_assign(*a2->p);
745
    r->p->join_assign(*a2->p);
746
#endif
710
    return r; 
747
    return r; 
711
  }
748
  }
712
  CATCH_WITH_GRID(AP_FUNID_JOIN,a1);
749
  CATCH_WITH_GRID(AP_FUNID_JOIN,a1);
Lines 738-744 Link Here
738
    PPL_Grid* r = new PPL_Grid(*tab[0]);
775
    PPL_Grid* r = new PPL_Grid(*tab[0]);
739
    for (size_t i=1;i<size;i++)
776
    for (size_t i=1;i<size;i++)
740
      /* TODO: should we use join_assign_if_exact? */
777
      /* TODO: should we use join_assign_if_exact? */
778
#ifndef PPL_0_9
779
      r->p->upper_bound_assign(*tab[i]->p);
780
#else
741
      r->p->join_assign(*tab[i]->p);
781
      r->p->join_assign(*tab[i]->p);
782
#endif
742
  return r;
783
  return r;
743
  }
784
  }
744
  CATCH_WITH_GRID(AP_FUNID_JOIN_ARRAY,tab[0]);
785
  CATCH_WITH_GRID(AP_FUNID_JOIN_ARRAY,tab[0]);
Lines 757-763 Link Here
757
    Congruence_System c;
798
    Congruence_System c;
758
    if (!ap_ppl_of_lincons_array(intern->itv,c,array))
799
    if (!ap_ppl_of_lincons_array(intern->itv,c,array))
759
      man->result.flag_exact = man->result.flag_best = false;
800
      man->result.flag_exact = man->result.flag_best = false;
760
    r->p->add_recycled_congruences_and_minimize(c);
801
    r->p->add_recycled_congruences(c);
761
    return r;
802
    return r;
762
  }
803
  }
763
  CATCH_WITH_GRID(AP_FUNID_MEET_LINCONS_ARRAY,a);
804
  CATCH_WITH_GRID(AP_FUNID_MEET_LINCONS_ARRAY,a);
Lines 790-796 Link Here
790
      Grid_Generator_System c;
831
      Grid_Generator_System c;
791
      if (!ap_ppl_of_generator_array(intern->itv,c,array))
832
      if (!ap_ppl_of_generator_array(intern->itv,c,array))
792
	man->result.flag_exact = man->result.flag_best = false;
833
	man->result.flag_exact = man->result.flag_best = false;
793
      r->p->add_recycled_generators_and_minimize(c);
834
#ifndef PPL_0_9
835
      r->p->add_recycled_grid_generators(c);
836
#else
837
      r->p->add_recycled_generators(c);
838
#endif
794
      r->reduce();
839
      r->reduce();
795
    }
840
    }
796
    return r;
841
    return r;
Lines 949-955 Link Here
949
	r->forget_dim(tdim[i]);
994
	r->forget_dim(tdim[i]);
950
      if (project) {
995
      if (project) {
951
	for (size_t i=0;i<size;i++)
996
	for (size_t i=0;i<size;i++)
952
	  r->p->add_constraint_and_minimize(Variable(tdim[i])==0);
997
	  r->p->add_constraint(Variable(tdim[i])==0);
953
      }
998
      }
954
      else {
999
      else {
955
	r->reduce();
1000
	r->reduce();
(-)apron-0.9.9-orig/ppl/ppl_poly.cc (-2 / +3 lines)
Lines 17-26 Link Here
17
#include <assert.h>
17
#include <assert.h>
18
#include "ap_generic.h"
18
#include "ap_generic.h"
19
#include "ap_linearize.h"
19
#include "ap_linearize.h"
20
21
#include "ap_ppl.h"
20
#include "ap_ppl.h"
22
#include "ppl_poly.hh"
23
#include "ppl_user.hh"
21
#include "ppl_user.hh"
22
#include "ppl_poly.hh"
24
23
25
#include <ppl.hh>
24
#include <ppl.hh>
26
using namespace std;
25
using namespace std;
Lines 237-242 Link Here
237
{
236
{
238
  man->result.flag_exact = man->result.flag_best = true;
237
  man->result.flag_exact = man->result.flag_best = true;
239
  try {
238
  try {
239
    (void)a->p->minimized_constraints();
240
    (void)a->p->minimized_generators();    
240
    return a->p->total_memory_in_bytes();
241
    return a->p->total_memory_in_bytes();
241
  }
242
  }
242
  CATCH_WITH_VAL(AP_FUNID_HASH,0);
243
  CATCH_WITH_VAL(AP_FUNID_HASH,0);
(-)apron-0.9.9-orig/ppl/ppl_user.cc (+14 lines)
Lines 83-89 Link Here
83
  ap_linexpr0_t* e;
83
  ap_linexpr0_t* e;
84
  int i, n = c.space_dimension();
84
  int i, n = c.space_dimension();
85
  /* special, inconsistent case */
85
  /* special, inconsistent case */
86
#ifndef PPL_0_9
87
  if (c.is_inconsistent())
88
#else
86
  if (c.is_trivial_false())
89
  if (c.is_trivial_false())
90
#endif
87
    return ap_lincons0_make_unsat();
91
    return ap_lincons0_make_unsat();
88
  /* other cases */
92
  /* other cases */
89
  e = ap_linexpr0_alloc(AP_LINEXPR_DENSE,n);
93
  e = ap_linexpr0_alloc(AP_LINEXPR_DENSE,n);
Lines 629-637 Link Here
629
  }
633
  }
630
  ap_ppl_of_linexpr(intern,l,den,c->linexpr0,1);
634
  ap_ppl_of_linexpr(intern,l,den,c->linexpr0,1);
631
  switch (c->gentyp) {
635
  switch (c->gentyp) {
636
#ifndef PPL_0_9
637
  case AP_GEN_VERTEX:  r = Grid_Generator::grid_point(l,den);     return true;
638
  case AP_GEN_RAY:     r = Grid_Generator::grid_line(l);          return false;
639
  case AP_GEN_LINE:    r = Grid_Generator::grid_line(l);          return true;
640
#else
632
  case AP_GEN_VERTEX:  r = Grid_Generator::point(l,den);     return true;
641
  case AP_GEN_VERTEX:  r = Grid_Generator::point(l,den);     return true;
633
  case AP_GEN_RAY:     r = Grid_Generator::line(l);          return false;
642
  case AP_GEN_RAY:     r = Grid_Generator::line(l);          return false;
634
  case AP_GEN_LINE:    r = Grid_Generator::line(l);          return true;
643
  case AP_GEN_LINE:    r = Grid_Generator::line(l);          return true;
644
#endif
635
  case AP_GEN_RAYMOD:  r = Grid_Generator::parameter(l,den); return false;
645
  case AP_GEN_RAYMOD:  r = Grid_Generator::parameter(l,den); return false;
636
  case AP_GEN_LINEMOD: r = Grid_Generator::parameter(l,den); return true;
646
  case AP_GEN_LINEMOD: r = Grid_Generator::parameter(l,den); return true;
637
  default:
647
  default:
Lines 647-653 Link Here
647
{
657
{
648
  bool exact = true;
658
  bool exact = true;
649
  size_t i;
659
  size_t i;
660
#ifndef PPL_0_9
661
  Grid_Generator c = Grid_Generator::grid_point();
662
#else
650
  Grid_Generator c = Grid_Generator::point();
663
  Grid_Generator c = Grid_Generator::point();
664
#endif
651
  r.clear();
665
  r.clear();
652
  for (i=0;i<a->size;i++) {
666
  for (i=0;i<a->size;i++) {
653
    if (ap_ppl_ap_generator0_select(&a->p[i])){
667
    if (ap_ppl_ap_generator0_select(&a->p[i])){
(-)apron-0.9.9-orig/ppl/ppl_user.hh (+10 lines)
Lines 34-39 Link Here
34
using namespace std;
34
using namespace std;
35
using namespace Parma_Polyhedra_Library;
35
using namespace Parma_Polyhedra_Library;
36
*/
36
*/
37
38
#ifndef PPL_VERSION_MAJOR 
39
#error "no version information"
40
#endif
41
42
#if (PPL_VERSION_MAJOR==0) && (PPL_VERSION_MINOR <= 9)
43
#define PPL_0_9
44
#endif
45
46
37
/* ********************************************************************** */
47
/* ********************************************************************** */
38
/* Types and exceptions */
48
/* Types and exceptions */
39
/* ********************************************************************** */
49
/* ********************************************************************** */

Return to bug 245804